From 6fc8588a8fb65b782d5ec306195009ad9fa333b0 Mon Sep 17 00:00:00 2001 From: FriedCaper Date: Thu, 3 Oct 2024 17:03:58 -0300 Subject: [PATCH 1/2] On ctrl-enter when editing, focus text input --- public/scripts/RossAscends-mods.js | 1 + 1 file changed, 1 insertion(+) diff --git a/public/scripts/RossAscends-mods.js b/public/scripts/RossAscends-mods.js index 1a9e2d7d2..dc4d07238 100644 --- a/public/scripts/RossAscends-mods.js +++ b/public/scripts/RossAscends-mods.js @@ -1027,6 +1027,7 @@ export function initRossMods() { const editMesDone = $('.mes_edit_done:visible'); if (editMesDone.length > 0) { console.debug('Accepting edits with Ctrl+Enter'); + $('#send_textarea').focus(); editMesDone.trigger('click'); return; } else if (is_send_press == false) { From 1b3db273891c1ba8c781d2f691ad2e41937ca2aa Mon Sep 17 00:00:00 2001 From: FriedCaper Date: Thu, 3 Oct 2024 18:48:11 -0300 Subject: [PATCH 2/2] Abort Send and Continue while editing a message --- public/script.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/public/script.js b/public/script.js index 1fd4092c6..0076269a0 100644 --- a/public/script.js +++ b/public/script.js @@ -1885,6 +1885,7 @@ export async function reloadCurrentChat() { export async function sendTextareaMessage() { if (is_send_press) return; if (isExecutingCommandsFromChatInput) return; + if (this_edit_mes_id) return; // don't proceed if editing a message let generateType; // "Continue on send" is activated when the user hits "send" (or presses enter) on an empty chat box, and the last @@ -10002,6 +10003,8 @@ jQuery(async function () { } else if (id == 'option_continue') { + if (this_edit_mes_id) return; // don't proceed if editing a message + if (is_send_press == false || fromSlashCommand) { is_send_press = true; Generate('continue', buildOrFillAdditionalArgs());