Skip to content

Commit 8457e6b

Browse files
author
Bruno Sutic
committed
Merge pull request #29 from meribold/master
Fix mappings causing infinite loop in some cases
2 parents 9984a14 + 7138994 commit 8457e6b

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

autoload/man.vim

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ function! man#get_page(split_type, ...)
4040
endfunction
4141

4242
function! s:manpage_exists(sect, page)
43+
if a:page ==# ''
44+
return 0
45+
endif
4346
let find_arg = man#helpers#find_arg()
4447
let where = system('/usr/bin/man '.find_arg.' '.man#helpers#get_cmd_arg(a:sect, a:page))
4548
if where !~# '^\s*/'

autoload/man/helpers.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@ function! man#helpers#load_manpage_text(page, section)
7676
endfunction
7777

7878
function! s:remove_blank_lines_from_top_and_bottom()
79-
while getline(1) =~ '^\s*$'
79+
while line('$') > 1 && getline(1) =~ '^\s*$'
8080
silent keepj norm! ggdd
8181
endwhile
82-
while getline('$') =~ '^\s*$'
82+
while line('$') > 1 && getline('$') =~ '^\s*$'
8383
silent keepj norm! Gdd
8484
endwhile
8585
silent keepj norm! gg

0 commit comments

Comments
 (0)