summaryrefslogtreecommitdiff
path: root/src/search.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-11-17 17:32:28 +0100
committerBram Moolenaar <Bram@vim.org>2019-11-17 17:32:28 +0100
commit7170b295b06e3168424985530d8477ed2e058b67 (patch)
treea2041e4732fd89270917ce010c300f3897b49411 /src/search.c
parenteda1da0c9a8db1400649629117e7d248c07735f7 (diff)
downloadvim-git-7170b295b06e3168424985530d8477ed2e058b67.tar.gz
patch 8.1.2314: vi' sometimes does not select anythingv8.1.2314
Problem: vi' sometimes does not select anything. Solution: Recognize an empty selection. (Christian Brabandt, closes #5183)
Diffstat (limited to 'src/search.c')
-rw-r--r--src/search.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/search.c b/src/search.c
index cff289cf5..f7c7eca38 100644
--- a/src/search.c
+++ b/src/search.c
@@ -4434,9 +4434,10 @@ current_quote(
return FALSE;
vis_bef_curs = LT_POS(VIsual, curwin->w_cursor);
+ vis_empty = EQUAL_POS(VIsual, curwin->w_cursor);
if (*p_sel == 'e')
{
- if (!vis_bef_curs)
+ if (!vis_bef_curs && !vis_empty)
{
// VIsual needs to be the start of Visual selection.
pos_T t = curwin->w_cursor;
@@ -4447,8 +4448,8 @@ current_quote(
restore_vis_bef = TRUE;
}
dec_cursor();
+ vis_empty = EQUAL_POS(VIsual, curwin->w_cursor);
}
- vis_empty = EQUAL_POS(VIsual, curwin->w_cursor);
}
if (!vis_empty)