From: Jean-Marc Lasgouttes Date: Fri, 23 Jun 2017 18:32:32 +0000 (+0200) Subject: Fixup the fixup d0acc3e57044: use editable()/isActive() X-Git-Tag: 2.3.0beta1~215 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=13c3c1485b68980c51658cef8fadf804982d75ee;p=features.git Fixup the fixup d0acc3e57044: use editable()/isActive() While 522516d9 was too strong and broke mathed, d0acc3e57044 is too lenient and can accept insets (mathed/CommandInset, InsetInfo) that have a positive nargs() but are not editable (because they encapsulate something). Therefore the best solution for now is to use editable() in text and isActive() in mathed, until those two things are merged. Part of #10667. --- diff --git a/src/DocIterator.cpp b/src/DocIterator.cpp index fe1250ff33..ac57b34a0e 100644 --- a/src/DocIterator.cpp +++ b/src/DocIterator.cpp @@ -562,7 +562,9 @@ bool DocIterator::fixIfBroken() size_t n = slices_.size(); for (; i != n; ++i) { CursorSlice & cs = slices_[i]; - if (&cs.inset() != inset || cs.nargs() == 0) { + if (&cs.inset() != inset + || (cs.inset().inMathed() ? ! cs.inset().isActive() + : ! cs.inset().editable())) { // the whole slice is wrong, chop off this as well --i; LYXERR(Debug::DEBUG, "fixIfBroken(): inset changed");