Le 15/12/2015 14:58, Edwin Leuven a écrit :
On 12 Nov 2015, at 13:38, Jürgen Spitzmüller <sp...@lyx.org
<mailto:sp...@lyx.org>> wrote:
2015-11-12 10:43 GMT+01:00 Edwin Leuven:

    but even so, perhaps we should consider the behaviour that we have
    with itemize:

    <enter> preserves indent, and <enter> on an empty itemize
    decreases indent

    we could do the same with nesting no?

    i think that would be natural


I agree.

what about the attached?


depth.diff


diff --git a/src/Text.cpp b/src/Text.cpp
index 80babde..e1fd93e 100644
--- a/src/Text.cpp
+++ b/src/Text.cpp
@@ -781,7 +781,8 @@ void Text::breakParagraph(Cursor & cur, bool inverse_logic)
                cpar.eraseChar(cur.pos(), cur.buffer()->params().track_changes);

        // What should the layout for the new paragraph be?
-       bool keep_layout = layout.isEnvironment()
+       int const depth = cur.paragraph().params().depth();
+       bool keep_layout = layout.isEnvironment() || depth>0
                || (layout.isParagraph() && layout.parbreak_is_newline);
        if (inverse_logic)
                keep_layout = !keep_layout;


I gave it a test. Thanks, we definitely need something to solve these
issues with Beamer.

A few remaining issues (I don't know whether this relates to the patch
but it is along the same lines):

* The following now reintroduce themselves when pressing enter instead
of switching back to Standard: Frame Repeat, Frame Title, Frame Subtitle
Frame, Column, Pause, Title, Subtitle, Author, Insitute, Date, etc. In
fact, even headings do that as soon as they are nested.

* When inside a nested list *if this nesting represents a beamer frame*,
we would like that Enter, on an empty item, switches back to a nested
Standard paragraph, instead of decreasing the nesting.

In fact, it is as if a more appropriate feature to enclose a frame was a
custom inset, instead of a custom paragraph style with nesting. At the
very least it sounds like an issue that requires some more thinking and
some choices to make...


Guillaume


Reply via email to