mirror of
https://github.com/neovim/neovim.git
synced 2026-04-21 06:45:37 +00:00
vim-patch:8.2.0578: heredoc for interfaces does not support "trim"
Problem: Heredoc for interfaces does not support "trim".
Solution: Update the script heredoc support to be same as the :let command.
(Yegappan Lakshmanan, closes vim/vim#5916)
6c2b7b8055
This commit is contained in:
@@ -341,11 +341,11 @@ func Test_ruby_Vim_evaluate_list()
|
||||
call setline(line('$'), ['2 line 2'])
|
||||
ruby Vim.command("normal /^2\n")
|
||||
let l = ["abc", "def"]
|
||||
ruby << EOF
|
||||
curline = $curbuf.line_number
|
||||
l = Vim.evaluate("l");
|
||||
$curbuf.append(curline, l.join("|"))
|
||||
EOF
|
||||
ruby << trim EOF
|
||||
curline = $curbuf.line_number
|
||||
l = Vim.evaluate("l");
|
||||
$curbuf.append(curline, l.join("|"))
|
||||
EOF
|
||||
normal j
|
||||
.rubydo $_ = $_.gsub(/\|/, '/')
|
||||
call assert_equal('abc/def', getline('$'))
|
||||
@@ -414,4 +414,21 @@ func Test_rubyeval_error()
|
||||
call assert_fails('call rubyeval("(")')
|
||||
endfunc
|
||||
|
||||
" Test for various heredoc syntax
|
||||
func Test_ruby_heredoc()
|
||||
ruby << END
|
||||
Vim.command('let s = "A"')
|
||||
END
|
||||
ruby <<
|
||||
Vim.command('let s ..= "B"')
|
||||
.
|
||||
ruby << trim END
|
||||
Vim.command('let s ..= "C"')
|
||||
END
|
||||
ruby << trim
|
||||
Vim.command('let s ..= "D"')
|
||||
.
|
||||
call assert_equal('ABCD', s)
|
||||
endfunc
|
||||
|
||||
" vim: shiftwidth=2 sts=2 expandtab
|
||||
|
||||
Reference in New Issue
Block a user