From 6237ac84024f048ec60475276fbf0663d9d17879 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sat, 30 Jul 2022 15:48:32 +0200 Subject: vim-patch:2ecbe53f452e (#19577) Update runtime files https://github.com/vim/vim/commit/2ecbe53f452e92e941aff623f6a0b72f80e43d07 --- runtime/ftplugin/debchangelog.vim | 101 +++++++++++++++++++++----------------- runtime/ftplugin/desktop.vim | 13 +++++ runtime/ftplugin/swayconfig.vim | 16 ++++++ 3 files changed, 85 insertions(+), 45 deletions(-) create mode 100644 runtime/ftplugin/desktop.vim create mode 100644 runtime/ftplugin/swayconfig.vim (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/debchangelog.vim b/runtime/ftplugin/debchangelog.vim index a78f7811f1..cf8dd17c44 100644 --- a/runtime/ftplugin/debchangelog.vim +++ b/runtime/ftplugin/debchangelog.vim @@ -1,9 +1,9 @@ " Vim filetype plugin file (GUI menu, folding and completion) " Language: Debian Changelog -" Maintainer: Debian Vim Maintainers +" Maintainer: Debian Vim Maintainers " Former Maintainers: Michael Piefel " Stefano Zacchiroli -" Last Change: 2018-01-28 +" Last Change: 2022 Jul 25 " License: Vim License " URL: https://salsa.debian.org/vim-team/vim-debian/blob/master/ftplugin/debchangelog.vim @@ -35,6 +35,11 @@ if exists('g:did_changelog_ftplugin') finish endif +" Make sure the '<' and 'C' flags are not included in 'cpoptions', otherwise +" would not be recognized. See ":help 'cpoptions'". +let s:cpo_save = &cpo +set cpo&vim + " Don't load another plugin (this is global) let g:did_changelog_ftplugin = 1 @@ -101,13 +106,13 @@ endfunction " These functions implement the menus function NewVersion() " The new entry is unfinalised and shall be changed - amenu disable Changelog.New\ Version - amenu enable Changelog.Add\ Entry - amenu enable Changelog.Close\ Bug - amenu enable Changelog.Set\ Distribution - amenu enable Changelog.Set\ Urgency - amenu disable Changelog.Unfinalise - amenu enable Changelog.Finalise + amenu disable &Changelog.&New\ Version + amenu enable &Changelog.&Add\ Entry + amenu enable &Changelog.&Close\ Bug + amenu enable &Changelog.Set\ &Distribution + amenu enable &Changelog.Set\ &Urgency + amenu disable &Changelog.U&nfinalise + amenu enable &Changelog.&Finalise call append(0, substitute(getline(1), '-\([[:digit:]]\+\))', '-$$\1)', '')) call append(1, '') call append(2, '') @@ -117,7 +122,9 @@ function NewVersion() normal! 1G0 call search(')') normal! h - normal!  + " ':normal' doens't support key annotation () directly. + " Vim's manual recommends using ':exe' to use key annotation indirectly (backslash-escaping needed though). + exe "normal! \" call setline(1, substitute(getline(1), '-\$\$', '-', '')) if exists('g:debchangelog_fold_enable') foldopen @@ -161,13 +168,13 @@ endfunction function UnfinaliseMenu() " This means the entry shall be changed - amenu disable Changelog.New\ Version - amenu enable Changelog.Add\ Entry - amenu enable Changelog.Close\ Bug - amenu enable Changelog.Set\ Distribution - amenu enable Changelog.Set\ Urgency - amenu disable Changelog.Unfinalise - amenu enable Changelog.Finalise + amenu disable &Changelog.&New\ Version + amenu enable &Changelog.&Add\ Entry + amenu enable &Changelog.&Close\ Bug + amenu enable &Changelog.Set\ &Distribution + amenu enable &Changelog.Set\ &Urgency + amenu disable &Changelog.U&nfinalise + amenu enable &Changelog.&Finalise endfunction function Unfinalise() @@ -179,13 +186,13 @@ endfunction function FinaliseMenu() " This means the entry should not be changed anymore - amenu enable Changelog.New\ Version - amenu disable Changelog.Add\ Entry - amenu disable Changelog.Close\ Bug - amenu disable Changelog.Set\ Distribution - amenu disable Changelog.Set\ Urgency - amenu enable Changelog.Unfinalise - amenu disable Changelog.Finalise + amenu enable &Changelog.&New\ Version + amenu disable &Changelog.&Add\ Entry + amenu disable &Changelog.&Close\ Bug + amenu disable &Changelog.Set\ &Distribution + amenu disable &Changelog.Set\ &Urgency + amenu enable &Changelog.U&nfinalise + amenu disable &Changelog.&Finalise endfunction function Finalise() @@ -198,26 +205,26 @@ endfunction function MakeMenu() amenu &Changelog.&New\ Version :call NewVersion() - amenu Changelog.&Add\ Entry :call AddEntry() - amenu Changelog.&Close\ Bug :call CloseBug() - menu Changelog.-sep- - - amenu Changelog.Set\ &Distribution.&unstable :call Distribution("unstable") - amenu Changelog.Set\ Distribution.&frozen :call Distribution("frozen") - amenu Changelog.Set\ Distribution.&stable :call Distribution("stable") - menu Changelog.Set\ Distribution.-sep- - amenu Changelog.Set\ Distribution.frozen\ unstable :call Distribution("frozen unstable") - amenu Changelog.Set\ Distribution.stable\ unstable :call Distribution("stable unstable") - amenu Changelog.Set\ Distribution.stable\ frozen :call Distribution("stable frozen") - amenu Changelog.Set\ Distribution.stable\ frozen\ unstable :call Distribution("stable frozen unstable") - - amenu Changelog.Set\ &Urgency.&low :call Urgency("low") - amenu Changelog.Set\ Urgency.&medium :call Urgency("medium") - amenu Changelog.Set\ Urgency.&high :call Urgency("high") - - menu Changelog.-sep- - amenu Changelog.U&nfinalise :call Unfinalise() - amenu Changelog.&Finalise :call Finalise() + amenu &Changelog.&Add\ Entry :call AddEntry() + amenu &Changelog.&Close\ Bug :call CloseBug() + menu &Changelog.-sep- + + amenu &Changelog.Set\ &Distribution.&unstable :call Distribution("unstable") + amenu &Changelog.Set\ &Distribution.&frozen :call Distribution("frozen") + amenu &Changelog.Set\ &Distribution.&stable :call Distribution("stable") + menu &Changelog.Set\ &Distribution.-sep- + amenu &Changelog.Set\ &Distribution.frozen\ unstable :call Distribution("frozen unstable") + amenu &Changelog.Set\ &Distribution.stable\ unstable :call Distribution("stable unstable") + amenu &Changelog.Set\ &Distribution.stable\ frozen :call Distribution("stable frozen") + amenu &Changelog.Set\ &Distribution.stable\ frozen\ unstable :call Distribution("stable frozen unstable") + + amenu &Changelog.Set\ &Urgency.&low :call Urgency("low") + amenu &Changelog.Set\ &Urgency.&medium :call Urgency("medium") + amenu &Changelog.Set\ &Urgency.&high :call Urgency("high") + + menu &Changelog.-sep- + amenu &Changelog.U&nfinalise :call Unfinalise() + amenu &Changelog.&Finalise :call Finalise() if Finalised() call FinaliseMenu() @@ -228,7 +235,7 @@ endfunction augroup changelogMenu au BufEnter * if &filetype == "debchangelog" | call MakeMenu() | endif -au BufLeave * if &filetype == "debchangelog" | silent! aunmenu Changelog | endif +au BufLeave * if &filetype == "debchangelog" | silent! aunmenu &Changelog | endif augroup END " }}} @@ -380,4 +387,8 @@ setlocal omnifunc=DebCompleteBugs " }}} +" Restore the previous value of 'cpoptions'. +let &cpo = s:cpo_save +unlet s:cpo_save + " vim: set foldmethod=marker: diff --git a/runtime/ftplugin/desktop.vim b/runtime/ftplugin/desktop.vim new file mode 100644 index 0000000000..bd6fd7097c --- /dev/null +++ b/runtime/ftplugin/desktop.vim @@ -0,0 +1,13 @@ +" Vim filetype plugin file +" Language: XDG desktop entry +" Maintainer: Eisuke Kawashima ( e.kawaschima+vim AT gmail.com ) +" Last Change: 2022-07-26 + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = v:true + +setl comments=:# +setl commentstring=#%s +let b:undo_ftplugin = 'setl com< cms<' diff --git a/runtime/ftplugin/swayconfig.vim b/runtime/ftplugin/swayconfig.vim new file mode 100644 index 0000000000..45d6bdb3e5 --- /dev/null +++ b/runtime/ftplugin/swayconfig.vim @@ -0,0 +1,16 @@ +" Vim filetype plugin file +" Language: sway config file +" Original Author: James Eapen +" Maintainer: James Eapen +" Version: 0.1 +" Last Change: 2022 June 07 + +if exists("b:did_ftplugin") + finish +endif + +let b:did_ftplugin = 1 + +let b:undo_ftplugin = "setlocal cms<" + +setlocal commentstring=#\ %s -- cgit