Describe the bug
- As per the need the
docFromDisplay() method from DisplayLineMap class return 0 based doc line from the 0 based input display line. But there is bug on handling the out of bound display line in the docFromDisplay() method.
- Whenever we pass any out of bound display line to the function which is
>= totalDisplayLine it returns logicalSize-1 where logicalSize is total active lines currently handled by DisplayLineMap class. But the problem is for this to be true the last line should be visible, otherwise it returns false answer.
- Take
displayHeight = [1,1,0,0,0,1,1,1,0,0] as an example. Here logicalSize=10. When I want to compute docFromDisplay(90) then it will return 9 because 90>=totalDisplayLine (totalDisplayLine=5), but it should return the last visible line which is 7.
To Reproduce
This bug is theoretical and only produced through specific edge cases.
Environment (please complete the following information):
- OS: Windows 11
- Java: 21
- App version / commit SHA: 1.15.0
- Module/area:
editor-core
- Run mode: None
Describe the bug
docFromDisplay()method fromDisplayLineMapclass return 0 based doc line from the 0 based input display line. But there is bug on handling the out of bound display line in thedocFromDisplay()method.>= totalDisplayLineit returnslogicalSize-1wherelogicalSizeis total active lines currently handled byDisplayLineMapclass. But the problem is for this to be true the last line should be visible, otherwise it returns false answer.displayHeight = [1,1,0,0,0,1,1,1,0,0]as an example. HerelogicalSize=10. When I want to computedocFromDisplay(90)then it will return9because90>=totalDisplayLine(totalDisplayLine=5), but it should return the last visible line which is7.To Reproduce
This bug is theoretical and only produced through specific edge cases.
Environment (please complete the following information):
editor-core