Mercurial > vim
comparison src/testdir/test_vim9_cmd.vim @ 23398:40f824f5c7c7 v8.2.2242
patch 8.2.2242: Vim9: bar line continuation does not work at script level
Commit: https://github.com/vim/vim/commit/8242ebbdba64cfa5c504c9d8dfb802076d99c602
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Dec 29 11:15:01 2020 +0100
patch 8.2.2242: Vim9: bar line continuation does not work at script level
Problem: Vim9: line continuation with bar does not work at script level.
Solution: Check for Vim9 script.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 29 Dec 2020 11:15:34 +0100 |
parents | 517fca70e084 |
children | bb0c53f4ef8b |
comparison
equal
deleted
inserted
replaced
23397:0a99720fc406 | 23398:40f824f5c7c7 |
---|---|
534 keepjumps normal 5G | 534 keepjumps normal 5G |
535 assert_equal(10, getpos("''")[1]) | 535 assert_equal(10, getpos("''")[1]) |
536 quit! | 536 quit! |
537 enddef | 537 enddef |
538 | 538 |
539 def Test_bar_line_continuation() | |
540 var lines =<< trim END | |
541 au BufNewFile Xfile g:readFile = 1 | |
542 | g:readExtra = 2 | |
543 g:readFile = 0 | |
544 g:readExtra = 0 | |
545 edit Xfile | |
546 assert_equal(1, g:readFile) | |
547 assert_equal(2, g:readExtra) | |
548 bwipe! | |
549 au! BufNewFile | |
550 | |
551 au BufNewFile Xfile g:readFile = 1 | |
552 | g:readExtra = 2 | |
553 | g:readMore = 3 | |
554 g:readFile = 0 | |
555 g:readExtra = 0 | |
556 g:readMore = 0 | |
557 edit Xfile | |
558 assert_equal(1, g:readFile) | |
559 assert_equal(2, g:readExtra) | |
560 assert_equal(3, g:readMore) | |
561 bwipe! | |
562 au! BufNewFile | |
563 unlet g:readFile | |
564 unlet g:readExtra | |
565 unlet g:readMore | |
566 END | |
567 CheckDefAndScriptSuccess(lines) | |
568 enddef | |
569 | |
539 def Test_command_modifier_other() | 570 def Test_command_modifier_other() |
540 new Xsomefile | 571 new Xsomefile |
541 setline(1, 'changed') | 572 setline(1, 'changed') |
542 var buf = bufnr() | 573 var buf = bufnr() |
543 hide edit Xotherfile | 574 hide edit Xotherfile |
546 assert_equal(1, info[0].changed) | 577 assert_equal(1, info[0].changed) |
547 edit Xsomefile | 578 edit Xsomefile |
548 bwipe! | 579 bwipe! |
549 | 580 |
550 au BufNewFile Xfile g:readFile = 1 | 581 au BufNewFile Xfile g:readFile = 1 |
551 | g:readExtra = 2 | |
552 g:readFile = 0 | 582 g:readFile = 0 |
553 g:readExtra = 0 | |
554 edit Xfile | 583 edit Xfile |
555 assert_equal(1, g:readFile) | 584 assert_equal(1, g:readFile) |
556 assert_equal(2, g:readExtra) | |
557 bwipe! | 585 bwipe! |
558 g:readFile = 0 | 586 g:readFile = 0 |
559 noautocmd edit Xfile | 587 noautocmd edit Xfile |
560 assert_equal(0, g:readFile) | 588 assert_equal(0, g:readFile) |
561 au! BufNewFile | 589 au! BufNewFile |
562 | |
563 au BufNewFile Xfile g:readFile = 1 | |
564 | g:readExtra = 2 | |
565 | g:readMore = 3 | |
566 g:readFile = 0 | |
567 g:readExtra = 0 | |
568 g:readMore = 0 | |
569 edit Xfile | |
570 assert_equal(1, g:readFile) | |
571 assert_equal(2, g:readExtra) | |
572 assert_equal(3, g:readMore) | |
573 bwipe! | |
574 au! BufNewFile | |
575 unlet g:readFile | 590 unlet g:readFile |
576 unlet g:readExtra | |
577 unlet g:readMore | |
578 | 591 |
579 noswapfile edit XnoSwap | 592 noswapfile edit XnoSwap |
580 assert_equal(0, &l:swapfile) | 593 assert_equal(0, &l:swapfile) |
581 bwipe! | 594 bwipe! |
582 | 595 |