summaryrefslogtreecommitdiff
path: root/src/testdir/test_vim9_cmd.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-12-29 11:15:01 +0100
committerBram Moolenaar <Bram@vim.org>2020-12-29 11:15:01 +0100
commit8242ebbdba64cfa5c504c9d8dfb802076d99c602 (patch)
treeb5a016fbb3e636ca8ce0488d227d21f94be36ded /src/testdir/test_vim9_cmd.vim
parent864a28b6a6ae4f1a56e230be26bc6d13e3f8b3d9 (diff)
downloadvim-git-8242ebbdba64cfa5c504c9d8dfb802076d99c602.tar.gz
patch 8.2.2242: Vim9: bar line continuation does not work at script levelv8.2.2242
Problem: Vim9: line continuation with bar does not work at script level. Solution: Check for Vim9 script.
Diffstat (limited to 'src/testdir/test_vim9_cmd.vim')
-rw-r--r--src/testdir/test_vim9_cmd.vim49
1 files changed, 31 insertions, 18 deletions
diff --git a/src/testdir/test_vim9_cmd.vim b/src/testdir/test_vim9_cmd.vim
index 710af413c..ed0c7dda3 100644
--- a/src/testdir/test_vim9_cmd.vim
+++ b/src/testdir/test_vim9_cmd.vim
@@ -536,6 +536,37 @@ def Test_command_modifiers_keep()
quit!
enddef
+def Test_bar_line_continuation()
+ var lines =<< trim END
+ au BufNewFile Xfile g:readFile = 1
+ | g:readExtra = 2
+ g:readFile = 0
+ g:readExtra = 0
+ edit Xfile
+ assert_equal(1, g:readFile)
+ assert_equal(2, g:readExtra)
+ bwipe!
+ au! BufNewFile
+
+ au BufNewFile Xfile g:readFile = 1
+ | g:readExtra = 2
+ | g:readMore = 3
+ g:readFile = 0
+ g:readExtra = 0
+ g:readMore = 0
+ edit Xfile
+ assert_equal(1, g:readFile)
+ assert_equal(2, g:readExtra)
+ assert_equal(3, g:readMore)
+ bwipe!
+ au! BufNewFile
+ unlet g:readFile
+ unlet g:readExtra
+ unlet g:readMore
+ END
+ CheckDefAndScriptSuccess(lines)
+enddef
+
def Test_command_modifier_other()
new Xsomefile
setline(1, 'changed')
@@ -548,33 +579,15 @@ def Test_command_modifier_other()
bwipe!
au BufNewFile Xfile g:readFile = 1
- | g:readExtra = 2
g:readFile = 0
- g:readExtra = 0
edit Xfile
assert_equal(1, g:readFile)
- assert_equal(2, g:readExtra)
bwipe!
g:readFile = 0
noautocmd edit Xfile
assert_equal(0, g:readFile)
au! BufNewFile
-
- au BufNewFile Xfile g:readFile = 1
- | g:readExtra = 2
- | g:readMore = 3
- g:readFile = 0
- g:readExtra = 0
- g:readMore = 0
- edit Xfile
- assert_equal(1, g:readFile)
- assert_equal(2, g:readExtra)
- assert_equal(3, g:readMore)
- bwipe!
- au! BufNewFile
unlet g:readFile
- unlet g:readExtra
- unlet g:readMore
noswapfile edit XnoSwap
assert_equal(0, &l:swapfile)