diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-11-17 17:32:28 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-11-17 17:32:28 +0100 |
commit | 7170b295b06e3168424985530d8477ed2e058b67 (patch) | |
tree | a2041e4732fd89270917ce010c300f3897b49411 /src/search.c | |
parent | eda1da0c9a8db1400649629117e7d248c07735f7 (diff) | |
download | vim-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.c | 5 |
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) |