mirror of
https://github.com/neovim/neovim.git
synced 2025-10-09 03:16:31 +00:00
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:
@@ -3808,8 +3808,9 @@ current_quote(
|
|||||||
}
|
}
|
||||||
|
|
||||||
vis_bef_curs = lt(VIsual, curwin->w_cursor);
|
vis_bef_curs = lt(VIsual, curwin->w_cursor);
|
||||||
|
vis_empty = equalpos(VIsual, curwin->w_cursor);
|
||||||
if (*p_sel == 'e') {
|
if (*p_sel == 'e') {
|
||||||
if (!vis_bef_curs) {
|
if (!vis_bef_curs && !vis_empty) {
|
||||||
// VIsual needs to be start of Visual selection.
|
// VIsual needs to be start of Visual selection.
|
||||||
pos_T t = curwin->w_cursor;
|
pos_T t = curwin->w_cursor;
|
||||||
|
|
||||||
@@ -3819,9 +3820,9 @@ current_quote(
|
|||||||
restore_vis_bef = true;
|
restore_vis_bef = true;
|
||||||
}
|
}
|
||||||
dec_cursor();
|
dec_cursor();
|
||||||
}
|
|
||||||
vis_empty = equalpos(VIsual, curwin->w_cursor);
|
vis_empty = equalpos(VIsual, curwin->w_cursor);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!vis_empty) {
|
if (!vis_empty) {
|
||||||
/* Check if the existing selection exactly spans the text inside
|
/* Check if the existing selection exactly spans the text inside
|
||||||
|
@@ -48,6 +48,9 @@ func Test_quote_selection_selection_exclusive()
|
|||||||
set selection=exclusive
|
set selection=exclusive
|
||||||
exe "norm! fdvhi'y"
|
exe "norm! fdvhi'y"
|
||||||
call assert_equal('bcde', @")
|
call assert_equal('bcde', @")
|
||||||
|
let @"='dummy'
|
||||||
|
exe "norm! $gevi'y"
|
||||||
|
call assert_equal('bcde', @")
|
||||||
set selection&vim
|
set selection&vim
|
||||||
bw!
|
bw!
|
||||||
endfunc
|
endfunc
|
||||||
|
Reference in New Issue
Block a user