bobbylight / RSyntaxTextArea

A syntax highlighting, code folding text editor for Java Swing applications.
BSD 3-Clause "New" or "Revised" License
1.12k stars 259 forks source link

ErrorStrip mouse click => navigation issue #496

Closed DrDaleks closed 1 year ago

DrDaleks commented 1 year ago

Description Clicking in the error strip does not browse to the proper document location. The error strip should represent the full document, independently of its actual size in the viewport, but it seems the calculation back from error strip's mouse click position to document location is incorrect.

Steps to Reproduce Specific steps to reproduce the behavior:

  1. Fire up a TextEditorPane with an ErrorStrip on its side (right side in my case)
  2. Load a document that is larger than the current viewport
  3. Click on the error strip to navigate (preferably near the bottom to maximise the effect)

NB: this issue does not apply to markers.

Expected behavior Navigating to the proper location (bottom of error strip should show bottom of document)

Actual behavior The caret moves indeed but seems to remain close to the top of the document

Java version LibericaVM-17

Additional context This issue does not apply to markers and seems to be related to the calculation in ErrorStrip.yToLine(int) method

bobbylight commented 1 year ago

Fixed in linked PR #497. Thanks again!