aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-01-23 19:36:39 -0500
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-01-24 02:02:40 -0500
commite22d0cf12c985e670fcc562a6ce75e82a0b3a741 (patch)
tree0b98a8c821b4249951d34adcf0ea75d4955f58c1 /src/nvim/testdir
parent376fa27237d0a1ce5ef9967473920ac7d68fcf29 (diff)
downloadrneovim-e22d0cf12c985e670fcc562a6ce75e82a0b3a741.tar.gz
rneovim-e22d0cf12c985e670fcc562a6ce75e82a0b3a741.tar.bz2
rneovim-e22d0cf12c985e670fcc562a6ce75e82a0b3a741.zip
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
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_listlbr.vim31
1 files changed, 31 insertions, 0 deletions
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\<C-V>ey"
+ call assert_equal('2234567890', @@)
+ exec "norm! w\<C-V>ey"
+ call assert_equal('3234567890', @@)
+
+ " increment / decrement
+ exec "norm! ^w\<C-V>\<C-A>w\<C-V>\<C-X>"
+ call assert_equal('1234567890 3234567890 2234567890', getline(1))
+
+ " replace
+ exec "norm! ^w\<C-V>3lraw\<C-V>3lrb"
+ call assert_equal('1234567890 aaaa567890 bbbb567890', getline(1))
+
+ " tilde
+ exec "norm! ^w\<C-V>2l~w\<C-V>2l~"
+ call assert_equal('1234567890 AAAa567890 BBBb567890', getline(1))
+
+ " delete and insert
+ exec "norm! ^w\<C-V>3lc2345\<Esc>w\<C-V>3lc3456\<Esc>"
+ 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, [