From 8ad7b0caead9f58b5ab40626af144adb3d059f01 Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Mon, 1 Jan 2018 12:31:31 +0100 Subject: [PATCH] Add ignoresep option to layout lfun This does not force the cursor in a separator paragraph to endpos. This is needed for environment-split. --- src/LyXAction.cpp | 5 +++-- src/Text3.cpp | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/LyXAction.cpp b/src/LyXAction.cpp index 952602821e..e0d4e473d7 100644 --- a/src/LyXAction.cpp +++ b/src/LyXAction.cpp @@ -3049,10 +3049,11 @@ void LyXAction::init() * \var lyx::FuncCode lyx::LFUN_PARAGRAPH_BREAK * \li Action: Breaks the current paragraph at the current location. * \li Notion: Removes the selection. - * \li Syntax: paragraph-break [] + * \li Syntax: paragraph-break [] [ignoresep] * \li Params: : "inverse" - decreases depth by one (or change layout to default layout) when the cursor is at the end of - the line. + the line.\n + ignoresep: Do not account for paragraph separators while breaking. * \endvar */ { LFUN_PARAGRAPH_BREAK, "paragraph-break", Noop, Edit }, diff --git a/src/Text3.cpp b/src/Text3.cpp index 999b960fc4..af244002d1 100644 --- a/src/Text3.cpp +++ b/src/Text3.cpp @@ -1129,9 +1129,9 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd) Font const f(inherit_font, cur.current_font.language()); pars_[cur.pit() - 1].resetFonts(f); } else { - if (par.isEnvSeparator(cur.pos())) + if (par.isEnvSeparator(cur.pos()) && cmd.getArg(1) != "ignoresep") cur.posForward(); - breakParagraph(cur, cmd.argument() == "inverse"); + breakParagraph(cur, cmd.getArg(0) == "inverse"); } cur.resetAnchor(); // If we have a list and autoinsert item insets, -- 2.39.5