man.vim: get page after opening split (#6032)

This will ensure that $MANWIDTH is correctly set.
This commit is contained in:
Anmol Sethi
2017-01-31 10:03:45 -05:00
committed by Justin M. Keyes
parent 5bcb972a88
commit 39a6f835e7

View File

@@ -39,7 +39,6 @@ function! man#open_page(count, count1, mods, ...) abort
let sect = string(a:count) let sect = string(a:count)
endif endif
let [sect, name, path] = s:verify_exists(sect, name) let [sect, name, path] = s:verify_exists(sect, name)
let page = s:get_page(path)
catch catch
call s:error(v:exception) call s:error(v:exception)
return return
@@ -52,6 +51,15 @@ function! man#open_page(count, count1, mods, ...) abort
else else
noautocmd execute 'silent' a:mods 'split' fnameescape(bufname) noautocmd execute 'silent' a:mods 'split' fnameescape(bufname)
endif endif
try
let page = s:get_page(path)
catch
close
call s:error(v:exception)
return
endtry
let b:man_sect = sect let b:man_sect = sect
call s:put_page(page) call s:put_page(page)
endfunction endfunction