mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-09 23:44:24 +03:00
Fix foldBufferRow regression
This commit is contained in:
parent
09751855b5
commit
a4e011d3b8
@ -912,6 +912,20 @@ describe('TextMateLanguageMode', () => {
|
||||
}
|
||||
`)
|
||||
|
||||
range = languageMode.getFoldableRangeContainingPoint(Point(7, 0), 2)
|
||||
expect(simulateFold([range])).toBe(dedent `
|
||||
if (a) {
|
||||
b();
|
||||
if (c) {⋯
|
||||
}
|
||||
h()
|
||||
}
|
||||
i()
|
||||
if (j) {
|
||||
k()
|
||||
}
|
||||
`)
|
||||
|
||||
range = languageMode.getFoldableRangeContainingPoint(Point(1, Infinity), 2)
|
||||
expect(simulateFold([range])).toBe(dedent `
|
||||
if (a) {⋯
|
||||
|
@ -605,7 +605,7 @@ class TextMateLanguageMode {
|
||||
|
||||
for (let row = point.row - 1; row >= 0; row--) {
|
||||
const endRow = this.endRowForFoldAtRow(row, tabLength)
|
||||
if (endRow != null && endRow > point.row) {
|
||||
if (endRow != null && endRow >= point.row) {
|
||||
return Range(Point(row, Infinity), Point(endRow, Infinity))
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user