diff options
author | Anmol Sethi <hi@nhooyr.io> | 2019-11-24 20:30:04 -0500 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-11-24 17:30:04 -0800 |
commit | 526798a941b4cf80fd1f128b40e51fb47c77b654 (patch) | |
tree | ebbfcd6da0101a752d36b28524ef85f1057ac849 | |
parent | d5aaad14ecdd2047089e1a018e97af1f790b3e42 (diff) | |
download | rneovim-526798a941b4cf80fd1f128b40e51fb47c77b654.tar.gz rneovim-526798a941b4cf80fd1f128b40e51fb47c77b654.tar.bz2 rneovim-526798a941b4cf80fd1f128b40e51fb47c77b654.zip |
man.vim: Ensure 'modifiable' in man#init_pager #11450
-rw-r--r-- | runtime/autoload/man.vim | 8 | ||||
-rw-r--r-- | runtime/syntax/man.vim | 3 |
2 files changed, 9 insertions, 2 deletions
diff --git a/runtime/autoload/man.vim b/runtime/autoload/man.vim index 36f42c0003..c559ca9f27 100644 --- a/runtime/autoload/man.vim +++ b/runtime/autoload/man.vim @@ -1,4 +1,4 @@ -" Maintainer: Anmol Sethi <anmol@aubble.com> +" Maintainer: Anmol Sethi <hi@nhooyr.io> if exists('s:loaded_man') finish @@ -357,6 +357,10 @@ function! s:format_candidate(path, psect) abort endfunction function! man#init_pager() abort + " https://github.com/neovim/neovim/issues/6828 + let og_modifiable = &modifiable + setlocal modifiable + if getline(1) =~# '^\s*$' silent keepjumps 1delete _ else @@ -374,6 +378,8 @@ function! man#init_pager() abort if -1 == match(bufname('%'), 'man:\/\/') " Avoid duplicate buffers, E95. execute 'silent file man://'.tolower(fnameescape(ref)) endif + + let &l:modifiable = og_modifiable endfunction function! man#goto_tag(pattern, flags, info) abort diff --git a/runtime/syntax/man.vim b/runtime/syntax/man.vim index 6afe56a6e3..7ac02c3f63 100644 --- a/runtime/syntax/man.vim +++ b/runtime/syntax/man.vim @@ -1,4 +1,4 @@ -" Maintainer: Anmol Sethi <anmol@aubble.com> +" Maintainer: Anmol Sethi <hi@nhooyr.io> " Previous Maintainer: SungHyun Nam <goweol@gmail.com> if exists('b:current_syntax') @@ -30,6 +30,7 @@ endif if !exists('b:man_sect') call man#init_pager() endif + if b:man_sect =~# '^[023]' syntax case match syntax include @c $VIMRUNTIME/syntax/c.vim |