changeset 34311:5b46a975e48a

runtime(vim): Fix indent after line with literal dict Commit: https://github.com/vim/vim/commit/415a5a951ba6a827ecafc2e13bf341ed4e124ad6 Author: Andrew Radev <andrey.radev@gmail.com> Date: Fri Feb 9 19:44:28 2024 +0100 runtime(vim): Fix indent after line with literal dict closes: https://github.com/vim/vim/issues/13966 Signed-off-by: Andrew Radev <andrey.radev@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Fri, 09 Feb 2024 20:00:04 +0100
parents d6a6049a0965
children 737023edd0a5
files runtime/autoload/dist/vimindent.vim runtime/indent/testdir/vim.in runtime/indent/testdir/vim.ok
diffstat 3 files changed, 14 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/runtime/autoload/dist/vimindent.vim
+++ b/runtime/autoload/dist/vimindent.vim
@@ -3,6 +3,9 @@ vim9script
 # Language:     Vim script
 # Maintainer:   github user lacygoill
 # Last Change:  2023 Jun 29
+#
+# Includes Changes from Vim:
+#  - 2024 Feb 09: Fix indent after literal Dict (A. Radev via #13966)
 
 # NOTE: Whenever you change the code, make sure the tests are still passing:
 #
@@ -381,7 +384,7 @@ const LINE_CONTINUATION_AT_EOL: string =
     # It can be the start of a dictionary or a block.
     # We only want to match the former.
     .. '\|' .. $'^\%({STARTS_CURLY_BLOCK}\)\@!.*\zs{{'
-    .. '\)\s*\%(\s#.*\)\=$'
+    .. '\)\s*\%(\s#[^{].*\)\=$'
 # }}}2
 # SOL {{{2
 # BACKSLASH_AT_SOL {{{3
--- a/runtime/indent/testdir/vim.in
+++ b/runtime/indent/testdir/vim.in
@@ -946,3 +946,8 @@ Blue
 Black
 endenum
 " END_INDENT
+
+" START_INDENT
+call prop_type_add('indent_after_literal_dict', #{ foo: 'bar' })
+call prop_type_delete('indent_after_literal_dict')
+" END_INDENT
--- a/runtime/indent/testdir/vim.ok
+++ b/runtime/indent/testdir/vim.ok
@@ -946,3 +946,8 @@ enum Color
     Black
 endenum
 " END_INDENT
+
+" START_INDENT
+call prop_type_add('indent_after_literal_dict', #{ foo: 'bar' })
+call prop_type_delete('indent_after_literal_dict')
+" END_INDENT