0
0
mirror of https://github.com/vim/vim.git synced 2025-09-30 04:44:14 -04:00

patch 8.2.0555: Vim9: line continuation is not always needed

Problem:    Vim9: line continuation is not always needed.
Solution:   Recognize continuation lines automatically in list and dict.
This commit is contained in:
Bram Moolenaar
2020-04-12 16:38:57 +02:00
parent acc770a10f
commit 4fdae9996f
5 changed files with 111 additions and 15 deletions

View File

@@ -966,6 +966,30 @@ def Test_interrupt_loop()
assert_true(caught, 'should have caught an exception')
enddef
def Test_automatic_line_continuation()
let mylist = [
'one',
'two',
'three',
] " comment
assert_equal(['one', 'two', 'three'], mylist)
let mydict = {
'one': 1,
'two': 2,
'three':
3,
} " comment
assert_equal({'one': 1, 'two': 2, 'three': 3}, mydict)
mydict = #{
one: 1, " comment
two:
2,
three: 3 " comment
}
assert_equal(#{one: 1, two: 2, three: 3}, mydict)
enddef
" Keep this last, it messes up highlighting.
def Test_substitute_cmd()
new