1
0
forked from aniani/vim

patch 8.1.0511: ml_get error when calling a function with a range

Problem:    ml_get error when calling a function with a range.
Solution:   Don't position the cursor after the last line.
This commit is contained in:
Bram Moolenaar
2018-11-04 23:39:38 +01:00
parent ba3ff53930
commit 9e353b5265
3 changed files with 28 additions and 0 deletions

View File

@@ -1119,3 +1119,22 @@ func Test_func_sandbox()
call assert_fails('call Fsandbox()', 'E48:')
delfunc Fsandbox
endfunc
func EditAnotherFile()
let word = expand('<cword>')
edit Xfuncrange2
endfunc
func Test_func_range_with_edit()
" Define a function that edits another buffer, then call it with a range that
" is invalid in that buffer.
call writefile(['just one line'], 'Xfuncrange2')
new
call setline(1, range(10))
write Xfuncrange1
call assert_fails('5,8call EditAnotherFile()', 'E16:')
call delete('Xfuncrange1')
call delete('Xfuncrange2')
bwipe!
endfunc