Hi,
the bug report is simple: If you run CAS on a display equation it gets
changed to a eqnarray. The fix is also simple: There is explicit code
that performs this operation, and if you remove it, everything is fine
(patch attached).
I have no idea why one would want this surprising type change. I could
trace the code through several refactorings back to this monster commit
with a not very helpful commit log:
https://codeberg.org/LyX-org/lyx/commit/f1c24d100985c6df2eb5ec390017b69c78fe49c7
but then I lost track.
I suggest to apply the patch to master and 2.5.x. Any objections?
Georg
diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp
index 5d8e3b4abd..b7c5749f53 100644
--- a/src/mathed/InsetMathHull.cpp
+++ b/src/mathed/InsetMathHull.cpp
@@ -1887,7 +1887,7 @@ void InsetMathHull::doExtern(Cursor & cur, FuncRequest & func)
cur.idx() -= cur.idx() % ncols();
cur.pos() = 0;
- if (getType() == hullSimple) {
+ if (getType() == hullSimple || getType() == hullEquation) {
size_type pos = cur.cell().find_last(eq);
MathData md(buffer_);
if (pos == cur.cell().size()) {
@@ -1895,7 +1895,7 @@ void InsetMathHull::doExtern(Cursor & cur, FuncRequest & func)
lyxerr << "use whole cell: " << md << endl;
} else {
md = MathData(buffer_, cur.cell().begin() + pos + 1, cur.cell().end());
- lyxerr << "use partial cell form pos: " << pos << endl;
+ lyxerr << "use partial cell from pos: " << pos << endl;
}
cur.cell().append(eq);
cur.cell().append(pipeThroughExtern(lang, extra, md));
@@ -1903,20 +1903,6 @@ void InsetMathHull::doExtern(Cursor & cur, FuncRequest & func)
return;
}
- if (getType() == hullEquation) {
- lyxerr << "use equation inset" << endl;
- mutate(hullEqnArray);
- MathData & md = cur.cell();
- lyxerr << "use cell: " << md << endl;
- ++cur.idx();
- cur.cell() = eq;
- ++cur.idx();
- cur.cell() = pipeThroughExtern(lang, extra, md);
- // move to end of line
- cur.pos() = cur.lastpos();
- return;
- }
-
{
lyxerr << "use eqnarray" << endl;
cur.idx() += 2 - cur.idx() % ncols();
--
lyx-devel mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-devel