]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
runtime(sh): properly delete shell commands in syntax file
authorChristoffer Aasted <chr.aasted@gmail.com>
Fri, 18 Jul 2025 18:25:59 +0000 (20:25 +0200)
committerChristian Brabandt <cb@256bit.org>
Fri, 18 Jul 2025 18:32:16 +0000 (20:32 +0200)
closes: #17785

Signed-off-by: Christoffer Aasted <chr.aasted@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/syntax/sh.vim

index 3e0a481fbd1e51ba9d3ce37ffef843ec77eb86c6..9cee161ac281c8eee56224be87b1712e416b7b6e 100644 (file)
@@ -3,7 +3,7 @@
 " Maintainer:          This runtime file is looking for a new maintainer.
 " Previous Maintainers:        Charles E. Campbell
 "              Lennart Schultz <Lennart.Schultz@ecmwf.int>
-" Last Change:         2024 Mar 04 by Vim Project
+" Last Change:         2024 Mar 04 by Vim Project {{{1
 "              2024 Nov 03 by Aliaksei Budavei <0x000c70 AT gmail DOT com> (improved bracket expressions, #15941)
 "              2025 Jan 06 add $PS0 to bashSpecialVariables (#16394)
 "              2025 Jan 18 add bash coproc, remove duplicate syn keywords (#16467)
@@ -16,6 +16,8 @@
 "              2025 May 10 improve wildcard character class lists
 "              2025 May 21 improve supported KornShell features
 "              2025 Jun 16 change how sh_fold_enabled is reset (#17557)
+"              2025 Jul 18 properly delete :commands #17785
+" }}}
 " Version:             208
 " Former URL:          http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SH
 " For options and settings, please use:      :help ft-sh-syntax
@@ -174,9 +176,15 @@ endif
 
 " Set up folding commands for shell {{{1
 " =================================
-sil! delc ShFoldFunctions
-sil! delc ShFoldHereDoc
-sil! delc ShFoldIfDoFor
+if exists(":ShFoldFunctions") == 2
+  delc ShFoldFunctions
+endif
+if exists(":ShFoldIfHereDoc") == 2
+  delc ShFoldHereDoc
+endif
+if exists(":ShFoldIfDoFor") == 2
+  delc ShFoldIfDoFor
+endif
 if s:sh_fold_functions
  com! -nargs=* ShFoldFunctions <args> fold
 else