diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2019-06-25 02:37:50 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-06-25 02:37:50 +0200 |
| commit | 615fc6826359b4171fbb40ea34ba7ddf29bea045 (patch) | |
| tree | 2da5172c89f512da4fe0c625aff1fe74c62ef248 /src/nvim/testdir/test_mapping.vim | |
| parent | 79450f2da97e352676516d63521c18fbac46186b (diff) | |
| parent | ed2d651b504012d89f00ea89814cfcb15a0faf3f (diff) | |
| download | rneovim-615fc6826359b4171fbb40ea34ba7ddf29bea045.tar.gz rneovim-615fc6826359b4171fbb40ea34ba7ddf29bea045.tar.bz2 rneovim-615fc6826359b4171fbb40ea34ba7ddf29bea045.zip | |
Merge #10323 from janlazo/vim-8.1.1055
vim-patch:8.0.{1479,1480,1482},8.1.1055
Diffstat (limited to 'src/nvim/testdir/test_mapping.vim')
| -rw-r--r-- | src/nvim/testdir/test_mapping.vim | 25 |
1 files changed, 24 insertions, 1 deletions
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() + " <c-g>U<cursor> works only within a single line + nnoremap c<* *Ncgn<C-r>"<C-G>U<S-Left> + call setline(1, ['foo', 'foobar', '', 'foo']) + call cursor(1,2) + call feedkeys("c<*PREFIX\<esc>.", '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 <S-Left> move to the previous line + nnoremap c<* *Ncgn<C-r>"<C-G>U<S-Left><C-G>U<S-Left> + call setline(1, ['', ' foo', 'foobar', '', 'foo']) + call cursor(2,3) + call feedkeys("c<*PREFIX\<esc>.", '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\<C-G>U\<Right>new line here\<esc>\<up>\<up>." call assert_equal('new line here', getline(line('$') - 3)) |