vim-patch:5c9c5a4: runtime(c): syntax depends on the 'iskeyword' option

Problem:  C keywords are matched using the characters from 'iskeyword',
          so changing that option highlights part of an identifier as a
          keyword and leaves keywords containing an underscore
          unhighlighted.
Solution: Set the keyword characters with ":syn iskeyword".

fixes:  vim/vim#21173
closes: vim/vim#21176

https://github.com/vim/vim/commit/5c9c5a43c183e8d1e4156b468343d0aa0f3b081c

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
Co-Authored-By: Maxim Kim <habamax@gmail.com>
This commit is contained in:
committed 2026-08-31 10:46:52 +08:00
1 parent a61bd270d6
commit 8edcb401cf
1 file changed
+8 -1
+8 -1
View File
@@ -1,7 +1,7 @@
" Vim syntax file
" Language: C
" Maintainer: The Vim Project <https://github.com/vim/vim>
" Last Change: 2026 Jul 25
" Last Change: 2026 Aug 30
" Former Maintainer: Bram Moolenaar <Bram@vim.org>
" Quit when a (custom) syntax file was already loaded
@@ -25,6 +25,13 @@ if exists("c_autodoc")
unlet b:current_syntax
endif
" In VMS C keywords contain '$' characters.
if has("vms")
syn iskeyword @,48-57,_,192-255,$
else
syn iskeyword @,48-57,_,192-255
endif
" A bunch of useful C keywords
syn keyword cStatement goto break return continue asm
syn keyword cLabel case default