The <Plug> mappings in plugin/man.vim and some of the mappings
specific to man page buffers (in fewer cases) can cause an infinite loop
in the remove_blank_lines_from_top_and_bottom function.
This can happen when <cword> expands to the empty string inside
man#get_page_from_cword or to anything else that will cause the
function to call man#get_page with the empty string as the last
argument. E.g.: use K inside a man page buffer while the cursor is on
an empty line.
On my system, manpage_exists will return 1 because the output of
man -w without extra arguments
(/usr/local/man:/usr/local/share/man:/usr/share/man here) looks like a
man page to it. man#helpers#load_manpage_text is then called with two
empty strings and r!/usr/bin/man 2>/dev/null | col -b leaves the new
buffer empty. Finally, remove_blank_lines_from_top_and_bottom goes
into an infinite loop of trying to remove the only line in the buffer.
The
<Plug>
mappings inplugin/man.vim
and some of the mappings specific to man page buffers (in fewer cases) can cause an infinite loop in theremove_blank_lines_from_top_and_bottom
function.This can happen when
<cword>
expands to the empty string insideman#get_page_from_cword
or to anything else that will cause the function to callman#get_page
with the empty string as the last argument. E.g.: useK
inside a man page buffer while the cursor is on an empty line.On my system,
manpage_exists
will return1
because the output ofman -w
without extra arguments (/usr/local/man:/usr/local/share/man:/usr/share/man
here) looks like a man page to it.man#helpers#load_manpage_text
is then called with two empty strings andr!/usr/bin/man 2>/dev/null | col -b
leaves the new buffer empty. Finally,remove_blank_lines_from_top_and_bottom
goes into an infinite loop of trying to remove the only line in the buffer.