Merge pull request #2940 from FriedCaper/dont-send-while-editing

Keyboard shortcut related fixes
This commit is contained in:
Cohee 2024-10-04 01:27:17 +03:00 committed by GitHub
commit ac8a381501
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 0 deletions

View File

@ -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());

View File

@ -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) {