Merge pull request #2940 from FriedCaper/dont-send-while-editing Keyboard shortcut related fixes
Signed| @@ -1885,6 +1885,7 @@ export async function reloadCurrentChat() { | ||
| 1885 | 1885 | export async function sendTextareaMessage() { |
| 1886 | 1886 | if (is_send_press) return; |
| 1887 | 1887 | if (isExecutingCommandsFromChatInput) return; |
| 1888 | + if (this_edit_mes_id) return; // don't proceed if editing a message | |
| 1888 | 1889 | |
| 1889 | 1890 | let generateType; |
| 1890 | 1891 | // "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 () { | ||
| 10002 | 10003 | } |
| 10003 | 10004 | |
| 10004 | 10005 | else if (id == 'option_continue') { |
| 10006 | + if (this_edit_mes_id) return; // don't proceed if editing a message | |
| 10007 | + | |
| 10005 | 10008 | if (is_send_press == false || fromSlashCommand) { |
| 10006 | 10009 | is_send_press = true; |
| 10007 | 10010 | Generate('continue', buildOrFillAdditionalArgs()); |
| @@ -1027,6 +1027,7 @@ export function initRossMods() { | ||
| 1027 | 1027 | const editMesDone = $('.mes_edit_done:visible'); |
| 1028 | 1028 | if (editMesDone.length > 0) { |
| 1029 | 1029 | console.debug('Accepting edits with Ctrl+Enter'); |
| 1030 | + $('#send_textarea').focus(); | |
| 1030 | 1031 | editMesDone.trigger('click'); |
| 1031 | 1032 | return; |
| 1032 | 1033 | } else if (is_send_press == false) { |