aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorShougo <Shougo.Matsu@gmail.com>2017-02-23 20:37:46 +0900
committerJustin M. Keyes <justinkz@gmail.com>2017-02-23 12:37:46 +0100
commit4e21311f9cceabcfaa6c746518cb2628deb2bb40 (patch)
tree6c31af421589ff9befb78886337f0c4413c40e2f /src/nvim/testdir
parent34e24cb2f7341d34e24e4ccd3e4ed058878ef788 (diff)
downloadrneovim-4e21311f9cceabcfaa6c746518cb2628deb2bb40.tar.gz
rneovim-4e21311f9cceabcfaa6c746518cb2628deb2bb40.tar.bz2
rneovim-4e21311f9cceabcfaa6c746518cb2628deb2bb40.zip
vim-patch:8.0.0341 (#6151)
Problem: When using complete() and typing a character undo is saved after the character was inserted. (Shougo) Solution: Save for undo before inserting the character. https://github.com/vim/vim/commit/d56a79d3396cf70861b7f739a3c400db91ce7b70
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_popup.vim20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_popup.vim b/src/nvim/testdir/test_popup.vim
index 50110dd622..edc6336aa7 100644
--- a/src/nvim/testdir/test_popup.vim
+++ b/src/nvim/testdir/test_popup.vim
@@ -482,4 +482,24 @@ func Test_completion_ctrl_e_without_autowrap()
q!
endfunc
+func CompleteUndo() abort
+ call complete(1, g:months)
+ return ''
+endfunc
+
+func Test_completion_can_undo()
+ inoremap <Right> <c-r>=CompleteUndo()<cr>
+ set completeopt+=noinsert,noselect
+
+ new
+ call feedkeys("a\<Right>a\<Esc>", 'xt')
+ call assert_equal('a', getline(1))
+ undo
+ call assert_equal('', getline(1))
+
+ bwipe!
+ set completeopt&
+ iunmap <Right>
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab