summaryrefslogtreecommitdiff
path: root/src/normal.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/normal.c')
-rw-r--r--src/normal.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/normal.c b/src/normal.c
index a18594953..0f9b23051 100644
--- a/src/normal.c
+++ b/src/normal.c
@@ -6228,6 +6228,7 @@ nv_dollar(cmdarg_T *cap)
nv_search(cmdarg_T *cap)
{
oparg_T *oap = cap->oap;
+ pos_T save_cursor = curwin->w_cursor;
if (cap->cmdchar == '?' && cap->oap->op_type == OP_ROT13)
{
@@ -6238,6 +6239,8 @@ nv_search(cmdarg_T *cap)
return;
}
+ /* When using 'incsearch' the cursor may be moved to set a different search
+ * start position. */
cap->searchbuf = getcmdline(cap->cmdchar, cap->count1, 0);
if (cap->searchbuf == NULL)
@@ -6247,7 +6250,8 @@ nv_search(cmdarg_T *cap)
}
(void)normal_search(cap, cap->cmdchar, cap->searchbuf,
- (cap->arg ? 0 : SEARCH_MARK));
+ (cap->arg || !equalpos(save_cursor, curwin->w_cursor))
+ ? 0 : SEARCH_MARK);
}
/*