You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
Using RSTA 3.0.8, hyperlinks in Luyten were working properly. However, when updating to 3.1.0 (or even 3.2.0), using the same code, they are not working correctly anymore.
Steps to Reproduce
Specific steps to reproduce the behavior:
Add a LinkGenerator to a RSyntaxTextArea and enable hyperlinks
Click on a hyperlink
Expected behavior
The LinkGeneratorResult#execute function should be executed
Actual behavior
The LinkGeneratorResult#execute function is not executed in RSTA >=3.1.0
Java version
Tested with Java 8 and Java 17
Additional context
From what I can gather using some debugging code, RSyntaxTextArea#hoveredOverLinkOffset gets reset to -1 when the hyperlink is clicked, probably through RSyntaxTextArea#stopScanningForLinks (however I am not sure!).
Because of this, RSyntaxTextAreaMutableCaretEvent#mouseClicked will not fire the ACTIVATED event.
I am unsure if I am correct, but I think, this is what's going wrong there.
Relevant code can be found here: https://github.com/ThexXTURBOXx/Luyten/blob/main/src/main/java/us/deathmarine/luyten/OpenFile.java#L131
The text was updated successfully, but these errors were encountered:
Better late than never! Thanks @ThexXTURBOXx ! You hit the nail on the head. That code was lazily creating the HyperlinkEvent only if there were HyperlinkListeners registered, but that caused LinkGeneratorResults to not be executed. It wasn't taking into account the contract that they could handle click events themselves. The fix was simply to not lazily evaluate the LinkGeneratorResult.
Description
Using RSTA 3.0.8, hyperlinks in Luyten were working properly. However, when updating to 3.1.0 (or even 3.2.0), using the same code, they are not working correctly anymore.
Steps to Reproduce
Specific steps to reproduce the behavior:
LinkGenerator
to aRSyntaxTextArea
and enable hyperlinksExpected behavior
The
LinkGeneratorResult#execute
function should be executedActual behavior
The
LinkGeneratorResult#execute
function is not executed in RSTA >=3.1.0Java version
Tested with Java 8 and Java 17
Additional context
From what I can gather using some debugging code,
RSyntaxTextArea#hoveredOverLinkOffset
gets reset to-1
when the hyperlink is clicked, probably throughRSyntaxTextArea#stopScanningForLinks
(however I am not sure!).Because of this,
RSyntaxTextAreaMutableCaretEvent#mouseClicked
will not fire theACTIVATED
event.I am unsure if I am correct, but I think, this is what's going wrong there.
Relevant code can be found here: https://github.com/ThexXTURBOXx/Luyten/blob/main/src/main/java/us/deathmarine/luyten/OpenFile.java#L131
The text was updated successfully, but these errors were encountered: