]> git.lyx.org Git - features.git/commitdiff
Amend 891ba726
authorEnrico Forestieri <forenr@lyx.org>
Sun, 29 Jan 2023 17:30:50 +0000 (18:30 +0100)
committerEnrico Forestieri <forenr@lyx.org>
Sun, 29 Jan 2023 17:32:23 +0000 (18:32 +0100)
Avoid an assertion when the cursor is at the start of a math hull.

src/DocIterator.cpp

index 94b7792b9afa849d9b9cf8868d21414f4808f934..31a5bffcafe0f47630b2da56ce009df69c61b6ef 100644 (file)
@@ -549,7 +549,7 @@ void DocIterator::updateInsets(Inset * inset)
        size_t const n = slices_.size();
        slices_.resize(0);
        for (size_t i = 0 ; i < n; ++i) {
-               if (dit[i].empty() && prevMath().lyxCode() == MATH_SCRIPT_CODE)
+               if (dit[i].empty() && pos() > 0 && prevMath().lyxCode() == MATH_SCRIPT_CODE)
                        // Workaround: With empty optional argument and a trailing script,
                        // we have empty slices in math macro args (#11676)
                        // FIXME: Find real cause!