From 94c465c53d77d2c6eda829c744f27f093f0e0813 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 19 Jul 2012 17:18:26 +0200 Subject: [PATCH] updated for version 7.3.606 Problem: CTRL-P completion has a problem with multi-byte characters. Solution: Check for next character being NUL properly. (Yasuhiro Matsumoto) --- src/macros.h | 3 +++ src/search.c | 2 +- src/version.c | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) 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 @@ -714,6 +714,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 606, /**/ 605, /**/ -- 2.40.0