提交 41f3c97a 编写于 作者: A Alex Dima

Fixes #4121: Do not restore previous centered range if line count does not...

Fixes #4121: Do not restore previous centered range if line count does not change when changing tabSize
上级 81ea4e7c
......@@ -239,7 +239,12 @@ export class ViewModel extends EventEmitter implements editorCommon.IViewModel {
case editorCommon.EventType.ModelOptionsChanged:
// A tab size change causes a line mapping changed event => all view parts will repaint OK, no further event needed here
revealPreviousCenteredModelRange = this._onTabSizeChange(this.model.getOptions().tabSize) || revealPreviousCenteredModelRange;
let prevLineCount = this.lines.getOutputLineCount();
let tabSizeChanged = this._onTabSizeChange(this.model.getOptions().tabSize);
let newLineCount = this.lines.getOutputLineCount();
if (tabSizeChanged && prevLineCount !== newLineCount) {
revealPreviousCenteredModelRange = true;
}
break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册