]> git.lyx.org Git - features.git/commitdiff
Fix cursor font after collapsing inset (#12830)
authorScott Kostyshak <skostysh@lyx.org>
Thu, 6 Jul 2023 12:40:12 +0000 (08:40 -0400)
committerScott Kostyshak <skostysh@lyx.org>
Thu, 6 Jul 2023 12:40:41 +0000 (08:40 -0400)
If the cursor is in an inset, and it is closed (e.g., with ctrl + i,
or inset-toggle), the cursor is moved outside of the inset, so the
font must be reset.

src/insets/InsetCollapsible.cpp

index e029671786a6c992dd84cff3fa7410036d36fb5e..56d8ce80875d1d4ca94adf626f5001ac5f6daf3d 100644 (file)
@@ -717,8 +717,11 @@ void InsetCollapsible::setStatus(Cursor & cur, CollapseStatus status)
 {
        status_ = status;
        setButtonLabel();
-       if (status_ == Collapsed)
+       if (status_ == Collapsed) {
                cur.leaveInset(*this);
+               // if cursor was inside the inset, it was now moved outside (#12830)
+               cur.setCurrentFont();
+       }
 }