mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-10 05:03:32 -05:00
Have terminal runSelectedText run current line with no selection
Fixes #19863 Related #19375
This commit is contained in:
@@ -202,7 +202,7 @@ export class RunSelectedTextInTerminalAction extends Action {
|
||||
let selection = editor.getSelection();
|
||||
let text: string;
|
||||
if (selection.isEmpty()) {
|
||||
text = editor.getValue();
|
||||
text = editor.getModel().getLineContent(selection.selectionStartLineNumber).trim();
|
||||
} else {
|
||||
let endOfLinePreference = os.EOL === '\n' ? EndOfLinePreference.LF : EndOfLinePreference.CRLF;
|
||||
text = editor.getModel().getValueInRange(selection, endOfLinePreference);
|
||||
|
||||
Reference in New Issue
Block a user