[LyX/master] Fix cursor font after collapsing inset (#12830)
Scott Kostyshak
skostysh at lyx.org
Thu Jul 6 11:28:24 UTC 2023
commit c4cdff5de22c683df4423dbc0950191294381cd1
Author: Scott Kostyshak <skostysh at lyx.org>
Date: Thu Jul 6 08:40:12 2023 -0400
Fix cursor font after collapsing inset (#12830)
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 | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/src/insets/InsetCollapsible.cpp b/src/insets/InsetCollapsible.cpp
index e029671..56d8ce8 100644
--- a/src/insets/InsetCollapsible.cpp
+++ b/src/insets/InsetCollapsible.cpp
@@ -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();
+ }
}
More information about the lyx-cvs
mailing list