Mercurial > vim
comparison src/testdir/test_virtualedit.vim @ 18771:50fde4e20790 v8.1.2375
patch 8.1.2375: no suffucient testing for registers
Commit: https://github.com/vim/vim/commit/6f1f0ca3edf395102ff3109c998d81300c8be3c9
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Dec 1 18:16:18 2019 +0100
patch 8.1.2375: no suffucient testing for registers
Problem: No suffucient testing for registers.
Solution: Add more test cases. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/5296)
Fix that "p" on last virtual column of tab inserts spaces.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 01 Dec 2019 18:30:03 +0100 |
parents | 26256dcadd77 |
children | 7b57a80f70f6 |
comparison
equal
deleted
inserted
replaced
18770:796651a5d437 | 18771:50fde4e20790 |
---|---|
79 set virtualedit=all | 79 set virtualedit=all |
80 call setline(1, "\t⒌") | 80 call setline(1, "\t⒌") |
81 normal Cx | 81 normal Cx |
82 call assert_equal('x', getline(1)) | 82 call assert_equal('x', getline(1)) |
83 bwipe! | 83 bwipe! |
84 set virtualedit= | |
84 endfunc | 85 endfunc |
86 | |
87 " Test for pasting before and after a tab character | |
88 func Test_paste_in_tab() | |
89 new | |
90 let @" = 'xyz' | |
91 set virtualedit=all | |
92 call append(0, "a\tb") | |
93 call cursor(1, 2, 6) | |
94 normal p | |
95 call assert_equal("a\txyzb", getline(1)) | |
96 call setline(1, "a\tb") | |
97 call cursor(1, 2) | |
98 normal P | |
99 call assert_equal("axyz\tb", getline(1)) | |
100 | |
101 " Test for virtual block paste | |
102 call setreg('"', 'xyz', 'b') | |
103 call setline(1, "a\tb") | |
104 call cursor(1, 2, 6) | |
105 normal p | |
106 call assert_equal("a\txyzb", getline(1)) | |
107 call setline(1, "a\tb") | |
108 call cursor(1, 2, 6) | |
109 normal P | |
110 call assert_equal("a xyz b", getline(1)) | |
111 | |
112 " Test for virtual block paste with gp and gP | |
113 call setline(1, "a\tb") | |
114 call cursor(1, 2, 6) | |
115 normal gp | |
116 call assert_equal("a\txyzb", getline(1)) | |
117 call assert_equal([0, 1, 6, 0, 12], getcurpos()) | |
118 call setline(1, "a\tb") | |
119 call cursor(1, 2, 6) | |
120 normal gP | |
121 call assert_equal("a xyz b", getline(1)) | |
122 call assert_equal([0, 1, 12, 0 ,12], getcurpos()) | |
123 | |
124 bwipe! | |
125 set virtualedit= | |
126 endfunc |