neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit 611cc7de4373bc2777705d9b977b3ae1bdd2ea90
parent e4fb3e200768763fbff8668c19b2011d6c8309aa
Author: zeertzjq <zeertzjq@outlook.com>
Date:   Fri, 12 Apr 2024 17:07:24 +0800

vim-patch:9.1.0304: filetype: cgdb config file is not recognized (#28294)

Problem:  filetype: cgdb config file is not recognized
Solution: Detect cgdbrc files as cgdbrc filetype
          (Wu, Zhenyu)

closes: vim/vim#14458

https://github.com/vim/vim/commit/1492fe69037586b6c625d42205d77dd38ba51640

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
Diffstat:
Aruntime/ftplugin/cgdbrc.vim | 21+++++++++++++++++++++
Mruntime/lua/vim/filetype.lua | 1+
Aruntime/syntax/cgdbrc.vim | 16++++++++++++++++
Mtest/old/testdir/test_filetype.vim | 1+
4 files changed, 39 insertions(+), 0 deletions(-)

diff --git a/runtime/ftplugin/cgdbrc.vim b/runtime/ftplugin/cgdbrc.vim @@ -0,0 +1,21 @@ +" Vim filetype plugin file +" Language: cgdbrc +" Maintainer: Wu, Zhenyu <wuzhenyu@ustc.edu> +" Documentation: https://cgdb.github.io/docs/Configuring-CGDB.html +" Latest Revision: 2024-04-09 + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +let s:save_cpoptions = &cpoptions +set cpoptions&vim + +let b:undo_ftplugin = 'setl com< cms<' + +setlocal commentstring=#%s +setlocal comments=:# + +let &cpoptions = s:save_cpoptions +unlet s:save_cpoptions diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua @@ -1289,6 +1289,7 @@ local filename = { ['/etc/default/cdrdao'] = 'cdrdaoconf', ['/etc/defaults/cdrdao'] = 'cdrdaoconf', ['cfengine.conf'] = 'cfengine', + cgdbrc = 'cgdbrc', ['CMakeLists.txt'] = 'cmake', ['.alias'] = detect.csh, ['.cshrc'] = detect.csh, diff --git a/runtime/syntax/cgdbrc.vim b/runtime/syntax/cgdbrc.vim @@ -0,0 +1,16 @@ +" Vim syntax file +" Language: cgdbrc +" Maintainer: Wu, Zhenyu <wuzhenyu@ustc.edu> +" Documentation: https://cgdb.github.io/docs/Configuring-CGDB.html +" Latest Revision: 2024-04-09 + +if exists('b:current_syntax') + finish +endif +let b:current_syntax = 'cgdbrc' + +runtime! syntax/vim.vim + +syn region cgdbComment start="^\s*\#" skip="\\$" end="$" contains=@Spell + +highlight default link cgdbComment Comment diff --git a/test/old/testdir/test_filetype.vim b/test/old/testdir/test_filetype.vim @@ -146,6 +146,7 @@ func s:GetFilenameChecks() abort \ 'cf': ['file.cfm', 'file.cfi', 'file.cfc'], \ 'cfengine': ['cfengine.conf'], \ 'cfg': ['file.hgrc', 'filehgrc', 'hgrc', 'some-hgrc'], + \ 'cgdbrc': ['cgdbrc'], \ 'ch': ['file.chf'], \ 'chaiscript': ['file.chai'], \ 'chaskell': ['file.chs'],