RSyntaxTextArea icon indicating copy to clipboard operation
RSyntaxTextArea copied to clipboard

The RSTA.markedOccurrencesChanged property is not fired when it should

Open DPovilas opened this issue 7 years ago • 2 comments
trafficstars

I have this kind of content with setMarkOccurrences(true); 1 When I put a cursor on one of lines "aaaaaaaaa", the same word is highligted in all content and RSTA.markedOccurrencesChanged property is fired. 2 Then, I put a cursor in an empty line, for example in line 13. After that, the highlight is removed from lines 1-5, but the property RSTA.markedOccurrencesChanged is not fired: 3

DPovilas avatar Sep 12 '18 06:09 DPovilas

@DPovilas, are you using SAS syntax highlighting here? This might be a quirk with that language. RSTA should preserve the marked occurrences last marked when you move the cursor to whitespace or an empty line, not remove the marked occurrences. That's why no event was fired.

As an aside, one or two folks have complained about that "feature" in the past, but I personally think it's nice that you can move the caret out of the way and preserve marked occurrences.

bobbylight avatar Sep 12 '18 18:09 bobbylight

@bobbylight, yes, I'm using SAS syntax. I had to make a change in the MarkOccurrencesSupport.java file and SAS syntax is not involved here. I've commented boolean occurrencesChanged = false; line and now the event always fires when the actionPerformed method is invoked. I don't know if it is efficient, but at least I get informed about actions in which marked occurencies are involved. I think this is the right way to go.

DPovilas avatar Sep 13 '18 05:09 DPovilas