From 4303399c10b7106ccf350e8a419fe3c15b81c8e0 Mon Sep 17 00:00:00 2001 From: Shougo Matsushita Date: Sat, 4 Mar 2017 12:24:49 +0900 Subject: vim-patch:8.0.0319 Problem: Insert mode completion does not respect "start" in 'backspace'. Solution: Check whether backspace can go before where insert started. (Hirohito Higashi) https://github.com/vim/vim/commit/190b04cdd936f4696c22466b7f077f9371d96580 --- src/nvim/testdir/test_popup.vim | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_popup.vim b/src/nvim/testdir/test_popup.vim index edc6336aa7..259e0149af 100644 --- a/src/nvim/testdir/test_popup.vim +++ b/src/nvim/testdir/test_popup.vim @@ -482,6 +482,26 @@ func Test_completion_ctrl_e_without_autowrap() q! endfunc +func Test_completion_respect_bs_option() + new + let li = ["aaa", "aaa12345", "aaaabcdef", "aaaABC"] + + set bs=indent,eol + call setline(1, li) + 1 + call feedkeys("A\\\\\\\", "tx") + call assert_equal('aaa', getline(1)) + + %d + set bs=indent,eol,start + call setline(1, li) + 1 + call feedkeys("A\\\\\\\", "tx") + call assert_equal('', getline(1)) + + bw! +endfunc + func CompleteUndo() abort call complete(1, g:months) return '' -- cgit From cf0b344df14aa5de16ab0a7081ef20d44360c45e Mon Sep 17 00:00:00 2001 From: Shougo Matsushita Date: Sat, 4 Mar 2017 12:35:40 +0900 Subject: vim-patch:8.0.0347 Problem: When using CTRL-X CTRL-U inside a comment, the use of the comment leader may not work. (Klement) Solution: Save and restore did_ai. (Christian Brabandt, closes vim/vim#1494) https://github.com/vim/vim/commit/d099e033703ce0772f152b8df8a763f0b65303ee --- src/nvim/testdir/test_popup.vim | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_popup.vim b/src/nvim/testdir/test_popup.vim index 259e0149af..fd0f3c0d2d 100644 --- a/src/nvim/testdir/test_popup.vim +++ b/src/nvim/testdir/test_popup.vim @@ -522,4 +522,23 @@ func Test_completion_can_undo() iunmap endfunc +func Test_completion_comment_formatting() + new + setl formatoptions=tcqro + call feedkeys("o/*\\/\", 'tx') + call assert_equal(['', '/*', ' *', ' */'], getline(1,4)) + %d + call feedkeys("o/*\foobar\/\", 'tx') + call assert_equal(['', '/*', ' * foobar', ' */'], getline(1,4)) + %d + try + call feedkeys("o/*\\\\/\", 'tx') + call assert_false(1, 'completefunc not set, should have failed') + catch + call assert_exception('E764:') + endtry + call assert_equal(['', '/*', ' *', ' */'], getline(1,4)) + bwipe! +endfunc + " vim: shiftwidth=2 sts=2 expandtab -- cgit