mirror of
https://github.com/Tha14/toxic.git
synced 2025-09-25 20:36:53 +02:00
Add paste-mode to allow multiline text pasting
Ctrl-T toggles paste mode. Useful when pasting multiline text because it avoids triggering an enter keypress after linebreaks. Instead, every \r is translated to \n which is again translated to a pilcrow (see previous commit). The pasted text can then be sent as a whole instead of splitting up in multiple messages.
This commit is contained in:
@@ -262,6 +262,10 @@ bool input_handle(ToxWindow *self, wint_t key, int x, int y, int mx_x, int mx_y)
|
||||
force_refresh(self->chatwin->history);
|
||||
break;
|
||||
|
||||
case T_KEY_C_T:
|
||||
self->chatwin->pastemode ^= 1;
|
||||
break;
|
||||
|
||||
default:
|
||||
match = false;
|
||||
break;
|
||||
@@ -278,6 +282,5 @@ bool input_handle(ToxWindow *self, wint_t key, int x, int y, int mx_x, int mx_y)
|
||||
match = true;
|
||||
}
|
||||
|
||||
|
||||
return match;
|
||||
}
|
||||
|
Reference in New Issue
Block a user