mirror of
https://github.com/vim/vim.git
synced 2025-07-25 10:54:51 -04:00
patch 8.2.0568: the man filetype plugin overwrites the unnamed register
Problem: The man filetype plugin overwrites the unnamed register. Solution: Use the black hole register. (Jason Franklin)
This commit is contained in:
parent
2c330432cf
commit
55b0fb7001
@ -1,7 +1,7 @@
|
|||||||
" Vim filetype plugin file
|
" Vim filetype plugin file
|
||||||
" Language: man
|
" Language: man
|
||||||
" Maintainer: SungHyun Nam <goweol@gmail.com>
|
" Maintainer: SungHyun Nam <goweol@gmail.com>
|
||||||
" Last Change: 2020 Apr 6
|
" Last Change: 2020 Apr 13
|
||||||
|
|
||||||
" To make the ":Man" command available before editing a manual page, source
|
" To make the ":Man" command available before editing a manual page, source
|
||||||
" this script from your startup vimrc file.
|
" this script from your startup vimrc file.
|
||||||
@ -188,7 +188,7 @@ func <SID>GetPage(cmdmods, ...)
|
|||||||
setl buftype=nofile noswapfile
|
setl buftype=nofile noswapfile
|
||||||
|
|
||||||
setl fdc=0 ma nofen nonu nornu
|
setl fdc=0 ma nofen nonu nornu
|
||||||
silent exec "norm! 1GdG"
|
%delete _
|
||||||
let unsetwidth = 0
|
let unsetwidth = 0
|
||||||
if empty($MANWIDTH)
|
if empty($MANWIDTH)
|
||||||
let $MANWIDTH = winwidth(0)
|
let $MANWIDTH = winwidth(0)
|
||||||
@ -213,10 +213,10 @@ func <SID>GetPage(cmdmods, ...)
|
|||||||
endif
|
endif
|
||||||
" Remove blank lines from top and bottom.
|
" Remove blank lines from top and bottom.
|
||||||
while line('$') > 1 && getline(1) =~ '^\s*$'
|
while line('$') > 1 && getline(1) =~ '^\s*$'
|
||||||
silent keepj norm! ggdd
|
1delete _
|
||||||
endwhile
|
endwhile
|
||||||
while line('$') > 1 && getline('$') =~ '^\s*$'
|
while line('$') > 1 && getline('$') =~ '^\s*$'
|
||||||
silent keepj norm! Gdd
|
$delete _
|
||||||
endwhile
|
endwhile
|
||||||
1
|
1
|
||||||
setl ft=man nomod
|
setl ft=man nomod
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
" Test specifically for the Man filetype plugin.
|
||||||
|
|
||||||
runtime ftplugin/man.vim
|
runtime ftplugin/man.vim
|
||||||
|
|
||||||
func Test_g_ft_man_open_mode()
|
func Test_g_ft_man_open_mode()
|
||||||
@ -111,3 +113,21 @@ func Test_local_options()
|
|||||||
%bw!
|
%bw!
|
||||||
set foldcolumn& number&
|
set foldcolumn& number&
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
" Check that the unnamed register is not overwritten.
|
||||||
|
func Test_keep_unnamed_register()
|
||||||
|
%bw!
|
||||||
|
|
||||||
|
let @" = '---'
|
||||||
|
|
||||||
|
let wincnt = winnr('$')
|
||||||
|
Man vim
|
||||||
|
if wincnt == winnr('$')
|
||||||
|
" Vim manual page cannot be found.
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
|
call assert_equal('---', @")
|
||||||
|
|
||||||
|
%bw!
|
||||||
|
endfunc
|
||||||
|
@ -738,6 +738,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
568,
|
||||||
/**/
|
/**/
|
||||||
567,
|
567,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user