提交 b24bbdf6 编写于 作者: D Daniel Imms

Have terminal runSelectedText run current line with no selection

Fixes #19863
Related #19375
上级 de28ea63
...@@ -202,7 +202,7 @@ export class RunSelectedTextInTerminalAction extends Action { ...@@ -202,7 +202,7 @@ export class RunSelectedTextInTerminalAction extends Action {
let selection = editor.getSelection(); let selection = editor.getSelection();
let text: string; let text: string;
if (selection.isEmpty()) { if (selection.isEmpty()) {
text = editor.getValue(); text = editor.getModel().getLineContent(selection.selectionStartLineNumber).trim();
} else { } else {
let endOfLinePreference = os.EOL === '\n' ? EndOfLinePreference.LF : EndOfLinePreference.CRLF; let endOfLinePreference = os.EOL === '\n' ? EndOfLinePreference.LF : EndOfLinePreference.CRLF;
text = editor.getModel().getValueInRange(selection, endOfLinePreference); text = editor.getModel().getValueInRange(selection, endOfLinePreference);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册