summaryrefslogtreecommitdiff
path: root/src/macros.h
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 /src/macros.h
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)
Diffstat (limited to 'src/macros.h')
-rw-r--r--src/macros.h3
1 files changed, 3 insertions, 0 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