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