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
csi.c
View file

@ -24,6 +24,7 @@
#include "vt.h"
#include "xmalloc.h"
#include "xsnprintf.h"
#include "my-wcwidth.h"
#define UNHANDLED() LOG_DBG("unhandled: %s", csi_as_string(term, final, -1))
#define UNHANDLED_SGR(idx) LOG_DBG("unhandled: %s", csi_as_string(term, 'm', idx))
@ -742,7 +743,7 @@ csi_dispatch(struct terminal *term, uint8_t final)
int count = vt_param_get(term, 0, 1);
LOG_DBG("REP: '%lc' %d times", (wint_t)term->vt.last_printed, count);
const int width = wcwidth(term->vt.last_printed);
const int width = my_wcwidth(term->vt.last_printed);
if (width > 0) {
for (int i = 0; i < count; i++)
term_print(term, term->vt.last_printed, width);