aboutsummaryrefslogtreecommitdiff
path: root/runtime/ftplugin
diff options
context:
space:
mode:
authorAnmol Sethi <anmol@aubble.com>2016-11-18 13:21:45 -0500
committerAnmol Sethi <anmol@aubble.com>2016-11-18 14:06:42 -0500
commitcf52b881d987a5e5175b0df2304832c58ba065f7 (patch)
treee6157f5ab8e4dc3f278ab6f6097aa4febaad804a /runtime/ftplugin
parentacbce46782c4e948e7f6a79bbeb58aac62c4c9ab (diff)
downloadrneovim-cf52b881d987a5e5175b0df2304832c58ba065f7.tar.gz
rneovim-cf52b881d987a5e5175b0df2304832c58ba065f7.tar.bz2
rneovim-cf52b881d987a5e5175b0df2304832c58ba065f7.zip
man.vim: no guarantee that the first line contains anything useful
Fixes #5628
Diffstat (limited to 'runtime/ftplugin')
-rw-r--r--runtime/ftplugin/man.vim10
1 files changed, 7 insertions, 3 deletions
diff --git a/runtime/ftplugin/man.vim b/runtime/ftplugin/man.vim
index f6fefd0155..4ed21e146e 100644
--- a/runtime/ftplugin/man.vim
+++ b/runtime/ftplugin/man.vim
@@ -11,7 +11,7 @@ let s:pager = 0
if has('vim_starting')
let s:pager = 1
" remove all those backspaces
- silent execute 'keeppatterns keepjumps %substitute,.\b,,e'.(&gdefault?'':'g')
+ execute 'silent keeppatterns keepjumps %substitute,.\b,,e'.(&gdefault?'':'g')
if getline(1) =~# '^\s*$'
silent keepjumps 1delete _
else
@@ -20,8 +20,12 @@ if has('vim_starting')
" This is not perfect. See `man glDrawArraysInstanced`. Since the title is
" all caps it is impossible to tell what the original capitilization was.
let ref = tolower(matchstr(getline(1), '^\S\+'))
- let b:man_sect = man#extract_sect_and_name_ref(ref)[0]
- execute 'silent file man://'.ref
+ try
+ let b:man_sect = man#extract_sect_and_name_ref(ref)[0]
+ catch
+ let b:man_sect = ''
+ endtry
+ execute 'silent file man://'.fnameescape(ref)
endif
setlocal buftype=nofile