mirror of
https://github.com/Tha14/toxic.git
synced 2025-06-28 12:26:46 +02:00
Enable multiline input
Adds a nonl() call to avoid translation from \r to \n when pressing enter. C-J -> \n Enter -> \r To allow multiline input, \n chars (e.g. when pressing C-J) are replaced with a pilcrow. After hitting enter, every pilcrow is substituted with \n again.
This commit is contained in:
@ -42,9 +42,12 @@ void input_new_char(ToxWindow *self, wint_t key, int x, int y, int mx_x, int mx_
|
||||
{
|
||||
ChatContext *ctx = self->chatwin;
|
||||
|
||||
/* this is the only place we need to do this check */
|
||||
if (key == '\n')
|
||||
key = L'¶';
|
||||
|
||||
int cur_len = wcwidth(key);
|
||||
|
||||
/* this is the only place we need to do this check */
|
||||
if (cur_len == -1) {
|
||||
sound_notify(self, notif_error, 0, NULL);
|
||||
return;
|
||||
|
Reference in New Issue
Block a user