0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

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)
This commit is contained in:
Bram Moolenaar
2012-07-19 17:18:26 +02:00
parent 1a0cee53d4
commit 94c465c53d
3 changed files with 6 additions and 1 deletions

View File

@@ -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 File

@@ -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();

View File

@@ -714,6 +714,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
606,
/**/
605,
/**/