1
0
forked from aniani/vim

patch 8.2.1129: Vim9: bar not recognized after not compiled command

Problem:    Vim9: bar not recognized after not compiled command.
Solution:   Check for bar for commands where this is possible. (closes #6391)
This commit is contained in:
Bram Moolenaar
2020-07-05 14:57:51 +02:00
parent 3f40ce78f5
commit e9f262bdff
3 changed files with 66 additions and 2 deletions

View File

@@ -2,6 +2,7 @@
source check.vim
source vim9.vim
source view_util.vim
def Test_edit_wildcards()
let filename = 'Xtest'
@@ -207,5 +208,38 @@ def Test_method_call_linebreak()
CheckScriptSuccess(lines)
enddef
def Test_bar_after_command()
def RedrawAndEcho()
let x = 'did redraw'
redraw | echo x
enddef
RedrawAndEcho()
assert_match('did redraw', Screenline(&lines))
if has('unix')
# bar in filter write command does not start new command
def WriteToShell()
new
setline(1, 'some text')
w !cat | cat > Xoutfile
bwipe!
enddef
WriteToShell()
assert_equal(['some text'], readfile('Xoutfile'))
delete('Xoutfile')
# bar in filter read command does not start new command
def ReadFromShell()
new
r! echo hello there | cat > Xoutfile
r !echo again | cat >> Xoutfile
bwipe!
enddef
ReadFromShell()
assert_equal(['hello there', 'again'], readfile('Xoutfile'))
delete('Xoutfile')
endif
enddef
" vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker