mirror of
https://github.com/neovim/neovim.git
synced 2025-09-07 03:48:18 +00:00
man.vim: Ensure 'modifiable' in man#init_pager #11450
This commit is contained in:

committed by
Justin M. Keyes

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')
|
if exists('s:loaded_man')
|
||||||
finish
|
finish
|
||||||
@@ -357,6 +357,10 @@ function! s:format_candidate(path, psect) abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! man#init_pager() abort
|
function! man#init_pager() abort
|
||||||
|
" https://github.com/neovim/neovim/issues/6828
|
||||||
|
let og_modifiable = &modifiable
|
||||||
|
setlocal modifiable
|
||||||
|
|
||||||
if getline(1) =~# '^\s*$'
|
if getline(1) =~# '^\s*$'
|
||||||
silent keepjumps 1delete _
|
silent keepjumps 1delete _
|
||||||
else
|
else
|
||||||
@@ -374,6 +378,8 @@ function! man#init_pager() abort
|
|||||||
if -1 == match(bufname('%'), 'man:\/\/') " Avoid duplicate buffers, E95.
|
if -1 == match(bufname('%'), 'man:\/\/') " Avoid duplicate buffers, E95.
|
||||||
execute 'silent file man://'.tolower(fnameescape(ref))
|
execute 'silent file man://'.tolower(fnameescape(ref))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
let &l:modifiable = og_modifiable
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! man#goto_tag(pattern, flags, info) abort
|
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>
|
" Previous Maintainer: SungHyun Nam <goweol@gmail.com>
|
||||||
|
|
||||||
if exists('b:current_syntax')
|
if exists('b:current_syntax')
|
||||||
@@ -30,6 +30,7 @@ endif
|
|||||||
if !exists('b:man_sect')
|
if !exists('b:man_sect')
|
||||||
call man#init_pager()
|
call man#init_pager()
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if b:man_sect =~# '^[023]'
|
if b:man_sect =~# '^[023]'
|
||||||
syntax case match
|
syntax case match
|
||||||
syntax include @c $VIMRUNTIME/syntax/c.vim
|
syntax include @c $VIMRUNTIME/syntax/c.vim
|
||||||
|
Reference in New Issue
Block a user