Jean-Marc Lasgouttes wrote:
* it looks like the code should be put inside the code below (instead of the plain "return;").
i actually put it after recUndo to do this:
* make sure that undo is correctly handled (I do not know whether changeDepth does it)
?
Index: src/Text.cpp =================================================================== --- src/Text.cpp (revision 33055) +++ src/Text.cpp (working copy) @@ -668,12 +668,25 @@ // this is only allowed, if the current paragraph is not empty // or caption and if it has not the keepempty flag active if (cur.lastpos() == 0 && !cpar.allowEmpty() && - layout.labeltype != LABEL_SENSITIVE) + layout.labeltype != LABEL_SENSITIVE && + layout.labeltype == LABEL_ENUMERATE && + layout.labeltype == LABEL_ITEMIZE) return; // a layout change may affect also the following paragraph recUndo(cur, cur.pit(), undoSpan(cur.pit()) - 1); + if (cur.lastpos() == 0) { + if (changeDepthAllowed(cur, DEC_DEPTH)) { + changeDepth(cur, DEC_DEPTH); + return; + } else if (layout.labeltype == LABEL_ENUMERATE || + layout.labeltype == LABEL_ITEMIZE) { + setLayout(cur, tclass.defaultLayoutName()); + return; + } + } + // Always break behind a space // It is better to erase the space (Dekel) if (cur.pos() != cur.lastpos() && cpar.isLineSeparator(cur.pos()))