diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-04-21 22:01:14 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-04-21 22:01:14 +0200 |
commit | ff06f283e3e4b3ec43012dd3b83f8454c98f6639 (patch) | |
tree | 61a07e0fa072ae02212421515c60745109f2b924 /src/testdir/test_edit.vim | |
parent | 1966c248814d5195edcd1208ed0e51e664a61283 (diff) | |
download | vim-git-ff06f283e3e4b3ec43012dd3b83f8454c98f6639.tar.gz |
patch 8.2.0614: get ml_get error when deleting a line in 'completefunc'v8.2.0614
Problem: Get ml_get error when deleting a line in 'completefunc'. (Yegappan
Lakshmanan)
Solution: Lock the text while evaluating 'completefunc'.
Diffstat (limited to 'src/testdir/test_edit.vim')
-rw-r--r-- | src/testdir/test_edit.vim | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/testdir/test_edit.vim b/src/testdir/test_edit.vim index 9096fcdeb..ce55f6be0 100644 --- a/src/testdir/test_edit.vim +++ b/src/testdir/test_edit.vim @@ -915,6 +915,23 @@ func Test_edit_CTRL_U() bw! endfunc +func Test_edit_completefunc_delete() + func CompleteFunc(findstart, base) + if a:findstart == 1 + return col('.') - 1 + endif + normal dd + return ['a', 'b'] + endfunc + new + set completefunc=CompleteFunc + call setline(1, ['', 'abcd', '']) + 2d + call assert_fails("normal 2G$a\<C-X>\<C-U>", 'E565:') + bwipe! +endfunc + + func Test_edit_CTRL_Z() " Ctrl-Z when insertmode is not set inserts it literally new @@ -1240,7 +1257,7 @@ func Test_edit_forbidden() try call feedkeys("ix\<esc>", 'tnix') call assert_fails(1, 'textlock') - catch /^Vim\%((\a\+)\)\=:E523/ " catch E523: not allowed here + catch /^Vim\%((\a\+)\)\=:E565/ " catch E565: not allowed here endtry " TODO: Might be a bug: should x really be inserted here call assert_equal(['xa'], getline(1, '$')) @@ -1264,7 +1281,7 @@ func Test_edit_forbidden() try call feedkeys("i\<c-x>\<c-u>\<esc>", 'tnix') call assert_fails(1, 'change in complete function') - catch /^Vim\%((\a\+)\)\=:E523/ " catch E523 + catch /^Vim\%((\a\+)\)\=:E565/ " catch E565 endtry delfu Complete set completefunc= |