Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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)
  • Loading branch information...
commit d347933cfc265f6d9176332d04066f8a680a85f7 1 parent e1d9f2c
Bram Moolenaar authored
Showing with 6 additions and 1 deletion.
  1. +3 −0  src/macros.h
  2. +1 −1  src/search.c
  3. +2 −0  src/version.c
View
3  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
View
2  src/search.c
@@ -5141,7 +5141,7 @@ find_pattern_in_path(ptr, dir, len, whole, skip_comments,
&& !(compl_cont_status & CONT_SOL)
#endif
&& *startp != NUL
- && *(p = startp + 1) != NUL)
+ && *(p = startp + MB_PTR2LEN(startp)) != NUL)
goto search_line;
}
line_breakcheck();
View
2  src/version.c
@@ -715,6 +715,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 606,
+/**/
605,
/**/
604,
Please sign in to comment.
Something went wrong with that request. Please try again.