From 54ff21a15303e1c7dbfde4895c3444daad6df16a Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Sun, 14 Nov 2021 13:34:59 +0100 Subject: refactor(macros): delete multibyte macros which just are aliases --- src/nvim/macros.h | 8 -------- 1 file changed, 8 deletions(-) (limited to 'src/nvim/macros.h') diff --git a/src/nvim/macros.h b/src/nvim/macros.h index 8a969c43a1..b315c06656 100644 --- a/src/nvim/macros.h +++ b/src/nvim/macros.h @@ -92,14 +92,11 @@ #define REPLACE_NORMAL(s) (((s) & REPLACE_FLAG) && !((s) & VREPLACE_FLAG)) -#define UTF_COMPOSINGLIKE(p1, p2) utf_composinglike((p1), (p2)) - // 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. // MB_COPY_CHAR(f, t): copy one char from "f" to "t" and advance the pointers. -// PTR2CHAR(): get character from pointer. // Advance multi-byte pointer, skip over composing chars. #define MB_PTR_ADV(p) (p += utfc_ptr2len((char_u *)p)) @@ -108,14 +105,9 @@ // Backup multi-byte pointer. Only use with "p" > "s" ! #define MB_PTR_BACK(s, p) \ (p -= utf_head_off((char_u *)s, (char_u *)p - 1) + 1) -// get length of multi-byte char, not including composing chars -#define MB_CPTR2LEN(p) utf_ptr2len(p) #define MB_COPY_CHAR(f, t) mb_copy_char((const char_u **)(&f), &t); -#define MB_CHARLEN(p) mb_charlen(p) -#define PTR2CHAR(p) utf_ptr2char(p) - #define RESET_BINDING(wp) \ do { \ (wp)->w_p_scb = false; \ -- cgit From 1450a6f7534147e3d7252594cf06e2a1cc14b79b Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Sun, 14 Nov 2021 13:39:14 +0100 Subject: refactor(macroman): get rid of MB_COPY_CHAR macro clean up docs for MB_PTR_ADV and MB_PTR_BACK --- src/nvim/macros.h | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'src/nvim/macros.h') diff --git a/src/nvim/macros.h b/src/nvim/macros.h index b315c06656..faef0f69b2 100644 --- a/src/nvim/macros.h +++ b/src/nvim/macros.h @@ -92,22 +92,19 @@ #define REPLACE_NORMAL(s) (((s) & REPLACE_FLAG) && !((s) & VREPLACE_FLAG)) -// 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. -// MB_COPY_CHAR(f, t): copy one char from "f" to "t" and advance the pointers. -// Advance multi-byte pointer, skip over composing chars. +// MB_PTR_ADV(): advance a pointer to the next character, taking care of +// multi-byte characters if needed. Skip over composing chars. #define MB_PTR_ADV(p) (p += utfc_ptr2len((char_u *)p)) + // Advance multi-byte pointer, do not skip over composing chars. #define MB_CPTR_ADV(p) (p += utf_ptr2len(p)) -// Backup multi-byte pointer. Only use with "p" > "s" ! + +// MB_PTR_BACK(): backup a pointer to the previous character, taking care of +// multi-byte characters if needed. Only use with "p" > "s" ! #define MB_PTR_BACK(s, p) \ (p -= utf_head_off((char_u *)s, (char_u *)p - 1) + 1) -#define MB_COPY_CHAR(f, t) mb_copy_char((const char_u **)(&f), &t); - #define RESET_BINDING(wp) \ do { \ (wp)->w_p_scb = false; \ -- cgit