]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
runtime(sh): set b:match_skip to ignore matches for matchit
authorChristian Brabandt <cb@256bit.org>
Sun, 9 Mar 2025 09:15:39 +0000 (10:15 +0100)
committerChristian Brabandt <cb@256bit.org>
Sun, 9 Mar 2025 09:16:30 +0000 (10:16 +0100)
related: #16801
closes: chrisbra/matchit#50
closes: #16834

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/ftplugin/sh.vim

index 54ae73b67558dc0d6a882af959ff7797c98d993f..0038ee7dd436184b74d00744a03b1bf52c0b19b1 100644 (file)
@@ -6,6 +6,7 @@
 "                      Eisuke Kawashima
 " Last Change:         2024 Sep 19 by Vim Project (compiler shellcheck)
 "                      2024 Dec 29 by Vim Project (improve setting shellcheck compiler)
+"                      2025 Mar 09 by Vim Project (set b:match_skip)
 
 if exists("b:did_ftplugin")
   finish
@@ -30,7 +31,8 @@ if exists("loaded_matchit") && !exists("b:match_words")
        \  s:sol .. '\%(for\|while\)\>:' .. s:sol .. 'done\>,' ..
        \  s:sol .. 'case\>:' .. s:sol .. 'esac\>'
   unlet s:sol
-  let b:undo_ftplugin ..= " | unlet! b:match_ignorecase b:match_words"
+  let b:match_skip = "synIDattr(synID(line('.'),col('.'),0),'name') =~ 'shSnglCase'" 
+  let b:undo_ftplugin ..= " | unlet! b:match_ignorecase b:match_words b:match_skip"
 endif
 
 if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")