Skip to content

Commit

Permalink
stop blink timer when a selection is done
Browse files Browse the repository at this point in the history
  • Loading branch information
scheffle committed Dec 27, 2023
1 parent ad5f251 commit 09c1ea0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions vstgui/lib/ctexteditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -915,7 +915,7 @@ void TextEditorView::toggleCursorVisibility ()
//------------------------------------------------------------------------
void TextEditorView::restartBlinkTimer ()
{
if (style->cursorBlinkTime)
if (style->cursorBlinkTime && editState.select_start == editState.select_end)
{
removeAnimation ("CursorAlphaBlend");
cursorIsVisible = true;
Expand All @@ -940,7 +940,6 @@ void TextEditorView::onKeyboardEvent (KeyboardEvent& event)
{
if (getFrame ()->getFocusView () == this)
{
cursorIsVisible = true;
restartBlinkTimer ();
}
}
Expand Down Expand Up @@ -1071,6 +1070,7 @@ void TextEditorView::onMouseUpEvent (MouseUpEvent& event)
{
if (!mouseIsDown)
return;
restartBlinkTimer ();
event.consumed = true;
mouseIsDown = false;
}
Expand Down Expand Up @@ -1496,6 +1496,11 @@ void TextEditorView::onSelectionChanged (Range newSel, bool forceInvalidation)
}
if (lineNumberView)
lineNumberView->setSelectedLines (newSelectedLines);
if (selectedLines.length > 0)
{
blinkTimer = nullptr;
cursorIsVisible = false;
}
}

//------------------------------------------------------------------------
Expand Down

0 comments on commit 09c1ea0

Please sign in to comment.