Use existing window if already present
pappasam opened this issue · comments
If a keywordprg window is already open, the same keywordprg command's query should overwrite the existing window instead of creating a new one on top of it. This would be consistent with the ":help" keywordprg's behavior.
This should be achievable by searching for visible windows and going to them if their filetype conforms to the soon-to-be created filetype.
Addressed in 8d2bd97. That said, weird behavior present:
If there's an error window, then I open a non-error help buffer, then I re-open the error buffer, I get a message:
"line 22:W10: Warning: Changing a readonly file"
I think this is caused by the command writing the same error message twice unnecessarily.
Solution: consider using same "system()" call as vim-filetype-formatter.
Fixed in bcd5550