1
0
forked from aniani/vim

patch 8.1.0125: virtual edit replace with multi-byte fails at end of line

Problem:    Virtual edit replace with multi-byte fails at end of line. (Lukas
            Werling)
Solution:   use ins_char() to add the character. (Christian Brabandt,
            closes #3114)  Rename PCHAR() to PBYTE() to avoid mistakes like
            this.
This commit is contained in:
Bram Moolenaar
2018-06-28 19:26:28 +02:00
parent d8b37a53bd
commit 630afe889a
4 changed files with 50 additions and 13 deletions

View File

@@ -42,6 +42,22 @@ func Test_paste_end_of_line()
set virtualedit=
endfunc
func Test_replace_end_of_line()
new
set virtualedit=all
call setline(1, range(20))
exe "normal! gg2jv10lr-"
call assert_equal(["1", "-----------", "3"], getline(2,4))
if has('multi_byte')
call setline(1, range(20))
exe "normal! gg2jv10lr\<c-k>hh"
call assert_equal(["1", "───────────", "3"], getline(2,4))
endif
bwipe!
set virtualedit=
endfunc
func Test_edit_CTRL_G()
new
set virtualedit=insert