mirror of
https://github.com/Tha14/toxic.git
synced 2025-07-02 09:16:44 +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:
@ -189,6 +189,9 @@ static void prompt_onKey(ToxWindow *self, Tox *m, wint_t key, bool ltr)
|
||||
if (x2 <= 0 || y2 <= 0)
|
||||
return;
|
||||
|
||||
if (ctx->pastemode && key == '\r')
|
||||
key = '\n';
|
||||
|
||||
/* ignore non-menu related input if active */
|
||||
if (self->help->active) {
|
||||
help_onKey(self, key);
|
||||
|
Reference in New Issue
Block a user