0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -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