0
0
mirror of https://github.com/vim/vim.git synced 2025-09-27 04:14:06 -04:00

patch 8.0.0270: may get ml_get error when :rubydo deletes lines

Problem:    May get ml_get error when :rubydo deletes lines or switches to
            another buffer. (Nikolai Pavlov, issue #1421)
Solution:   Check the buffer and line every time.
This commit is contained in:
Bram Moolenaar
2017-01-29 23:11:25 +01:00
parent 85b5743d3e
commit c593fee0e5
3 changed files with 24 additions and 0 deletions

View File

@@ -32,3 +32,20 @@ func Test_ruby_evaluate_dict()
redir END
call assert_equal(['{"a"=>"foo", "b"=>123}'], split(l:out, "\n"))
endfunc
func Test_rubydo()
" Check deleting lines does not trigger ml_get error.
new
call setline(1, ['one', 'two', 'three'])
rubydo Vim.command("%d_")
bwipe!
" Check switching to another buffer does not trigger ml_get error.
new
let wincount = winnr('$')
call setline(1, ['one', 'two', 'three'])
rubydo Vim.command("new")
call assert_equal(wincount + 1, winnr('$'))
bwipe!
bwipe!
endfunc