runtime(csh): Support negated if in matchit
Commit:
https://github.com/vim/vim/commit/f25c343b2639d393544106c21b3b0b58caa3adca
Author: Simão Afonso <[email protected]>
Date: Thu Jan 15 20:27:02 2026 +0000
runtime(csh): Support negated if in matchit
Currently, the matchit configuration chokes on valid syntax like:
```csh
if !(true) then
true
endif
```
Make sure the negation syntax is supported.
closes: #19172
Signed-off-by: Simão Afonso <[email protected]>
Signed-off-by: Christian Brabandt <[email protected]>
diff --git a/runtime/ftplugin/csh.vim b/runtime/ftplugin/csh.vim
index 74666b968..6f8201b99 100644
--- a/runtime/ftplugin/csh.vim
+++ b/runtime/ftplugin/csh.vim
@@ -5,6 +5,7 @@
" Contributor: Johannes Zellner <[email protected]>
" Last Change: 2024 Jan 14
" 2024 May 23 by Riley Bruins ('commentstring')
+" 2026 Jan 15 improved matchit support
if exists("b:did_ftplugin")
finish
@@ -31,7 +32,7 @@ let b:undo_ftplugin = "setlocal com< cms< fo<"
if exists("loaded_matchit") && !exists("b:match_words")
let s:line_start = '\%(^\s*\)\@<='
let b:match_words =
- \ s:line_start .. 'if\s*(.*)\s*then\>:' ..
+ \ s:line_start .. 'if\s*!\?\s*(.*)\s*then\>:' ..
\ s:line_start .. 'else\s\+if\s*(.*)\s*then\>:' .. s:line_start ..
'else\>:' ..
\ s:line_start .. 'endif\>,' ..
\ s:line_start .. '\%(\<foreach\s\+\h\w*\|while\)\s*(:' ..
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/vim_dev/E1vgTyp-00Ei6B-57%40256bit.org.