mirror of
https://github.com/profanity-im/profanity.git
synced 2025-01-03 14:57:42 -05:00
Use MB_CUR_MAX when calculating cursor position
This commit is contained in:
parent
e1f674eca3
commit
a02c89a8e8
@ -311,7 +311,7 @@ _inp_offset_to_col(char *str, int offset)
|
||||
|
||||
while (i < offset && str[i] != '\0') {
|
||||
gunichar uni = g_utf8_get_char(&str[i]);
|
||||
size_t ch_len = mbrlen(&str[i], 4, NULL);
|
||||
size_t ch_len = mbrlen(&str[i], MB_CUR_MAX, NULL);
|
||||
i += ch_len;
|
||||
col++;
|
||||
if (g_unichar_iswide(uni)) {
|
||||
|
Loading…
Reference in New Issue
Block a user