Mercurial > vim
comparison src/testdir/test_vim9_script.vim @ 19999:844c7646f61b v8.2.0555
patch 8.2.0555: Vim9: line continuation is not always needed
Commit: https://github.com/vim/vim/commit/4fdae9996fb9a9bc1291a61e7b85cb360feb7599
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Apr 12 16:38:57 2020 +0200
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.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 12 Apr 2020 16:45:03 +0200 |
parents | 12fa79cac39b |
children | 628011800942 |
comparison
equal
deleted
inserted
replaced
19998:99c0e654294e | 19999:844c7646f61b |
---|---|
964 assert_equal(100, x) | 964 assert_equal(100, x) |
965 endtry | 965 endtry |
966 assert_true(caught, 'should have caught an exception') | 966 assert_true(caught, 'should have caught an exception') |
967 enddef | 967 enddef |
968 | 968 |
969 def Test_automatic_line_continuation() | |
970 let mylist = [ | |
971 'one', | |
972 'two', | |
973 'three', | |
974 ] " comment | |
975 assert_equal(['one', 'two', 'three'], mylist) | |
976 | |
977 let mydict = { | |
978 'one': 1, | |
979 'two': 2, | |
980 'three': | |
981 3, | |
982 } " comment | |
983 assert_equal({'one': 1, 'two': 2, 'three': 3}, mydict) | |
984 mydict = #{ | |
985 one: 1, " comment | |
986 two: | |
987 2, | |
988 three: 3 " comment | |
989 } | |
990 assert_equal(#{one: 1, two: 2, three: 3}, mydict) | |
991 enddef | |
992 | |
969 " Keep this last, it messes up highlighting. | 993 " Keep this last, it messes up highlighting. |
970 def Test_substitute_cmd() | 994 def Test_substitute_cmd() |
971 new | 995 new |
972 setline(1, 'something') | 996 setline(1, 'something') |
973 :substitute(some(other( | 997 :substitute(some(other( |