Skip to content

Commit

Permalink
fix(man.vim): ensure buftype=nofile after :tag or :stag neovim#15675
Browse files Browse the repository at this point in the history
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 neovim#15650
  • Loading branch information
zeertzjq committed Sep 16, 2021
1 parent 685cf39 commit 29bc648
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions runtime/autoload/man.vim
Expand Up @@ -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
Expand Down

0 comments on commit 29bc648

Please sign in to comment.