Skip to content

Commit 81ca3c2

Browse files
committed
replPaste polish
microsoft#100235
1 parent 921e66b commit 81ca3c2

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

  • src/vs/workbench/contrib/debug/browser

src/vs/workbench/contrib/debug/browser/repl.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,11 +606,17 @@ export class Repl extends ViewPane implements IHistoryNavigationWidget {
606606
await this.clipboardService.writeText(this.getVisibleContent());
607607
return Promise.resolve();
608608
}));
609-
actions.push(new Action('debug.replPaste', localize('paste', "Paste"), undefined, true, async () => {
609+
actions.push(new Action('debug.replPaste', localize('paste', "Paste"), undefined, this.debugService.state !== State.Inactive, async () => {
610610
const clipboardText = await this.clipboardService.readText();
611611
if (clipboardText) {
612612
this.replInput.setValue(this.replInput.getValue().concat(clipboardText));
613613
this.replInput.focus();
614+
const model = this.replInput.getModel();
615+
const lineNumber = model ? model.getLineCount() : 0;
616+
const column = model?.getLineMaxColumn(lineNumber);
617+
if (typeof lineNumber === 'number' && typeof column === 'number') {
618+
this.replInput.setPosition({ lineNumber, column });
619+
}
614620
}
615621
}));
616622
actions.push(new Separator());

0 commit comments

Comments
 (0)