commit 873913cf02be6d075d17400464b56da009bec5c8
Author: Jean-Marc Lasgouttes <[email protected]>
Date: Mon Aug 31 13:09:00 2026 +0200
Prohibit completely entering in InsetInfo inset
Avoids a crash related to search and replace.
Original patch by Claude.
Fixes bug #12808.
(cherry picked from commit 1ab7d26394ed315fe94fb9a12692d963ca221a8d)
---
src/insets/InsetInfo.h | 8 +++-----
src/insets/InsetText.cpp | 6 ++++--
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/insets/InsetInfo.h b/src/insets/InsetInfo.h
index 5cfb7e51e0..184c4902eb 100644
--- a/src/insets/InsetInfo.h
+++ b/src/insets/InsetInfo.h
@@ -168,11 +168,9 @@ public:
docstring layoutName() const override;
///
Inset * editXY(Cursor & cur, int x, int y) override;
- /** FIXME: we would like to do that, but then InsetText::updateBuffer
breaks
- * on info insets. Do we need to run this method on InsetInfo contents?
- * Having a InsetInfo that hides an InsetText is really annoying,
actually.
- */
- ///bool isActive() const override { return false; }
+ /// The contents are generated by build() and may be replaced under
+ /// the cursor's feet at any time, so never let the cursor in (#12808).
+ bool isActive() const override { return false; }
///
bool editable() const override { return false; }
///
diff --git a/src/insets/InsetText.cpp b/src/insets/InsetText.cpp
index af3f71e25d..d8237b71f1 100644
--- a/src/insets/InsetText.cpp
+++ b/src/insets/InsetText.cpp
@@ -1129,9 +1129,11 @@ void InsetText::checkIntitleContext(ParIterator const &
it)
void InsetText::updateBuffer(ParIterator const & it, UpdateType utype, bool
const deleted)
{
+ LATTEST(it.nextInset() == this);
+ // Descend into this inset explicitly, because forwardPos() does
+ // not enter insets that are not active (e.g. InsetInfo).
ParIterator it2 = it;
- it2.forwardPos();
- LASSERT(&it2.inset() == this && it2.pit() == 0, return);
+ it2.push_back(CursorSlice(*this));
if (producesOutput()) {
InsetLayout const & il = getLayout();
bool const save_layouts = utype == OutputUpdate &&
il.htmlisblock();
--
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs