aboutsummaryrefslogtreecommitdiff
path: root/runtime/ftplugin
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2016-11-19 22:50:10 +0100
committerGitHub <noreply@github.com>2016-11-19 22:50:10 +0100
commit42033bc5bd4bd0f06b33391e12672900bc21b993 (patch)
treefd997dd66777e7a5cc3f9c53459d9725fa6c3dd3 /runtime/ftplugin
parentacbce46782c4e948e7f6a79bbeb58aac62c4c9ab (diff)
parent7a4d069bccd3d19741d50d64052e386ac4e7cfc8 (diff)
downloadrneovim-42033bc5bd4bd0f06b33391e12672900bc21b993.tar.gz
rneovim-42033bc5bd4bd0f06b33391e12672900bc21b993.tar.bz2
rneovim-42033bc5bd4bd0f06b33391e12672900bc21b993.zip
Merge #5630 from nhooyr/man-ftplugin
man.vim: bug fixes
Diffstat (limited to 'runtime/ftplugin')
-rw-r--r--runtime/ftplugin/man.vim20
1 files changed, 4 insertions, 16 deletions
diff --git a/runtime/ftplugin/man.vim b/runtime/ftplugin/man.vim
index f6fefd0155..b8acd901a8 100644
--- a/runtime/ftplugin/man.vim
+++ b/runtime/ftplugin/man.vim
@@ -1,27 +1,15 @@
" Maintainer: Anmol Sethi <anmol@aubble.com>
" Previous Maintainer: SungHyun Nam <goweol@gmail.com>
-if exists('b:did_ftplugin') || &filetype !=# 'man'
+if exists('b:did_ftplugin')
finish
endif
let b:did_ftplugin = 1
-let s:pager = 0
+let s:pager = !exists('b:man_sect')
-if has('vim_starting')
- let s:pager = 1
- " remove all those backspaces
- silent execute 'keeppatterns keepjumps %substitute,.\b,,e'.(&gdefault?'':'g')
- if getline(1) =~# '^\s*$'
- silent keepjumps 1delete _
- else
- keepjumps 1
- endif
- " 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
+if s:pager
+ call man#init_pager()
endif
setlocal buftype=nofile