Add ignoresep option to layout lfun

This does not force the cursor in a separator paragraph to endpos.

This is needed for environment-split.
This commit is contained in:
Juergen Spitzmueller 2018-01-01 12:31:31 +01:00
parent 12bd7352fd
commit 8ad7b0caea
2 changed files with 5 additions and 4 deletions

View File

@ -3049,10 +3049,11 @@ void LyXAction::init()
* \var lyx::FuncCode lyx::LFUN_PARAGRAPH_BREAK * \var lyx::FuncCode lyx::LFUN_PARAGRAPH_BREAK
* \li Action: Breaks the current paragraph at the current location. * \li Action: Breaks the current paragraph at the current location.
* \li Notion: Removes the selection. * \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 * \li Params: <LAYOUT>: "inverse" - decreases depth by one (or change layout
to default layout) when the cursor is at the end of 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 * \endvar
*/ */
{ LFUN_PARAGRAPH_BREAK, "paragraph-break", Noop, Edit }, { LFUN_PARAGRAPH_BREAK, "paragraph-break", Noop, Edit },

View File

@ -1129,9 +1129,9 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
Font const f(inherit_font, cur.current_font.language()); Font const f(inherit_font, cur.current_font.language());
pars_[cur.pit() - 1].resetFonts(f); pars_[cur.pit() - 1].resetFonts(f);
} else { } else {
if (par.isEnvSeparator(cur.pos())) if (par.isEnvSeparator(cur.pos()) && cmd.getArg(1) != "ignoresep")
cur.posForward(); cur.posForward();
breakParagraph(cur, cmd.argument() == "inverse"); breakParagraph(cur, cmd.getArg(0) == "inverse");
} }
cur.resetAnchor(); cur.resetAnchor();
// If we have a list and autoinsert item insets, // If we have a list and autoinsert item insets,