]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
runtime(vim): Fix indent after line with literal dict
authorAndrew Radev <andrey.radev@gmail.com>
Fri, 9 Feb 2024 18:44:28 +0000 (19:44 +0100)
committerChristian Brabandt <cb@256bit.org>
Fri, 9 Feb 2024 18:46:59 +0000 (19:46 +0100)
closes: #13966

Signed-off-by: Andrew Radev <andrey.radev@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/autoload/dist/vimindent.vim
runtime/indent/testdir/vim.in
runtime/indent/testdir/vim.ok

index a5e04a539189ea323c94e03e4dabe4565b5a9ac8..07b21538e14283dc3ae520f244d8ac1a26a74742 100644 (file)
@@ -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
index c2e149ab377e522463c51ddb144cc0e51797d616..1ff2d0d000fa84e8ced5137b023fd1587c25a8d5 100644 (file)
@@ -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
index b10e081dd88b25ff705addf317e544853076e1cd..fa8869b61f9dfd834288c5720fd47bb95c7e4790 100644 (file)
@@ -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