mirror of
https://github.com/microsoft/vscode.git
synced 2026-10-07 18:12:40 +01:00
Fixes bugs in bracket guides for wrapped lines.
This commit is contained in:
3 files changed
+7
-9
No files matched your search
@@ -416,7 +416,6 @@ export class GuidesTextModelPart extends TextModelPart implements IGuidesTextMod
|
||||
className,
|
||||
null,
|
||||
l === start.lineNumber ? start.column : -1,
|
||||
// TODO: Investigate if this is correct
|
||||
l === end.lineNumber ? end.column : -1
|
||||
)
|
||||
);
|
||||
|
||||
@@ -52,8 +52,11 @@ export class IndentGuide {
|
||||
* It starts at visibleColumn and continues until endColumn.
|
||||
*/
|
||||
public readonly horizontalLine: IndentGuideHorizontalLine | null,
|
||||
/**
|
||||
* If set (!= -1), only show this guide for wrapped lines that don't contain this model column, but are after it.
|
||||
*/
|
||||
public readonly forWrappedLinesAfterColumn: number | -1,
|
||||
public readonly forWrappedLinesBeforeColumn: number | -1
|
||||
public readonly forWrappedLinesBeforeOrAtColumn: number | -1
|
||||
) {
|
||||
if ((visibleColumn !== -1) === (column !== -1)) {
|
||||
throw new Error();
|
||||
|
||||
@@ -582,10 +582,6 @@ export class ViewModelLinesFromProjectedModel implements IViewModelLines {
|
||||
// visibleColumns stay as they are (this is a bug and needs to be fixed, but it is not a regression)
|
||||
// model-columns must be converted to view-model columns.
|
||||
const result = bracketGuides.map(g => {
|
||||
/*if (g.onlyForWrappedLines && !viewLineInfo.isWrappedLineContinuation) {
|
||||
return undefined;
|
||||
}*/
|
||||
|
||||
if (g.forWrappedLinesAfterColumn !== -1) {
|
||||
const p = this.modelLineProjections[viewLineInfo.modelLineNumber - 1].getViewPositionOfModelPosition(0, g.forWrappedLinesAfterColumn);
|
||||
if (p.lineNumber >= viewLineInfo.modelLineWrappedLineIdx) {
|
||||
@@ -593,9 +589,9 @@ export class ViewModelLinesFromProjectedModel implements IViewModelLines {
|
||||
}
|
||||
}
|
||||
|
||||
if (g.forWrappedLinesBeforeColumn !== -1) {
|
||||
const p = this.modelLineProjections[viewLineInfo.modelLineNumber - 1].getViewPositionOfModelPosition(0, g.forWrappedLinesBeforeColumn);
|
||||
if (p.lineNumber <= viewLineInfo.modelLineWrappedLineIdx) {
|
||||
if (g.forWrappedLinesBeforeOrAtColumn !== -1) {
|
||||
const p = this.modelLineProjections[viewLineInfo.modelLineNumber - 1].getViewPositionOfModelPosition(0, g.forWrappedLinesBeforeOrAtColumn);
|
||||
if (p.lineNumber < viewLineInfo.modelLineWrappedLineIdx) {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user