vim-patch:8.1.2314: vi' sometimes does not select anything

Problem:    vi' sometimes does not select anything.
Solution:   Recognize an empty selection. (Christian Brabandt, closes vim/vim#5183)
7170b295b0
This commit is contained in:
Jan Edmund Lazo 2019-11-17 21:48:59 -05:00
parent e4b185893f
commit f484d3b2d4
No known key found for this signature in database
GPG Key ID: 64915E6E9F735B15
2 changed files with 6 additions and 2 deletions

View File

@ -3808,8 +3808,9 @@ current_quote(
}
vis_bef_curs = lt(VIsual, curwin->w_cursor);
vis_empty = equalpos(VIsual, curwin->w_cursor);
if (*p_sel == 'e') {
if (!vis_bef_curs) {
if (!vis_bef_curs && !vis_empty) {
// VIsual needs to be start of Visual selection.
pos_T t = curwin->w_cursor;
@ -3819,8 +3820,8 @@ current_quote(
restore_vis_bef = true;
}
dec_cursor();
vis_empty = equalpos(VIsual, curwin->w_cursor);
}
vis_empty = equalpos(VIsual, curwin->w_cursor);
}
if (!vis_empty) {

View File

@ -48,6 +48,9 @@ func Test_quote_selection_selection_exclusive()
set selection=exclusive
exe "norm! fdvhi'y"
call assert_equal('bcde', @")
let @"='dummy'
exe "norm! $gevi'y"
call assert_equal('bcde', @")
set selection&vim
bw!
endfunc