From e22d0cf12c985e670fcc562a6ce75e82a0b3a741 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Thu, 23 Jan 2020 19:36:39 -0500 Subject: vim-patch:8.2.0147: block Visual mode operators not correct when 'linebreak' set Problem: Block Visual mode operators not correct when 'linebreak' set. Solution: Set w_p_lbr to lbr_saved more often. (Ken Takata, closes vim/vim#5524) https://github.com/vim/vim/commit/03c3bd9fd094c1aede2e8fe3ad8fd25b9f033053 --- src/nvim/testdir/test_listlbr.vim | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_listlbr.vim b/src/nvim/testdir/test_listlbr.vim index d28dbc444c..cdc5e4cc7c 100644 --- a/src/nvim/testdir/test_listlbr.vim +++ b/src/nvim/testdir/test_listlbr.vim @@ -103,6 +103,37 @@ func Test_linebreak_with_conceal() call s:close_windows() endfunc +func Test_linebreak_with_visual_operations() + call s:test_windows() + let line = '1234567890 2234567890 3234567890' + call setline(1, line) + + " yank + exec "norm! ^w\ey" + call assert_equal('2234567890', @@) + exec "norm! w\ey" + call assert_equal('3234567890', @@) + + " increment / decrement + exec "norm! ^w\\w\\" + call assert_equal('1234567890 3234567890 2234567890', getline(1)) + + " replace + exec "norm! ^w\3lraw\3lrb" + call assert_equal('1234567890 aaaa567890 bbbb567890', getline(1)) + + " tilde + exec "norm! ^w\2l~w\2l~" + call assert_equal('1234567890 AAAa567890 BBBb567890', getline(1)) + + " delete and insert + exec "norm! ^w\3lc2345\w\3lc3456\" + call assert_equal('1234567890 2345567890 3456567890', getline(1)) + call assert_equal('BBBb', @@) + + call s:close_windows() +endfunc + func Test_virtual_block() call s:test_windows('setl sbr=+') call setline(1, [ -- cgit