1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

TextEditor: Avoid starting timer unnecessarily when setting text

This commit is contained in:
reuk 2021-02-16 11:55:39 +00:00
parent 240089bcbc
commit 46d24cc1ab
No known key found for this signature in database
GPG key ID: 9ADCD339CFC98A11

View file

@ -1328,7 +1328,10 @@ void TextEditor::moveCaret (int newCaretPos)
if (newCaretPos != getCaretPosition())
{
caretPosition = newCaretPos;
textHolder->restartTimer();
if (hasKeyboardFocus (false))
textHolder->restartTimer();
scrollToMakeSureCursorIsVisible();
updateCaretPosition();
}