summaryrefslogtreecommitdiff
path: root/src/macros.h
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2004-12-19 22:46:22 +0000
committerBram Moolenaar <Bram@vim.org>2004-12-19 22:46:22 +0000
commit1cd871b5341bf43ee99e136844e3131014880f92 (patch)
tree6bd9573dbc14de3c4ec85e424cbec9c8d1ee0ed8 /src/macros.h
parent46c9c73de8def79baf8f0a34a12549f6c14944f3 (diff)
downloadvim-git-1cd871b5341bf43ee99e136844e3131014880f92.tar.gz
updated for version 7.0023v7.0023
Diffstat (limited to 'src/macros.h')
-rw-r--r--src/macros.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/macros.h b/src/macros.h
index 43bddba32..9596796df 100644
--- a/src/macros.h
+++ b/src/macros.h
@@ -253,3 +253,21 @@
/* Without the 'numberwidth' option line numbers are always 7 chars. */
# define number_width(x) 7
#endif
+
+#ifndef FEAT_MBYTE
+# define after_pathsep(b, p) vim_ispathsep(*((p) - 1))
+#endif
+
+/*
+ * mb_ptr_adv(): advance a pointer to the next character, taking care of
+ * multi-byte characters if needed.
+ * mb_ptr_back(): backup a pointer to the previous character, taking care of
+ * multi-byte characters if needed.
+ */
+#ifdef FEAT_MBYTE
+# define mb_ptr_adv(p) p += has_mbyte ? (*mb_ptr2len_check)(p) : 1
+# define mb_ptr_back(s, p) p -= has_mbyte ? ((*mb_head_off)(s, p - 1) + 1) : 1
+#else
+# define mb_ptr_adv(p) ++p
+# define mb_ptr_back(s, p) --p
+#endif