aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_functions.vim
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2018-11-06 07:49:20 -0500
committerJustin M. Keyes <justinkz@gmail.com>2018-11-06 13:49:20 +0100
commitf08869cff2eae65eede8df41fab274c77dd76c60 (patch)
treeb0ffeef87abc0b3a62c1b2e1ad20c7ccad032a3c /src/nvim/testdir/test_functions.vim
parent5320eb57df01e57ace29ab841d6f912bc2c88ade (diff)
downloadrneovim-f08869cff2eae65eede8df41fab274c77dd76c60.tar.gz
rneovim-f08869cff2eae65eede8df41fab274c77dd76c60.tar.bz2
rneovim-f08869cff2eae65eede8df41fab274c77dd76c60.zip
vim-patch:8.1.0511: ml_get error when calling a function with a range (#9207)
Problem: ml_get error when calling a function with a range. Solution: Don't position the cursor after the last line. https://github.com/vim/vim/commit/9e353b5265bd7fa103caf4e5a9b3c99f344f548e
Diffstat (limited to 'src/nvim/testdir/test_functions.vim')
-rw-r--r--src/nvim/testdir/test_functions.vim19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_functions.vim b/src/nvim/testdir/test_functions.vim
index b1138bfc96..7dc9f31ce7 100644
--- a/src/nvim/testdir/test_functions.vim
+++ b/src/nvim/testdir/test_functions.vim
@@ -1018,3 +1018,22 @@ func Test_trim()
let chars = join(map(range(1, 0x20) + [0xa0], {n -> nr2char(n)}), '')
call assert_equal("x", trim(chars . "x" . chars))
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