diff options
-rw-r--r-- | src/dispextern.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/dispextern.h b/src/dispextern.h index 355454a4217..76578b8fde4 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -130,21 +130,27 @@ struct text_pos /* Increment text position POS. */ -#define INC_TEXT_POS(POS) \ +#define INC_TEXT_POS(POS, MULTIBYTE_P) \ do \ { \ ++(POS).charpos; \ - INC_POS ((POS).bytepos); \ + if (MULTIBYTE_P) \ + INC_POS ((POS).bytepos); \ + else \ + ++(POS).bytepos; \ } \ while (0) /* Decrement text position POS. */ -#define DEC_TEXT_POS(POS) \ +#define DEC_TEXT_POS(POS, MULTIBYTE_P) \ do \ { \ --(POS).charpos; \ - DEC_POS ((POS).bytepos); \ + if (MULTIBYTE_P) \ + DEC_POS ((POS).bytepos); \ + else \ + --(POS).bytepos; \ } \ while (0) |