]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
runtime(csh): Support negated if in matchit
authorSimão Afonso <simao.afonso@powertools-tech.com>
Thu, 15 Jan 2026 20:27:02 +0000 (20:27 +0000)
committerChristian Brabandt <cb@256bit.org>
Thu, 15 Jan 2026 20:27:54 +0000 (20:27 +0000)
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 <simao.afonso@powertools-tech.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/ftplugin/csh.vim

index 74666b9680ea635fe5839b76b0163101d901836f..6f8201b99d2cd84f59ebd329ce382404df9332cd 100644 (file)
@@ -5,6 +5,7 @@
 " Contributor:         Johannes Zellner <johannes@zellner.org>
 " 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*(:' ..