summaryrefslogtreecommitdiff
path: root/src/search.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2011-06-26 05:36:34 +0200
committerBram Moolenaar <Bram@vim.org>2011-06-26 05:36:34 +0200
commit8b3e0330ba1fee9ac6293f82f546e08be3f0799c (patch)
tree25e23e6842c28b3deef1a7f14f6e03c646001830 /src/search.c
parent20892c1e6830abf25828fb73a72815d904271bd0 (diff)
downloadvim-git-8b3e0330ba1fee9ac6293f82f546e08be3f0799c.tar.gz
updated for version 7.3.235v7.3.235
Problem: ";" gets stuck on a "t" command, it's not useful. Solution: Add the ';' flag in 'cpo'. (Christian Brabandt)
Diffstat (limited to 'src/search.c')
-rw-r--r--src/search.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/search.c b/src/search.c
index acd4c8da4..6c9e1dae9 100644
--- a/src/search.c
+++ b/src/search.c
@@ -1546,6 +1546,7 @@ searchc(cap, t_cmd)
int col;
char_u *p;
int len;
+ int stop = TRUE;
#ifdef FEAT_MBYTE
static char_u bytes[MB_MAXBYTES];
static int bytelen = 1; /* >1 for multi-byte char */
@@ -1580,6 +1581,12 @@ searchc(cap, t_cmd)
t_cmd = last_t_cmd;
c = lastc;
/* For multi-byte re-use last bytes[] and bytelen. */
+
+ /* Force a move of at least one char, so ";" and "," will move the
+ * cursor, even if the cursor is right in front of char we are looking
+ * at. */
+ if (vim_strchr(p_cpo, CPO_SCOLON) == NULL && count == 1)
+ stop = FALSE;
}
if (dir == BACKWARD)
@@ -1612,14 +1619,15 @@ searchc(cap, t_cmd)
}
if (bytelen == 1)
{
- if (p[col] == c)
+ if (p[col] == c && stop)
break;
}
else
{
- if (vim_memcmp(p + col, bytes, bytelen) == 0)
+ if (vim_memcmp(p + col, bytes, bytelen) == 0 && stop)
break;
}
+ stop = TRUE;
}
}
else
@@ -1629,8 +1637,9 @@ searchc(cap, t_cmd)
{
if ((col += dir) < 0 || col >= len)
return FAIL;
- if (p[col] == c)
+ if (p[col] == c && stop)
break;
+ stop = TRUE;
}
}
}