RSyntaxTextArea icon indicating copy to clipboard operation
RSyntaxTextArea copied to clipboard

I can't reliably set cursor for RSTA

Open dzmipt opened this issue 4 years ago • 2 comments

I change cursor for the component RSTA.setCursor(myCursor). However this would be overwritten with user CTRL + mouse move (a user wanted to click something while he/she was moving mouse).

I suspect the issue is around RSyntaxTextArea.mouseMove (line 3499).

Unless there is already solution, I believe we need a fix. What if we override setCursor, remember the cursor and replace c2 = Cursor.getPredefinedCursor(Cursor.TEXT_CURSOR) in the mouseMove with c2 = savedCursorInSetCursorMethod

dzmipt avatar Nov 16 '21 16:11 dzmipt

I found a workaround for me which works perfectly in my case textArea.setHyperlinksEnabled(false)

dzmipt avatar Nov 21 '21 16:11 dzmipt

Your suggestion seems like a good idea, but I tested it out and it results in some glitchy back-and-forth cursor changing between the "editable text' cursor and the default arrow/pointer cursor when testing with a text area with setEditable(false) set (which is another easy way to reproduce this issue of lost primary cursor). Might need a slightly more sophisticated fix.

bobbylight avatar Dec 02 '21 03:12 bobbylight