To: vim_dev@googlegroups.com Subject: Patch 8.2.0568 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.0568 Problem: The man filetype plugin overwrites the unnamed register. Solution: Use the black hole register. (Jason Franklin) Files: runtime/ftplugin/man.vim, src/testdir/test_man.vim *** ../vim-8.2.0567/runtime/ftplugin/man.vim 2019-09-26 20:22:42.000000000 +0200 --- runtime/ftplugin/man.vim 2020-04-13 14:52:40.950918741 +0200 *************** *** 1,8 **** " Vim filetype plugin file " Language: man " Maintainer: SungHyun Nam ! " Last Change: 2019 Sep 26 ! " (fix by Jason Franklin) " To make the ":Man" command available before editing a manual page, source " this script from your startup vimrc file. --- 1,7 ---- " Vim filetype plugin file " Language: man " Maintainer: SungHyun Nam ! " Last Change: 2020 Apr 13 " To make the ":Man" command available before editing a manual page, source " this script from your startup vimrc file. *************** *** 96,102 **** let sect = a:cnt let page = expand("") endif ! call s:GetPage(sect, page) endfunc func GetCmdArg(sect, page) --- 95,101 ---- let sect = a:cnt let page = expand("") endif ! call s:GetPage('', sect, page) endfunc func GetCmdArg(sect, page) *************** *** 189,195 **** setl buftype=nofile noswapfile setl fdc=0 ma nofen nonu nornu ! silent exec "norm! 1GdG" let unsetwidth = 0 if empty($MANWIDTH) let $MANWIDTH = winwidth(0) --- 188,194 ---- setl buftype=nofile noswapfile setl fdc=0 ma nofen nonu nornu ! %delete _ let unsetwidth = 0 if empty($MANWIDTH) let $MANWIDTH = winwidth(0) *************** *** 205,210 **** --- 204,210 ---- let s:env_has_u = (v:shell_error == 0) endif let env_cmd = s:env_has_u ? 'env -u MANPAGER' : 'env MANPAGER=cat' + let env_cmd .= ' GROFF_NO_SGR=1' let man_cmd = env_cmd . ' man ' . s:GetCmdArg(sect, page) . ' | col -b' silent exec "r !" . man_cmd *************** *** 213,222 **** endif " Remove blank lines from top and bottom. while line('$') > 1 && getline(1) =~ '^\s*$' ! silent keepj norm! ggdd endwhile while line('$') > 1 && getline('$') =~ '^\s*$' ! silent keepj norm! Gdd endwhile 1 setl ft=man nomod --- 213,222 ---- endif " Remove blank lines from top and bottom. while line('$') > 1 && getline(1) =~ '^\s*$' ! 1delete _ endwhile while line('$') > 1 && getline('$') =~ '^\s*$' ! $delete _ endwhile 1 setl ft=man nomod *** ../vim-8.2.0567/src/testdir/test_man.vim 2019-07-28 15:25:28.000000000 +0200 --- src/testdir/test_man.vim 2020-04-13 14:55:16.814642759 +0200 *************** *** 1,3 **** --- 1,5 ---- + " Test specifically for the Man filetype plugin. + runtime ftplugin/man.vim func Test_g_ft_man_open_mode() *************** *** 111,113 **** --- 113,133 ---- %bw! set foldcolumn& number& 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 *** ../vim-8.2.0567/src/version.c 2020-04-13 14:41:31.671954102 +0200 --- src/version.c 2020-04-13 14:56:51.930470912 +0200 *************** *** 740,741 **** --- 740,743 ---- { /* Add new patch number below this line */ + /**/ + 568, /**/ -- There are two ways of constructing a software design. One way is to make it so simple that there are obviously no deficiencies. The other way is to make it so complicated that there are no obvious deficiencies. -C.A.R. Hoare /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///