diff options
Diffstat (limited to 'src/macros.h')
-rw-r--r-- | src/macros.h | 18 |
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 |