提交 90c0f84d 编写于 作者: A Alex Dima

Fixes #8952: When matching endLineNumber, find the outermost indent range

上级 22805adc
......@@ -509,7 +509,10 @@ export class TextModel extends OrderGuaranteeEventEmitter implements editorCommo
return 1 + Math.floor(rng.indent / this._options.tabSize);
}
if (rng.endLineNumber + 1 === lineNumber) {
return Math.ceil(rng.indent / this._options.tabSize);
if (i === 0 || indentRanges[i - 1].endLineNumber + 1 !== lineNumber) {
// For endLineNumber matches, we need to find the outermost indent range
return Math.ceil(rng.indent / this._options.tabSize);
}
}
}
......
......@@ -599,7 +599,7 @@ suite('TextModel.getLineIndentGuide', () => {
[1, ' A'],
[1, ' A'],
[2, ' A'],
[1, 'A'],
[0, 'A'],
]);
});
......@@ -697,4 +697,15 @@ suite('TextModel.getLineIndentGuide', () => {
[1, '\tindent1'],
]);
});
test('issue #8952 - Indentation guide lines going through text on .yml file', () => {
assertIndentGuides([
[0, 'properties:'],
[1, ' emailAddress:'],
[2, ' - bla'],
[2, ' - length:'],
[3, ' max: 255'],
[0, 'getters:'],
]);
});
});
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册