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:
parent
e4b185893f
commit
f484d3b2d4
|
@ -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) {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue