提交 1b05b5e6 编写于 作者: I isidor

Allow output channel to stay in scroll position

fixes #3351
上级 2ff7a67c
......@@ -154,11 +154,14 @@ export class StringEditor extends BaseTextEditor {
/**
* Reveals the last line of this editor if it has a model set.
* If smart reveal is true will only reveal the last line if the line before last is visible #3351
*/
public revealLastLine(): void {
public revealLastLine(smartReveal = false): void {
let codeEditor = <ICodeEditor>this.getControl();
let model = codeEditor.getModel();
if (model) {
const lineBeforeLastRevealed = codeEditor.getScrollTop() + codeEditor.getLayoutInfo().height >= codeEditor.getScrollHeight();
if (model && (!smartReveal || lineBeforeLastRevealed)) {
let lastLine = model.getLineCount();
codeEditor.revealLine(lastLine);
}
......
......@@ -77,7 +77,7 @@ export class OutputEditorInput extends StringEditorInput {
this.bufferedOutput = '';
const panel = this.panelService.getActivePanel();
(<OutputPanel>panel).revealLastLine();
(<OutputPanel>panel).revealLastLine(true);
}
private onOutputReceived(e: IOutputEvent): void {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册