aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2021-09-16 21:51:26 +0800
committerGitHub <noreply@github.com>2021-09-16 06:51:26 -0700
commit29bc648d2b259d434c46f3eb28d3513d2a4aef11 (patch)
treea39f3c9e568037d7d7b34a2605d90c659d8d9727
parent685cf398130c61c158401b992a1893c2405cd7d2 (diff)
downloadrneovim-29bc648d2b259d434c46f3eb28d3513d2a4aef11.tar.gz
rneovim-29bc648d2b259d434c46f3eb28d3513d2a4aef11.tar.bz2
rneovim-29bc648d2b259d434c46f3eb28d3513d2a4aef11.zip
fix(man.vim): ensure buftype=nofile after :tag or :stag #15675
Problem: `buftype=help` occasionally propagates from help to man buffer. As a result the next time you open help it opens in the man window, replacing the manpage. Test case: nvim -u NORC :Man man :set bt? " should print `buftype=nofile` :help <C-W><C-W><C-W>c " go back to :Man window and close it :help " focus help window :Man man " open window with manpage again :set bt? " prints `buftype=help` Solution: - call s:set_options() - man#read_page() (called by autocmd BufReadCmd man://*) should already do this. But BufReadCmd doesn't fire for already-existing man:// buffers. Fix #15650
-rw-r--r--runtime/autoload/man.vim1
1 files changed, 1 insertions, 0 deletions
diff --git a/runtime/autoload/man.vim b/runtime/autoload/man.vim
index 8bf95651b7..4f132b6121 100644
--- a/runtime/autoload/man.vim
+++ b/runtime/autoload/man.vim
@@ -58,6 +58,7 @@ function! man#open_page(count, mods, ...) abort
else
execute 'silent keepalt' a:mods 'stag' l:target
endif
+ call s:set_options(v:false)
finally
call setbufvar(l:buf, '&tagfunc', l:save_tfu)
endtry