mirror of
https://github.com/profanity-im/profanity.git
synced 2024-11-03 19:37:16 -05:00
Changed replace input to handle wide chars
This commit is contained in:
parent
439e6486db
commit
73cdcb87ef
@ -181,14 +181,17 @@ inp_get_char(char *input, int *size)
|
|||||||
|
|
||||||
// otherwise just append
|
// otherwise just append
|
||||||
} else {
|
} else {
|
||||||
cchar_t t = { 0, { ch, 0 } };
|
//cchar_t t = { 0, { ch, 0 } };
|
||||||
wadd_wch(inp_win, &t);
|
//wadd_wch(inp_win, &t);
|
||||||
char bytes[5];
|
char bytes[5];
|
||||||
size_t utf_len = wcrtomb(bytes, ch, NULL);
|
size_t utf_len = wcrtomb(bytes, ch, NULL);
|
||||||
int i;
|
int i;
|
||||||
for (i = 0 ; i < utf_len; i++) {
|
for (i = 0 ; i < utf_len; i++) {
|
||||||
input[(*size)++] = bytes[i];
|
input[(*size)++] = bytes[i];
|
||||||
}
|
}
|
||||||
|
input[*size] = '\0';
|
||||||
|
inp_clear();
|
||||||
|
wprintw(inp_win, input);
|
||||||
|
|
||||||
display_size++;
|
display_size++;
|
||||||
|
|
||||||
@ -247,8 +250,8 @@ inp_replace_input(char *input, const char * const new_input, int *size)
|
|||||||
strcpy(input, new_input);
|
strcpy(input, new_input);
|
||||||
*size = strlen(input);
|
*size = strlen(input);
|
||||||
inp_clear();
|
inp_clear();
|
||||||
for (i = 0; i < *size; i++)
|
input[*size] = '\0';
|
||||||
waddch(inp_win, input[i]);
|
wprintw(inp_win, input);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user