Use my_wcwidth()+my_wcswidth() instead of system’s wcwdith()+wcswidth()

But not that these functions map to the system’s versions if foot was
configured with ‘-Dsystem-wcwidth’.
This commit is contained in:
Daniel Eklöf 2022-01-05 22:14:30 +01:00
parent c758949145
commit 97ade97d38
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
4 changed files with 15 additions and 11 deletions

3
ime.c
View file

@ -15,6 +15,7 @@
#include "util.h"
#include "wayland.h"
#include "xmalloc.h"
#include "my-wcwidth.h"
static void
enter(void *data, struct zwp_text_input_v3 *zwp_text_input_v3,
@ -178,7 +179,7 @@ done(void *data, struct zwp_text_input_v3 *zwp_text_input_v3,
size_t widths[wchars + 1];
for (size_t i = 0; i < wchars; i++) {
int width = max(wcwidth(seat->ime.preedit.text[i]), 1);
int width = max(my_wcwidth(seat->ime.preedit.text[i]), 1);
widths[i] = width;
cell_count += width;
}