vim-patch:8.0.0339: illegal memory access with vi' (#7794)

Problem:    Illegal memory access with vi'
Solution:   For quoted text objects bail out if the Visual area spans more
            than one line.

46522af724
This commit is contained in:
KunMing Xie
2018-01-01 23:08:26 +08:00
committed by Justin M. Keyes
parent 907b2f18f7
commit 1d8c612f78
2 changed files with 12 additions and 0 deletions

View File

@@ -3669,6 +3669,11 @@ current_quote (
/* Correct cursor when 'selection' is exclusive */
if (VIsual_active) {
// this only works within one line
if (VIsual.lnum != curwin->w_cursor.lnum) {
return false;
}
vis_bef_curs = lt(VIsual, curwin->w_cursor);
if (*p_sel == 'e' && vis_bef_curs)
dec_cursor();

View File

@@ -43,3 +43,10 @@ func Test_dotregister_paste()
call assert_equal('hello world world', getline(1))
q!
endfunc
func Test_Visual_inner_quote()
new
normal oxX
normal vki'
bwipe!
endfunc