mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-10 10:17:11 +03:00
Fix ::longestScreenRow update for changes directly above longest line
Fixes #5716
This commit is contained in:
parent
622caee446
commit
5fdb3cde08
@ -666,16 +666,16 @@ describe "DisplayBuffer", ->
|
||||
|
||||
it "correctly updates the location of the longest screen line when changes occur", ->
|
||||
expect(displayBuffer.getLongestScreenRow()).toBe 6
|
||||
buffer.delete([[0, 0], [2, 0]])
|
||||
buffer.delete([[3, 0], [5, 0]])
|
||||
expect(displayBuffer.getLongestScreenRow()).toBe 4
|
||||
|
||||
buffer.delete([[4, 0], [5, 0]])
|
||||
expect(displayBuffer.getLongestScreenRow()).toBe 5
|
||||
expect(displayBuffer.getMaxLineLength()).toBe 56
|
||||
|
||||
expect(displayBuffer.getLongestScreenRow()).toBe 1
|
||||
expect(displayBuffer.getMaxLineLength()).toBe 62
|
||||
|
||||
buffer.delete([[2, 0], [4, 0]])
|
||||
expect(displayBuffer.getLongestScreenRow()).toBe 1
|
||||
expect(displayBuffer.getMaxLineLength()).toBe 62
|
||||
buffer.delete([[6, 0], [8, 0]])
|
||||
expect(displayBuffer.getLongestScreenRow()).toBe 5
|
||||
expect(displayBuffer.getMaxLineLength()).toBe 56
|
||||
|
||||
describe "::destroy()", ->
|
||||
it "unsubscribes all display buffer markers from their underlying buffer marker (regression)", ->
|
||||
|
@ -1189,7 +1189,7 @@ class DisplayBuffer extends Model
|
||||
maxLengthCandidatesStartRow = 0
|
||||
maxLengthCandidates = @screenLines
|
||||
else
|
||||
@longestScreenRow += screenDelta if endScreenRow < @longestScreenRow
|
||||
@longestScreenRow += screenDelta if endScreenRow <= @longestScreenRow
|
||||
maxLengthCandidatesStartRow = startScreenRow
|
||||
maxLengthCandidates = newScreenLines
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user