From 3dcf2d5c1654e1207e60abc0b9c4864d89bb2f77 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sun, 23 Jun 2019 19:37:58 -0400 Subject: vim-patch:8.1.1055: CTRL-G U in Insert mode doesn't work for shift-Left Problem: CTRL-G U in Insert mode doesn't work to avoid splitting the undo sequence for shift-left and shift-right. Solution: Also check dont_sync_undo for shifted cursor keys. (Christian Brabandt) https://github.com/vim/vim/commit/75bf3d22f42684beecd977f3185e98045b5c33d9 --- src/nvim/testdir/test_mapping.vim | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_mapping.vim b/src/nvim/testdir/test_mapping.vim index 84a118aef2..9f253604ed 100644 --- a/src/nvim/testdir/test_mapping.vim +++ b/src/nvim/testdir/test_mapping.vim @@ -187,9 +187,32 @@ func Test_map_cursor() imapclear endfunc +func Test_map_cursor_ctrl_gU() + " U works only within a single line + nnoremap c<* *Ncgn"U + call setline(1, ['foo', 'foobar', '', 'foo']) + call cursor(1,2) + call feedkeys("c<*PREFIX\.", 'xt') + call assert_equal(['PREFIXfoo', 'foobar', '', 'PREFIXfoo'], getline(1,'$')) + " break undo manually + set ul=1000 + exe ":norm! uu" + call assert_equal(['foo', 'foobar', '', 'foo'], getline(1,'$')) + + " Test that it does not work if the cursor moves to the previous line + " 2 times move to the previous line + nnoremap c<* *Ncgn"UU + call setline(1, ['', ' foo', 'foobar', '', 'foo']) + call cursor(2,3) + call feedkeys("c<*PREFIX\.", 'xt') + call assert_equal(['PREFIXPREFIX', ' foo', 'foobar', '', 'foo'], getline(1,'$')) + nmapclear +endfunc + + " This isn't actually testing a mapping, but similar use of CTRL-G U as above. func Test_break_undo() - :set whichwrap=<,>,[,] + set whichwrap=<,>,[,] call feedkeys("G4o2k", "xt") exe ":norm! iTest3: text with a (parenthesis here\U\new line here\\\." call assert_equal('new line here', getline(line('$') - 3)) -- cgit From ed2d651b504012d89f00ea89814cfcb15a0faf3f Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sun, 23 Jun 2019 22:04:46 -0400 Subject: vim-patch:8.0.1482: using feedkeys() does not work to test completion Problem: Using feedkeys() does not work to test Insert mode completion. (Lifepillar) Solution: Do not check for typed keys when executing :normal or feedkeys(). Fix thesaurus completion not working when 'complete' is empty. https://github.com/vim/vim/commit/02ae9b4a93deea4993d7abe20485f91f1cce5e36 --- src/nvim/testdir/test_edit.vim | 7 +++---- src/nvim/testdir/test_ins_complete.vim | 11 +++++++++++ src/nvim/testdir/test_popup.vim | 2 +- 3 files changed, 15 insertions(+), 5 deletions(-) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_edit.vim b/src/nvim/testdir/test_edit.vim index 7f3994300f..48376d7922 100644 --- a/src/nvim/testdir/test_edit.vim +++ b/src/nvim/testdir/test_edit.vim @@ -643,11 +643,11 @@ func! Test_edit_CTRL_L() call feedkeys("cct\\\\", 'tnix') call assert_equal(['one', 'two', 'three', 't', '', '', ''], getline(1, '$')) call feedkeys("cct\\\\\", 'tnix') - call assert_equal(['one', 'two', 'three', 't', '', '', ''], getline(1, '$')) - call feedkeys("cct\\\\\\", 'tnix') call assert_equal(['one', 'two', 'three', 'two', '', '', ''], getline(1, '$')) - call feedkeys("cct\\\\\\\", 'tnix') + call feedkeys("cct\\\\\\", 'tnix') call assert_equal(['one', 'two', 'three', 'three', '', '', ''], getline(1, '$')) + call feedkeys("cct\\\\\\\", 'tnix') + call assert_equal(['one', 'two', 'three', 't', '', '', ''], getline(1, '$')) call feedkeys("cct\\\\", 'tnix') call assert_equal(['one', 'two', 'three', 'two', '', '', ''], getline(1, '$')) call feedkeys("cct\\\\\", 'tnix') @@ -1408,7 +1408,6 @@ func Test_edit_complete_very_long_name() let save_columns = &columns " Need at least about 1100 columns to reproduce the problem. set columns=2000 - call assert_equal(2000, &columns) set noswapfile let longfilename = longdirname . '/' . repeat('a', 255) diff --git a/src/nvim/testdir/test_ins_complete.vim b/src/nvim/testdir/test_ins_complete.vim index d3429617d0..071e82579e 100644 --- a/src/nvim/testdir/test_ins_complete.vim +++ b/src/nvim/testdir/test_ins_complete.vim @@ -249,3 +249,14 @@ func Test_omni_dash() delfunc Omni set omnifunc= endfunc + +" Check that when using feedkeys() typeahead does not interrupt searching for +" completions. +func Test_compl_feedkeys() + new + set completeopt=menuone,noselect + call feedkeys("ajump ju\\\\", "tx") + call assert_equal("jump jump", getline(1)) + bwipe! + set completeopt& +endfunc diff --git a/src/nvim/testdir/test_popup.vim b/src/nvim/testdir/test_popup.vim index 96f4bfc71b..557f60751c 100644 --- a/src/nvim/testdir/test_popup.vim +++ b/src/nvim/testdir/test_popup.vim @@ -641,7 +641,7 @@ func Test_popup_and_preview_autocommand() norm! gt call assert_equal(0, &previewwindow) norm! gT - call assert_equal(12, tabpagenr('$')) + call assert_equal(10, tabpagenr('$')) tabonly pclose augroup MyBufAdd -- cgit