runtime(vim): Fix indent after :silent! function
Commit:
https://github.com/vim/vim/commit/7724d621f21ff6599ba49f11401ddb45ff321099
Author: Doug Kearns <[email protected]>
Date: Sun Nov 10 20:36:28 2024 +0100
runtime(vim): Fix indent after :silent! function
See
https://github.com/vim/vim/commit/35699f17497dcdcfdd747fedaef28f208ac6eb5f#commitcomment-148816912
closes: #16009
Signed-off-by: Doug Kearns <[email protected]>
Signed-off-by: Christian Brabandt <[email protected]>
diff --git a/runtime/autoload/dist/vimindent.vim
b/runtime/autoload/dist/vimindent.vim
index 07b21538e..727e98352 100644
--- a/runtime/autoload/dist/vimindent.vim
+++ b/runtime/autoload/dist/vimindent.vim
@@ -2,10 +2,11 @@ vim9script
# Language: Vim script
# Maintainer: github user lacygoill
-# Last Change: 2023 Jun 29
+# Last Change: 2024 Nov 08
#
-# Includes Changes from Vim:
+# Includes changes from The Vim Project:
# - 2024 Feb 09: Fix indent after literal Dict (A. Radev via #13966)
+# - 2024 Nov 08: Fix indent after :silent! function (D. Kearns via #16009)
# NOTE: Whenever you change the code, make sure the tests are still passing:
#
@@ -295,7 +296,7 @@ patterns = []
endfor
}
-const STARTS_NAMED_BLOCK: string =
$'^\s*\%(sil\%[ent]\s\+\)\=\%({patterns->join('\|')}\)\>\%(\s\|$\|!\)\@='
+const STARTS_NAMED_BLOCK: string =
$'^\s*\%(sil\%[ent]!\=\s\+\)\=\%({patterns->join('\|')}\)\>\%(\s\|$\|!\)\@='
# STARTS_CURLY_BLOCK {{{3
diff --git a/runtime/indent/testdir/vim.in b/runtime/indent/testdir/vim.in
index 1ff2d0d00..a3c8c920b 100644
--- a/runtime/indent/testdir/vim.in
+++ b/runtime/indent/testdir/vim.in
@@ -951,3 +951,12 @@ endenum
call prop_type_add('indent_after_literal_dict', #{ foo: 'bar' })
call prop_type_delete('indent_after_literal_dict')
" END_INDENT
+
+" START_INDENT
+silent function Foo()
+return 42
+endfunction
+silent! function Bar()
+return 42
+endfunction
+" END_INDENT
diff --git a/runtime/indent/testdir/vim.ok b/runtime/indent/testdir/vim.ok
index fa8869b61..56f3d98ba 100644
--- a/runtime/indent/testdir/vim.ok
+++ b/runtime/indent/testdir/vim.ok
@@ -951,3 +951,12 @@ endenum
call prop_type_add('indent_after_literal_dict', #{ foo: 'bar' })
call prop_type_delete('indent_after_literal_dict')
" END_INDENT
+
+" START_INDENT
+silent function Foo()
+ return 42
+endfunction
+silent! function Bar()
+ return 42
+endfunction
+" END_INDENT
--
--
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/E1tADrs-00CEEa-9J%40256bit.org.