forked from aniani/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 #5183)
This commit is contained in:
@@ -4434,9 +4434,10 @@ current_quote(
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
vis_bef_curs = LT_POS(VIsual, curwin->w_cursor);
|
vis_bef_curs = LT_POS(VIsual, curwin->w_cursor);
|
||||||
|
vis_empty = EQUAL_POS(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 the start of Visual selection.
|
// VIsual needs to be the start of Visual selection.
|
||||||
pos_T t = curwin->w_cursor;
|
pos_T t = curwin->w_cursor;
|
||||||
@@ -4447,9 +4448,9 @@ current_quote(
|
|||||||
restore_vis_bef = TRUE;
|
restore_vis_bef = TRUE;
|
||||||
}
|
}
|
||||||
dec_cursor();
|
dec_cursor();
|
||||||
}
|
|
||||||
vis_empty = EQUAL_POS(VIsual, curwin->w_cursor);
|
vis_empty = EQUAL_POS(VIsual, curwin->w_cursor);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!vis_empty)
|
if (!vis_empty)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -47,6 +47,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
|
||||||
|
|||||||
@@ -741,6 +741,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
2314,
|
||||||
/**/
|
/**/
|
||||||
2313,
|
2313,
|
||||||
/**/
|
/**/
|
||||||
|
|||||||
Reference in New Issue
Block a user