]> git.lyx.org Git - features.git/commitdiff
Fix iterator in InsetInclude to be as it was previously.
authorRichard Kimberly Heck <rikiheck@lyx.org>
Fri, 13 Nov 2020 00:58:30 +0000 (19:58 -0500)
committerRichard Kimberly Heck <rikiheck@lyx.org>
Fri, 13 Nov 2020 01:07:18 +0000 (20:07 -0500)
src/insets/InsetInclude.cpp

index eff6fb5bf6ddf77ff495aa1408d3f3eb91beee00..79ecaec639df151c7811d7c62e525da7dcedda9e 100644 (file)
@@ -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);
+       }
 }