aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2017-03-05 10:28:21 +0100
committerGitHub <noreply@github.com>2017-03-05 10:28:21 +0100
commit6a56ac2ecad89c5b00d5d4033f5570f417ee73d5 (patch)
tree3f08a2d221eeb665412bd08d8fa242ffd411b193 /src/nvim/testdir
parent32a9808bc514bca4baaf2f09668a4cb9f755bb4b (diff)
parentcf0b344df14aa5de16ab0a7081ef20d44360c45e (diff)
downloadrneovim-6a56ac2ecad89c5b00d5d4033f5570f417ee73d5.tar.gz
rneovim-6a56ac2ecad89c5b00d5d4033f5570f417ee73d5.tar.bz2
rneovim-6a56ac2ecad89c5b00d5d4033f5570f417ee73d5.zip
Merge #6209 from Shougo/vim-8.0.0319
vim-patch: 8.0.0319, 8.0.0347
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_popup.vim39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_popup.vim b/src/nvim/testdir/test_popup.vim
index edc6336aa7..fd0f3c0d2d 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\<C-X>\<C-N>\<C-P>\<BS>\<BS>\<BS>\<Esc>", "tx")
+ call assert_equal('aaa', getline(1))
+
+ %d
+ set bs=indent,eol,start
+ call setline(1, li)
+ 1
+ call feedkeys("A\<C-X>\<C-N>\<C-P>\<BS>\<BS>\<BS>\<Esc>", "tx")
+ call assert_equal('', getline(1))
+
+ bw!
+endfunc
+
func CompleteUndo() abort
call complete(1, g:months)
return ''
@@ -502,4 +522,23 @@ func Test_completion_can_undo()
iunmap <Right>
endfunc
+func Test_completion_comment_formatting()
+ new
+ setl formatoptions=tcqro
+ call feedkeys("o/*\<cr>\<cr>/\<esc>", 'tx')
+ call assert_equal(['', '/*', ' *', ' */'], getline(1,4))
+ %d
+ call feedkeys("o/*\<cr>foobar\<cr>/\<esc>", 'tx')
+ call assert_equal(['', '/*', ' * foobar', ' */'], getline(1,4))
+ %d
+ try
+ call feedkeys("o/*\<cr>\<cr>\<c-x>\<c-u>/\<esc>", '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