mirror of
https://github.com/neovim/neovim.git
synced 2024-12-20 19:25:11 -07:00
a92b38934a
existing behavior of := and :[range]= are unchanged. `|` is still allowed with this usage. However, :=p and similar are changed in a way which could be construed as a breaking change. Allowing |ex-flags| for := in the first place was a mistake as any form of := DOES NOT MOVE THE CURSOR. So it would print one line number and then print a completely different line contents after that.
42 lines
788 B
VimL
42 lines
788 B
VimL
" Test Ex := command.
|
|
|
|
func Test_ex_equal()
|
|
new
|
|
call setline(1, ["foo\tbar", "bar\tfoo"])
|
|
|
|
let a = execute('=')
|
|
call assert_equal("\n2", a)
|
|
|
|
let a = execute('.=')
|
|
call assert_equal("\n1", a)
|
|
|
|
call assert_fails('3=', 'E16:')
|
|
bwipe!
|
|
endfunc
|
|
|
|
func Test_ex_equal_arg()
|
|
throw 'skipped: Nvim evaluates lua with := [arg]'
|
|
|
|
new
|
|
call setline(1, ["foo\tbar", "bar\tfoo"])
|
|
|
|
let a = execute('=#')
|
|
call assert_equal("\n2\n 1 foo bar", a)
|
|
|
|
let a = execute('=l')
|
|
call assert_equal("\n2\nfoo^Ibar$", a)
|
|
|
|
let a = execute('=p')
|
|
call assert_equal("\n2\nfoo bar", a)
|
|
|
|
let a = execute('=l#')
|
|
call assert_equal("\n2\n 1 foo^Ibar$", a)
|
|
|
|
let a = execute('=p#')
|
|
call assert_equal("\n2\n 1 foo bar", a)
|
|
|
|
call assert_fails('=x', 'E488:')
|
|
|
|
bwipe!
|
|
endfunc
|