Ctrl+C on blank empty line copies new line and overwrites clipboard
OS: Windows 10 Build#: 0.10.12-alpha Node: 4.1.1
As the title says, if you have already copied something and you Ctrl+C on a separate blank line, it will overwrite your clipboard and hold a newline character. Normally when you copy with the cursor not selecting anything on a new line, it will hold your previous copy.
This is by design. Ctrl+C without selection will place current line in clipboard. If you are on an empty line, it will place a newline character in clipboard.
Hi @alexandrudima , do you know if something has changed prior to 0.10.11 about it?
I had an extension Copy Word in Cursor that is meant to replace the Copy and Cut commands when there is no selection. It automatically selects the word where the cursor is, and copies/cuts to the clipboard, but I just noted that it is not working anymore :cry: . It detects and select the word, but when I call vscode.commands.executeCommand("editor.action.clipboardCopyAction");, it does not respect the new selection, and the whole line is copied to the clipboard strangely, if I use the clipboardCutAction command, it cuts the selected word, but the clipboard is filled with the entire line, again.
I don't know if the commands itself changed, or if I have to do something else after updating the selection. The code is basically:
const cursorWordRange = doc.getWordRangeAtPosition(selection.active);
var newSe = new vscode.Selection(cursorWordRange.start.line, cursorWordRange.start.character, cursorWordRange.end.line, cursorWordRange.end.character);
editor.selection = newSe;
vscode.commands.executeCommand("editor.action.clipboardCutAction");
Thanks for your help.
@alefragnani I've created #4393 to track the problem.