diff --git a/desktop-app/resources/js/script.js b/desktop-app/resources/js/script.js index ebafa41..476c336 100644 --- a/desktop-app/resources/js/script.js +++ b/desktop-app/resources/js/script.js @@ -1566,8 +1566,8 @@ This is a fully client-side application. Your content never leaves your browser if (mode === 'split') { // Restore preserved pane widths when entering split mode applyPaneWidths(); - } else if (previousMode === 'split') { - // Reset pane widths when leaving split mode + } else { + // Reset inline pane widths when not in split mode resetPaneWidths(); } @@ -2841,7 +2841,8 @@ This is a fully client-side application. Your content never leaves your browser const activeEl = document.activeElement; const isTextControl = activeEl && (activeEl.tagName === "TEXTAREA" || activeEl.tagName === "INPUT"); const hasSelection = window.getSelection && window.getSelection().toString().trim().length > 0; - if (!isTextControl && !hasSelection) { + const editorHasSelection = markdownEditor.selectionStart !== markdownEditor.selectionEnd; + if (!isTextControl && !hasSelection && !editorHasSelection) { e.preventDefault(); copyMarkdownButton.click(); } diff --git a/script.js b/script.js index c6370de..476c336 100644 --- a/script.js +++ b/script.js @@ -2841,7 +2841,8 @@ This is a fully client-side application. Your content never leaves your browser const activeEl = document.activeElement; const isTextControl = activeEl && (activeEl.tagName === "TEXTAREA" || activeEl.tagName === "INPUT"); const hasSelection = window.getSelection && window.getSelection().toString().trim().length > 0; - if (!isTextControl && !hasSelection) { + const editorHasSelection = markdownEditor.selectionStart !== markdownEditor.selectionEnd; + if (!isTextControl && !hasSelection && !editorHasSelection) { e.preventDefault(); copyMarkdownButton.click(); }