Jean-Marc Lasgouttes wrote:
Excellent idea :) However, about the implmentation:
any objections if i commit the attached, or am is missing something?
Index: src/Text.cpp
===================================================================
--- src/Text.cpp (revision 33067)
+++ 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()))