]> git.lyx.org Git - features.git/commitdiff
Fixup 7f1b1729: restore lazy caret handling
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 3 May 2023 10:55:44 +0000 (12:55 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 11 May 2023 08:13:27 +0000 (10:13 +0200)
For some reason, the code that should have been put in
updateCaretGeometry() went to resetCaret(). I do not see how that made
sense.

I am not totally sure what the consequences of the patch are, though.
It just "looks right".

src/frontends/qt/GuiWorkArea.cpp

index d634f8389464b97320f76f1ab7c16f1b4626310d..f6e3c723dfdee2e78597be93177bfab111aabf1f 100644 (file)
@@ -479,15 +479,6 @@ void GuiWorkArea::Private::resetCaret()
        if (!buffer_view_->caretInView() || !p->hasFocus())
                return;
 
-       // completion indicator
-       Cursor const & cur = buffer_view_->cursor();
-       bool const completable = cur.inset().showCompletionCursor()
-               && completer_->completionAvailable()
-               && !completer_->popupVisible()
-               && !completer_->inlineVisible();
-
-       buffer_view_->buildCaretGeometry(completable);
-
        needs_caret_geometry_update_ = true;
        caret_visible_ = true;
 }
@@ -500,6 +491,14 @@ void GuiWorkArea::Private::updateCaretGeometry()
        if (buffer_view_->busy() || !buffer_view_->caretInView())
                return;
 
+       // completion indicator
+       Cursor const & cur = buffer_view_->cursor();
+       bool const completable = cur.inset().showCompletionCursor()
+               && completer_->completionAvailable()
+               && !completer_->popupVisible()
+               && !completer_->inlineVisible();
+
+       buffer_view_->buildCaretGeometry(completable);
 
        needs_caret_geometry_update_ = false;
 }