diff options
author | watiko <service@mail.watiko.net> | 2016-02-07 12:12:07 +0900 |
---|---|---|
committer | watiko <service@mail.watiko.net> | 2016-02-11 15:13:30 +0900 |
commit | 663e1ed158956a75845642974ab81bba1826ff05 (patch) | |
tree | a418eb5b777ef485320cfd579a909df6554c098c /test | |
parent | 4a0e10fb2c584ae5cbd95041373944663fa8755d (diff) | |
download | rneovim-663e1ed158956a75845642974ab81bba1826ff05.tar.gz rneovim-663e1ed158956a75845642974ab81bba1826ff05.tar.bz2 rneovim-663e1ed158956a75845642974ab81bba1826ff05.zip |
vim-patch:7.4.743
Problem: "p" in Visual mode causes an unexpected line split.
Solution: Advance the cursor first. (Yukihiro Nakadaira)
https://github.com/vim/vim/commit/c004bc2726eafc7a56d1d9f8398a65a0a7dc8d6c
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/legacy/094_visual_mode_operators_spec.lua | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/test/functional/legacy/094_visual_mode_operators_spec.lua b/test/functional/legacy/094_visual_mode_operators_spec.lua index 04302334ae..32ce713a02 100644 --- a/test/functional/legacy/094_visual_mode_operators_spec.lua +++ b/test/functional/legacy/094_visual_mode_operators_spec.lua @@ -31,6 +31,13 @@ local function put_abc() $put ='c']]) end +local function put_aaabbbccc() + source([[ + $put ='aaa' + $put ='bbb' + $put ='ccc']]) +end + local function define_select_mode_maps() source([[ snoremap <lt>End> <End> @@ -307,4 +314,61 @@ describe('Visual mode and operator', function() a]]) end) end) + + describe('v_p:', function() + it('replace last character with line register at middle line', function() + put_aaabbbccc() + execute('-2yank') + feed('k$vp') + + expect([[ + + aaa + bb + aaa + + ccc]]) + end) + + it('replace last character with line register at middle line selecting newline', function() + put_aaabbbccc() + execute('-2yank') + feed('k$v$p') + + expect([[ + + aaa + bb + aaa + ccc]]) + end) + + it('replace last character with line register at last line', function() + put_aaabbbccc() + execute('-2yank') + feed('$vp') + + expect([[ + + aaa + bbb + cc + aaa + ]]) + end) + + it('replace last character with line register at last line selecting newline', function() + put_aaabbbccc() + execute('-2yank') + feed('$v$p') + + expect([[ + + aaa + bbb + cc + aaa + ]]) + end) + end) end) |