Code change:
Issue Type: <bBug</bthe editor language to C++ to to /paste the Sample code below the editor window so that it is narrower than the line of code provided that the horizontal bracket underline stops at the end of the first line, when the (soft-wrapped) line break occurs. to that the horizontal bracket underline now continues onto the wrapped second line. VS Code version: Code 1.67.0 (, 2022-05-04T12:08:42.978Z) OS version: Linux x64 5.17.4-200.fc35.x8664 Restricted Mode: No <details<summarySystem Info</summary </detailsExtensions: none <!-- generated by issue reporter --
! !
Update: Note that this only occurs if the wrapped line starts in the left-most column. Indented, wrapped lines are not affected, regardless of setting.
Thanks for reporting this! I think it shouldn't be too hard to fix. If you like, we'd be happy for a PR that fixes this!
Hi, I found the snippet that produces the bug: The if statement controls if the first character of the wrapped line is in column 0. If so, then it ignores the guides for that line. By simply removing the if statement the result is the following: ! It seems that this solves the bug. Given my limited knowledge of the codebase, before opening a pull request, it would be better to clarify the purpose of the if statement as it is not fully clear to me. Should it suppress possible vertical bracket guides in case of wrapped lines? Was it to address a specific bug?
I don't know anymore. Since unfortunately I didn't link that comment against any issue nor git blame helps here, lets just remove it and see if someone complains.
I think I've solved it. You the comment in ("Implement line scopes."), which was a month before the implementation of horizontal guides (in ). So, at the time, it made sense, but horizontal guides invalidated the logic the check was based on.
(Oh, and nice find, Thanks for finding and fixing this.)

Related discussion:
text: ); for (const viewLineInfo of group.viewLines) { <del> if (viewLineInfo.isWrappedLineContinuation && this.getMinColumnOfViewLine(viewLineInfo) === 1) { // Don't add indent guides when the wrapped line continuation has no wrapping-indentation. resultPerViewLine.push([]); } else { const bracketGuides = bracketGuidesPerModelLine[viewLineInfo.modelLineNumber - modelRangeStartLineNumber]; // 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.forWrappedLinesAfterColumn !== -1) { const p = this.modelLineProjections[viewLineInfo.modelLineNumber - 1].getViewPositionOfModelPosition(0, g.forWrappedLinesAfterColumn); if (p.lineNumber >= viewLineInfo.modelLineWrappedLineIdx) { return undefined; } } if (g.forWrappedLinesBeforeOrAtColumn !== -1) { const p = this.modelLineProjections[viewLineInfo.modelLineNumber - 1].getViewPositionOfModelPosition(0, g.forWrappedLinesBeforeOrAtColumn); if (p.lineNumber < viewLineInfo.modelLineWrappedLineIdx) { return undefined; } } </del> <ins> const bracketGuides = bracketGuidesPerModelLine[viewLineInfo.modelLineNumber - modelRangeStartLineNumber]; </ins> <del> if (!g.horizontalLine) { return g; </del> <ins> // 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.forWrappedLinesAfterColumn !== -1) { const p = this.modelLineProjections[viewLineInfo.modelLineNumber - 1].getViewPositionOfModelPosition(0, g.forWrappedLinesAfterColumn); if (p.lineNumber >= viewLineInfo.modelLineWrappedLineIdx) { return undefined; </ins> } <ins> } </ins> <del> let column = -1; if (g.column !== -1) { const p = this.modelLineProjections[viewLineInfo.modelLineNumber - 1].getViewPositionOfModelPosition(0, g.column); if (p.lineNumber === viewLineInfo.modelLineWrappedLineIdx) { column = p.column; } else if (p.lineNumber < viewLineInfo.modelLineWrappedLineIdx) { column = this.getMinColumnOfViewLine(viewLineInfo); } else if (p.lineNumber > viewLineInfo.modelLineWrappedLineIdx) { return undefined; } </del> <ins> if (g.forWrappedLinesBeforeOrAtColumn !== -1) { const p = this.modelLineProjections[viewLineInfo.modelLineNumber - 1].getViewPositionOfModelPosition(0, g.forWrappedLinesBeforeOrAtColumn); if (p.lineNumber < viewLineInfo.modelLineWrappedLineIdx) { return undefined; </ins> } <ins> } if (!g.horizontalLine) { return g; } </ins> <del> const viewPosition = this.convertModelPositionToViewPosition(viewLineInfo.modelLineNumber, g.horizontalLine.endColumn); const p = this.modelLineProjections[viewLineInfo.modelLineNumber - 1].getViewPositionOfModelPosition(0, g.horizontalLine.endColumn); </del> <ins> let column = -1; if (g.column !== -1) { const p = this.modelLineProjections[viewLineInfo.modelLineNumber - 1].getViewPositionOfModelPosition(0, g.column); </ins> if (p.lineNumber === viewLineInfo.modelLineWrappedLineIdx) { <del> return new IndentGuide(g.visibleColumn, column, g.className, new IndentGuideHorizontalLine(g.horizontalLine.top, viewPosition.column), - 1, -1, ); </del> <ins> column = p.column; </ins> } else if (p.lineNumber < viewLineInfo.modelLineWrappedLineIdx) { <ins> column = this.getMinColumnOfViewLine(viewLineInfo); } else if (p.lineNumber > viewLineInfo.modelLineWrappedLineIdx) { </ins> return undefined; <del> } else { if (g.visibleColumn !== -1) { // Don't repeat horizontal lines that use visibleColumn for unrelated lines. return undefined; } return new IndentGuide(g.visibleColumn, column, g.className, new IndentGuideHorizontalLine(g.horizontalLine.top, this.getMaxColumnOfViewLine(viewLineInfo) ), -1, -1, ); </del> } <del> }); resultPerViewLine.push(result.filter((r): r is IndentGuide => !!r)); } </del> <ins> } const viewPosition = this.convertModelPositionToViewPosition(viewLineInfo.modelLineNumber, g.horizontalLine.endColumn); const p = this.modelLineProjections[viewLineInfo.modelLineNumber - 1].getViewPositionOfModelPosition(0, g.horizontalLine.endColumn); if (p.lineNumber === viewLineInfo.modelLineWrappedLineIdx) { return new IndentGuide(g.visibleColumn, column, g.className, new IndentGuideHorizontalLine(g.horizontalLine.top, viewPosition.column), - 1, -1, ); } else if (p.lineNumber < viewLineInfo.modelLineWrappedLineIdx) { return undefined; } else { if (g.visibleColumn !== -1) { // Don't repeat horizontal lines that use visibleColumn for unrelated lines. return undefined; } return new IndentGuide(g.visibleColumn, column, g.className, new IndentGuideHorizontalLine(g.horizontalLine.top, this.getMaxColumnOfViewLine(viewLineInfo) ), -1, -1, ); } }); resultPerViewLine.push(result.filter((r): r is IndentGuide => !!r)); </ins> } }