mirror of
https://github.com/neovim/neovim.git
synced 2024-12-20 03:05:11 -07:00
man.vim: Ensure 'modifiable' in man#init_pager #11450
This commit is contained in:
parent
d5aaad14ec
commit
526798a941
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user