Mercurial > vim
comparison src/testdir/test_functions.vim @ 15000:32787e326de2 v8.1.0511
patch 8.1.0511: ml_get error when calling a function with a range
commit https://github.com/vim/vim/commit/9e353b5265bd7fa103caf4e5a9b3c99f344f548e
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Nov 4 23:39:38 2018 +0100
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.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 04 Nov 2018 23:45:07 +0100 |
parents | bde025b0d7de |
children | 67e3103d6e18 |
comparison
equal
deleted
inserted
replaced
14999:2b30a2b4bde2 | 15000:32787e326de2 |
---|---|
1117 unlet F | 1117 unlet F |
1118 | 1118 |
1119 call assert_fails('call Fsandbox()', 'E48:') | 1119 call assert_fails('call Fsandbox()', 'E48:') |
1120 delfunc Fsandbox | 1120 delfunc Fsandbox |
1121 endfunc | 1121 endfunc |
1122 | |
1123 func EditAnotherFile() | |
1124 let word = expand('<cword>') | |
1125 edit Xfuncrange2 | |
1126 endfunc | |
1127 | |
1128 func Test_func_range_with_edit() | |
1129 " Define a function that edits another buffer, then call it with a range that | |
1130 " is invalid in that buffer. | |
1131 call writefile(['just one line'], 'Xfuncrange2') | |
1132 new | |
1133 call setline(1, range(10)) | |
1134 write Xfuncrange1 | |
1135 call assert_fails('5,8call EditAnotherFile()', 'E16:') | |
1136 | |
1137 call delete('Xfuncrange1') | |
1138 call delete('Xfuncrange2') | |
1139 bwipe! | |
1140 endfunc |