summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2012-07-19 17:18:26 +0200
committerBram Moolenaar <Bram@vim.org>2012-07-19 17:18:26 +0200
commit94c465c53d77d2c6eda829c744f27f093f0e0813 (patch)
treec62f7ae2fd4b788e6df6378f5ad4f86bc7c98ee4
parent1a0cee53d414517aef51e31a17a7d089f85e10b8 (diff)
downloadvim-git-94c465c53d77d2c6eda829c744f27f093f0e0813.tar.gz
updated for version 7.3.606v7.3.606
Problem: CTRL-P completion has a problem with multi-byte characters. Solution: Check for next character being NUL properly. (Yasuhiro Matsumoto)
-rw-r--r--src/macros.h3
-rw-r--r--src/search.c2
-rw-r--r--src/version.c2
3 files changed, 6 insertions, 1 deletions
diff --git a/src/macros.h b/src/macros.h
index be3af9a5c..9e3ba44b4 100644
--- a/src/macros.h
+++ b/src/macros.h
@@ -259,6 +259,8 @@
* PTR2CHAR(): get character from pointer.
*/
#ifdef FEAT_MBYTE
+/* Get the length of the character p points to */
+# define MB_PTR2LEN(p) (has_mbyte ? (*mb_ptr2len)(p) : 1)
/* Advance multi-byte pointer, skip over composing chars. */
# define mb_ptr_adv(p) p += has_mbyte ? (*mb_ptr2len)(p) : 1
/* Advance multi-byte pointer, do not skip over composing chars. */
@@ -272,6 +274,7 @@
# define MB_CHARLEN(p) (has_mbyte ? mb_charlen(p) : (int)STRLEN(p))
# define PTR2CHAR(p) (has_mbyte ? mb_ptr2char(p) : (int)*(p))
#else
+# define MB_PTR2LEN(p) 1
# define mb_ptr_adv(p) ++p
# define mb_cptr_adv(p) ++p
# define mb_ptr_back(s, p) --p
diff --git a/src/search.c b/src/search.c
index 1db967de2..e231a3a10 100644
--- a/src/search.c
+++ b/src/search.c
@@ -5141,7 +5141,7 @@ exit_matched:
&& !(compl_cont_status & CONT_SOL)
#endif
&& *startp != NUL
- && *(p = startp + 1) != NUL)
+ && *(p = startp + MB_PTR2LEN(startp)) != NUL)
goto search_line;
}
line_breakcheck();
diff --git a/src/version.c b/src/version.c
index 064af8b2c..cd0d2d7df 100644
--- a/src/version.c
+++ b/src/version.c
@@ -715,6 +715,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 606,
+/**/
605,
/**/
604,