Have terminal runSelectedText run current line with no selection

Fixes #19863
Related #19375
This commit is contained in:
Daniel Imms
2017-02-03 16:49:06 -08:00
parent de28ea63ab
commit b24bbdf666

View File

@@ -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);