summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_functions.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-11-04 23:39:38 +0100
committerBram Moolenaar <Bram@vim.org>2018-11-04 23:39:38 +0100
commit9e353b5265bd7fa103caf4e5a9b3c99f344f548e (patch)
treef160112f470bdd7d72e902ae6d185ce442e27cc3 /src/testdir/test_functions.vim
parentba3ff539303c7bb6e46a6802dce3c7b2e55284e0 (diff)
patch 8.1.0511: ml_get error when calling a function with a rangev8.1.0511
Problem: ml_get error when calling a function with a range. Solution: Don't position the cursor after the last line.
Diffstat (limited to 'src/testdir/test_functions.vim')
-rw-r--r--src/testdir/test_functions.vim19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/testdir/test_functions.vim b/src/testdir/test_functions.vim
index e59cdf82a3..ac8a27f75a 100644
--- a/src/testdir/test_functions.vim
+++ b/src/testdir/test_functions.vim
@@ -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