Skip to content

Commit 440da15

Browse files
Merge pull request #71 from ThisIs-Developer/copilot/fix-copy-shortcut-windows
[WIP] Fix copy keyboard shortcut issue in Windows app
2 parents 0a82ab9 + a59cf5c commit 440da15

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

desktop-app/resources/js/script.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1566,8 +1566,8 @@ This is a fully client-side application. Your content never leaves your browser
15661566
if (mode === 'split') {
15671567
// Restore preserved pane widths when entering split mode
15681568
applyPaneWidths();
1569-
} else if (previousMode === 'split') {
1570-
// Reset pane widths when leaving split mode
1569+
} else {
1570+
// Reset inline pane widths when not in split mode
15711571
resetPaneWidths();
15721572
}
15731573

@@ -2841,7 +2841,8 @@ This is a fully client-side application. Your content never leaves your browser
28412841
const activeEl = document.activeElement;
28422842
const isTextControl = activeEl && (activeEl.tagName === "TEXTAREA" || activeEl.tagName === "INPUT");
28432843
const hasSelection = window.getSelection && window.getSelection().toString().trim().length > 0;
2844-
if (!isTextControl && !hasSelection) {
2844+
const editorHasSelection = markdownEditor.selectionStart !== markdownEditor.selectionEnd;
2845+
if (!isTextControl && !hasSelection && !editorHasSelection) {
28452846
e.preventDefault();
28462847
copyMarkdownButton.click();
28472848
}

script.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2841,7 +2841,8 @@ This is a fully client-side application. Your content never leaves your browser
28412841
const activeEl = document.activeElement;
28422842
const isTextControl = activeEl && (activeEl.tagName === "TEXTAREA" || activeEl.tagName === "INPUT");
28432843
const hasSelection = window.getSelection && window.getSelection().toString().trim().length > 0;
2844-
if (!isTextControl && !hasSelection) {
2844+
const editorHasSelection = markdownEditor.selectionStart !== markdownEditor.selectionEnd;
2845+
if (!isTextControl && !hasSelection && !editorHasSelection) {
28452846
e.preventDefault();
28462847
copyMarkdownButton.click();
28472848
}

0 commit comments

Comments
 (0)