Skip to content

Commit

Permalink
fix: rare cases when indent guide final line was not included to brac…
Browse files Browse the repository at this point in the history
…keted block
  • Loading branch information
mkslanc committed Sep 24, 2024
1 parent 80a8379 commit 6a4cdac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/layer/text.js
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ class Text {
var ranges = this.session.$bracketHighlight.ranges;
for (var i = 0; i < ranges.length; i++) {
if (cursor.row !== ranges[i].start.row) {
this.$highlightIndentGuideMarker.end = ranges[i].start.row;
this.$highlightIndentGuideMarker.end = ranges[i].start.row + 1;
if (cursor.row > ranges[i].start.row) {
this.$highlightIndentGuideMarker.dir = -1;
}
Expand Down Expand Up @@ -558,7 +558,7 @@ class Text {
for (var i = cells.length - 1; i >= 0; i--) {
var cell = cells[i];
if (this.$highlightIndentGuideMarker.end && cell.row < this.$highlightIndentGuideMarker.start) {
if (cell.row <= this.$highlightIndentGuideMarker.end) break;
if (cell.row < this.$highlightIndentGuideMarker.end) break;

Check warning on line 561 in src/layer/text.js

View check run for this annotation

Codecov / codecov/patch

src/layer/text.js#L561

Added line #L561 was not covered by tests
this.$setIndentGuideActive(cell, indentLevel);
}
}
Expand Down

0 comments on commit 6a4cdac

Please sign in to comment.