New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Copy/paste from custom titlebar doesn't work in markdown previews #105603
Comments
Issue persists after update to July 2020 (version 1.48) |
Looked at it more, I think I understand the issue now. There's a problem with how it treats window focus. If the selected text is blue (using default coloring scheme), I can copy it using Ctrl+C . However, if the selected text is grey (using default coloring scheme), I can not copy it. Both are used as selection colors, but "Blue" is more focused than "Grey" The big plot twist: Clicking anywhere in the context menu changes your selection from "Blue" to "Grey" |
Only happens to me when using the custom title bar (which is the default on Windows) |
This seems correct behavior when doubleClickToSwitchToEditor setting is on.
A related bugThe cursor jumps into wrong line in the source markdown file when you click a word at the end of the long long sentence. For example, double clicking the last word of the sentence in the gif animation clandrew posted, will move the cursor to the line 4 of the markdown file. This is because
I think this bug can be solved by simply calculating the nearest line of clicked position with function like export function getNearestEditorLineNumberOfPageOffset(offset: number): number {
const { previous, next } = getLineElementsAtPageOffset(offset);
if (!next) {
return previous.line;
}
const previousBounds = getElementBounds(previous);
const previousBottom = previousBounds.top + previousBounds.height + window.scrollY;
const nextTop = getElementBounds(next).top + window.scrollY;
if ((offset - previousBottom) <= (nextTop - offset)) {
return previous.line;
} else {
return next.line;
}
} Is it OK to make a PR to fix this? |
@turara I have that setting turned on but still repro the problem (selecting text in Preview then clicking Edit->Copy causes only a blank line to be copied) |
@clandrew Hmm. On my macOS, clicking Edit menu dose not steal focus 🤔 I think if you have that setting turned off, at least the following problem is solved.
|
@turara Ok yeah that's interesting if true, could help narrow things down. |
Also seeing this issue. MacOS: 11.1 |
Still broken on 1.56.2 I renamed this bug to better reflect what was going on. The work-around suggested by turara concerns a different problem I mentioned in passing which is unrelated to the bug. |
still broken (1.58.2) |
Issue Type: Bug
Expected: text from VSCode appears
Actual: Only a blank space is pasted
VS Code version: Code 1.47.3 (91899dc, 2020-07-23T13:12:49.994Z)
OS version: Windows_NT x64 10.0.20185
The text was updated successfully, but these errors were encountered: