From: Richard Kimberly Heck Date: Fri, 13 Nov 2020 00:58:30 +0000 (-0500) Subject: Fix iterator in InsetInclude to be as it was previously. X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=50f975f7db89dab2039aa3dd5373c55ba9d2c638;p=features.git Fix iterator in InsetInclude to be as it was previously. --- diff --git a/src/insets/InsetInclude.cpp b/src/insets/InsetInclude.cpp index eff6fb5bf6..79ecaec639 100644 --- a/src/insets/InsetInclude.cpp +++ b/src/insets/InsetInclude.cpp @@ -1405,8 +1405,15 @@ void InsetInclude::updateMacros(DocIterator const & us, DocIterator const & scop buffer().setMacroLock(); loadIfNeeded(); buffer().clearMacroLock(); - if (child_buffer_) - buffer().registerChild(child_buffer_, us, scope); + if (child_buffer_) { + // We want an iterator that just points at the location of this inset, + // whereas the one we were passed has us on top. + // At least, that is how the updateMacros code was before RKH modified + // it. That is not to say they quite understand why it was like that. + DocIterator it = us; + it.pop_back(); + buffer().registerChild(child_buffer_, it, scope); + } }