]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
runtime(syntax): unlet b:filetype_in_cpp_family for cpp & squirrel
authorlaburnumT <laburnumtec@gmail.com>
Fri, 8 Dec 2023 20:27:03 +0000 (21:27 +0100)
committerChristian Brabandt <cb@256bit.org>
Fri, 8 Dec 2023 20:28:44 +0000 (21:28 +0100)
Update runtime/syntax/cpp.vim and runtime/syntax/squirrel.vim to unlet
b:filetype_in_cpp_family as it remains set even after updating the ft of
a file manually or through a modeline, not allowing c specific keywords
to be highlighted.

Since the variable b:filetype_in_cpp_family is only used by the c.vim
syntax script, unlet it directly after sourcing the c.vim runtime file
instead of at the end of the script.

Also update the last Change Header for both files.

closes: #13650

Signed-off-by: laburnumT <laburnumtec@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/syntax/cpp.vim
runtime/syntax/squirrel.vim

index 5437580a0ac364129a252e7425bb638657581dea..8daf90a33cd3286b7826db86237ec7c655b5afb8 100644 (file)
@@ -2,7 +2,7 @@
 " Language:    C++
 " Current Maintainer:  vim-jp (https://github.com/vim-jp/vim-cpp)
 " Previous Maintainer: Ken Shan <ccshan@post.harvard.edu>
-" Last Change: 2021 Aug 23
+" Last Change: 2023 Dec 08
 
 " quit when a syntax file was already loaded
 if exists("b:current_syntax")
@@ -15,6 +15,7 @@ let b:filetype_in_cpp_family = 1
 " Read the C syntax to start with
 runtime! syntax/c.vim
 unlet b:current_syntax
+unlet b:filetype_in_cpp_family
 
 " C++ extensions
 syn keyword cppStatement       new delete this friend using
index 81d59cc98650f87d4044efd774f325b61bda6706..85bdd87d9e44f59a614e0b879aef97ed29ccf9a1 100644 (file)
@@ -2,7 +2,7 @@
 " Language: squirrel
 " Current Maintainer: Matt Dunford (zenmatic@gmail.com)
 " URL: https://github.com/zenmatic/vim-syntax-squirrel
-" Last Change: 2021 Nov 28
+" Last Change: 2023 Dec 08
 
 " http://squirrel-lang.org/
 
@@ -17,6 +17,7 @@ let b:filetype_in_cpp_family = 1
 " Read the C syntax to start with
 runtime! syntax/c.vim
 unlet b:current_syntax
+unlet b:filetype_in_cpp_family
 
 " squirrel extensions
 syn keyword squirrelStatement  delete this in yield resume base clone