]> git.lyx.org Git - features.git/commitdiff
Add ignoresep option to layout lfun
authorJuergen Spitzmueller <spitz@lyx.org>
Mon, 1 Jan 2018 11:31:31 +0000 (12:31 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Mon, 1 Jan 2018 11:31:31 +0000 (12:31 +0100)
This does not force the cursor in a separator paragraph to endpos.

This is needed for environment-split.

src/LyXAction.cpp
src/Text3.cpp

index 952602821e4ee65e2eb00fea6845511a66fafb76..e0d4e473d7ebb8f5fba653cfedb022af349270a9 100644 (file)
@@ -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 [<LAYOUT>]
+ * \li Syntax: paragraph-break [<LAYOUT>] [ignoresep]
  * \li Params: <LAYOUT>: "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 },
index 999b960fc4cbdbcad7041677eaa6ea919f0cc885..af244002d130665b0f2d057df6cd153066a4d89c 100644 (file)
@@ -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,