TextEditor::recreateCaret() issue

I suspect it has to do with this change…

I have a textEditor with a LookAndFeel which changes the cursor color… which used to work fine… But I just noticed that the cursor color isn’t changed… and TextEditor:: recreateCaret() isn’t triggered when you click on the Editor. drawTextEditorOutline() is called… but the call to my LookAndFeel createCaretComponent() never happens.



enablementChanged is called in response to setEnabled(), not when it gains/loses focus, which seems to be what you're talking about here. 

You probably want focusGained/focusLost() instead?

Sorry I revised my post to be more accurate…

The issue has to do with a change in behavior – so my LookAndFeel createCaretComponent() is never being called.


If I add a call to recreateCaret() in focusGained() it still doesn’t update the caret 'cause it isn’t == nullptr


Okay…. the fix is:

void TextEditor::lookAndFeelChanged()
    caret = nullptr;



Thanks, seems like a good idea, will add that!