Skip to content

Commit ba3a5a7

Browse files
dezzachrisbra
authored andcommitted
runtime(sh): properly delete shell commands in syntax file
closes: #17785 Signed-off-by: Christoffer Aasted <[email protected]> Signed-off-by: Christian Brabandt <[email protected]>
1 parent 58706ac commit ba3a5a7

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

runtime/syntax/sh.vim

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
" Maintainer: This runtime file is looking for a new maintainer.
44
" Previous Maintainers: Charles E. Campbell
55
" Lennart Schultz <[email protected]>
6-
" Last Change: 2024 Mar 04 by Vim Project
6+
" Last Change: 2024 Mar 04 by Vim Project {{{1
77
" 2024 Nov 03 by Aliaksei Budavei <0x000c70 AT gmail DOT com> (improved bracket expressions, #15941)
88
" 2025 Jan 06 add $PS0 to bashSpecialVariables (#16394)
99
" 2025 Jan 18 add bash coproc, remove duplicate syn keywords (#16467)
@@ -16,6 +16,8 @@
1616
" 2025 May 10 improve wildcard character class lists
1717
" 2025 May 21 improve supported KornShell features
1818
" 2025 Jun 16 change how sh_fold_enabled is reset (#17557)
19+
" 2025 Jul 18 properly delete :commands #17785
20+
" }}}
1921
" Version: 208
2022
" Former URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SH
2123
" For options and settings, please use: :help ft-sh-syntax
@@ -174,9 +176,15 @@ endif
174176

175177
" Set up folding commands for shell {{{1
176178
" =================================
177-
sil! delc ShFoldFunctions
178-
sil! delc ShFoldHereDoc
179-
sil! delc ShFoldIfDoFor
179+
if exists(":ShFoldFunctions") == 2
180+
delc ShFoldFunctions
181+
endif
182+
if exists(":ShFoldIfHereDoc") == 2
183+
delc ShFoldHereDoc
184+
endif
185+
if exists(":ShFoldIfDoFor") == 2
186+
delc ShFoldIfDoFor
187+
endif
180188
if s:sh_fold_functions
181189
com! -nargs=* ShFoldFunctions <args> fold
182190
else

0 commit comments

Comments
 (0)