[LyX/master] ctests: invert ru Shortcuts failures from varioref
commit 5fb3171eebc89700b518414c013ee57a1bb3eed8 Author: Scott Kostyshak Date: Thu Jan 7 17:36:44 2021 -0500 ctests: invert ru Shortcuts failures from varioref Consistent with ru Math and Additional. --- development/autotests/invertedTests |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/development/autotests/invertedTests b/development/autotests/invertedTests index b22d3ec..ee992c1 100644 --- a/development/autotests/invertedTests +++ b/development/autotests/invertedTests @@ -393,7 +393,7 @@ Sublabel: varioref # varioref is not working with XeTeX/LuaTeX for Russian, as it uses some # char macros which are not defined for these engines. export/doc/ru/UserGuide_(dvi3|pdf[45])_(system|tex)F -export/doc/ru/(Math|Additional)_(dvi3|pdf[45])_systemF +export/doc/ru/(Math|Additional|Shortcuts)_(dvi3|pdf[45])_systemF # -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX/master] Amend cf07d4825
commit 81413e77eee2e547e9715966a16c4c81a1c92a06 Author: Richard Kimberly Heck Date: Thu Jan 7 15:56:55 2021 -0500 Amend cf07d4825 --- src/insets/InsetRef.cpp |9 + 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/insets/InsetRef.cpp b/src/insets/InsetRef.cpp index cf24571..3e299d8 100644 --- a/src/insets/InsetRef.cpp +++ b/src/insets/InsetRef.cpp @@ -263,12 +263,13 @@ void InsetRef::latex(otexstream & os, OutputParams const & rp) const else if (cmd == "formatted") { docstring label; docstring prefix; - bool const use_caps = getParam("caps") == "true"; - bool const use_plural = getParam("plural") == "true"; + bool const use_caps = getParam("caps") == "true"; + bool const use_plural = getParam("plural") == "true"; + bool const use_refstyle = buffer().params().use_refstyle; docstring const fcmd = - getFormattedCmd(data, label, prefix, use_caps); + getFormattedCmd(data, label, prefix, use_refstyle, use_caps); os << fcmd; - if (buffer().params().use_refstyle && use_plural) + if (use_refstyle && use_plural) os << "[s]"; os << '{' << label << '}'; } -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX/master] Fix bug #8921
commit 6887bc5c1d53ead6f17f8c969f0fd174d4d745fe Author: Richard Kimberly Heck Date: Thu Jan 7 11:19:12 2021 -0500 Fix bug #8921 --- lib/layouts/paper.layout | 13 + 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/lib/layouts/paper.layout b/lib/layouts/paper.layout index ea970e4..7de415c 100644 --- a/lib/layouts/paper.layout +++ b/lib/layouts/paper.layout @@ -11,6 +11,19 @@ Sides 1 SecNumDepth 3 TocDepth3 +AddToPreamble + % Save and disable \example as this might clash + % with theorems + \let\origexample\example + \let\endorigexample\endexample + \let\example\relax + % If theorems hasn't been loaded, restore example + \AtBeginDocument{% + \@ifundefined{example}{\let\example\origexample}{} + } +EndPreamble + + Style Standard Category MainText MarginStatic -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX/2.3.6.2] configure.ac
commit a4d2112a81daf9316fc40b83af386a026224bf68 Author: Richard Kimberly Heck Date: Thu Jan 7 12:10:01 2021 -0500 configure.ac --- configure.ac |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index b73c0c1..12d6bd2 100644 --- a/configure.ac +++ b/configure.ac @@ -1,9 +1,9 @@ dnl Process with autoconf to generate configure script -*- sh -*- -AC_INIT(LyX,2.3.6.1,[lyx-de...@lists.lyx.org],[lyx]) +AC_INIT(LyX,2.3.6.2,[lyx-de...@lists.lyx.org],[lyx]) AC_PRESERVE_HELP_ORDER # Use ISO format only. The frontend needs to parse this -AC_SUBST(LYX_DATE, ["2020-12-29"]) +AC_SUBST(LYX_DATE, ["2021-01-07"]) AC_PREREQ(2.65) AC_CONFIG_SRCDIR(src/main.cpp) AC_CONFIG_HEADERS([config.h]) -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX/2.3.6.2] Use real path names for buffer lookup by name of temporary external files.
commit f7dfb8eb0c1dcd395247ad0bde72f52dabc69b69 Author: Stephan Witt Date: Sat Feb 22 12:11:42 2020 +0100 Use real path names for buffer lookup by name of temporary external files. In case of path names for external files containing symbolic links the real path and the logical path name may be different for the same file or directory. LyX is using QDir::tempPath() to create the path name of the temporary directory. The Qt implementation is free to return the logical or the real path name here and it happens to be different for various platforms and versions. The most stable and clean solution is to use the real path name consistently. (cherry picked from commit f2f861f017bd598c9e5b72f64e10587cbe1e3405) --- development/MacOSX/lyxeditor |4 +--- src/BufferList.cpp|3 ++- src/BufferList.h |5 +++-- src/frontends/qt4/GuiView.cpp | 16 +--- 4 files changed, 11 insertions(+), 17 deletions(-) diff --git a/development/MacOSX/lyxeditor b/development/MacOSX/lyxeditor index 7431b3b..ad8c407 100755 --- a/development/MacOSX/lyxeditor +++ b/development/MacOSX/lyxeditor @@ -82,9 +82,7 @@ test -z "${LYXPIPE}" && { } if [ -n "$LYXPIPE" -a -p "$LYXPIPE".in ]; then - file=$(echo "$1" | sed 's|^/private||') - - MAC_LYXPIPE_CONTENTS="LYXCMD:macdvix:server-goto-file-row:$file $2" + MAC_LYXPIPE_CONTENTS="LYXCMD:macdvix:server-goto-file-row:$1 $2" # echo "$MAC_LYXPIPE_CONTENTS" echo "$MAC_LYXPIPE_CONTENTS" > "${LYXPIPE}".in || { echo "Cannot write to lyxpipe." ; exit 2 ; } while read line ; do diff --git a/src/BufferList.cpp b/src/BufferList.cpp index 5e83c7b..f5b106d 100644 --- a/src/BufferList.cpp +++ b/src/BufferList.cpp @@ -331,11 +331,12 @@ Buffer * BufferList::getBuffer(support::FileName const & fname, bool internal) c } -Buffer * BufferList::getBufferFromTmp(string const & s) +Buffer * BufferList::getBufferFromTmp(string const & s, bool realpath) { BufferStorage::iterator it = bstore.begin(); BufferStorage::iterator end = bstore.end(); for (; it < end; ++it) { + string const temppath = realpath ? FileName((*it)->temppath()).realPath() : (*it)->temppath(); if (prefixIs(s, (*it)->temppath())) { // check whether the filename matches the master string const master_name = (*it)->latexName(); diff --git a/src/BufferList.h b/src/BufferList.h index ca55abe..8ccebf0 100644 --- a/src/BufferList.h +++ b/src/BufferList.h @@ -100,8 +100,9 @@ public: /// \return a pointer to the buffer with the given number Buffer * getBuffer(unsigned int); - /// \return a pointer to the buffer whose temppath matches the given path - Buffer * getBufferFromTmp(std::string const & path); + /// \return a pointer to the buffer whose temppath matches the given \p path + /// If optional \p realpath is \c true the lookup is done with real path names + Buffer * getBufferFromTmp(std::string const & path, bool realpath = false); /** returns a pointer to the buffer that follows argument in * buffer list. The buffer following the last in list is the diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 8d73c02..9ad0834 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -3493,7 +3493,7 @@ bool GuiView::goToFileRow(string const & argument) int row; size_t i = argument.find_last_of(' '); if (i != string::npos) { - file_name = os::internal_path(trim(argument.substr(0, i))); + file_name = os::internal_path(FileName(trim(argument.substr(0, i))).realPath()); istringstream is(argument.substr(i + 1)); is >> row; if (is.fail()) @@ -3504,20 +3504,14 @@ bool GuiView::goToFileRow(string const & argument) return false; } Buffer * buf = 0; - string const abstmp = package().temp_dir().absFileName(); string const realtmp = package().temp_dir().realPath(); // We have to use os::path_prefix_is() here, instead of // simply prefixIs(), because the file name comes from // an external application and may need case adjustment. - if (os::path_prefix_is(file_name, abstmp, os::CASE_ADJUSTED) - || os::path_prefix_is(file_name, realtmp, os::CASE_ADJUSTED)) { - // Needed by inverse dvi search. If it is a file - // in tmpdir, call the apropriated function. - // If tmpdir is a symlink, we may have the real - // path passed back, so we correct for that. - if (!prefixIs(file_name, abstmp)) - file_name = subst(file_name, realtmp, abstmp); - buf = theBufferList().getBufferFromTmp(file_name); + if
[LyX/master] FindAdv: Save found matches (e.g. \0, \1, \2, ...)
commit f2e49938f3901e34fe4f5c2bc525df0bb37e2340 Author: Kornel Benko Date: Thu Jan 7 17:04:27 2021 +0100 FindAdv: Save found matches (e.g. \0, \1, \2, ...) Only while debugging for now. Later we may use the saved values in replace string --- src/lyxfind.cpp | 85 -- 1 files changed, 38 insertions(+), 47 deletions(-) diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp index 1c8cdb3..4cfdf21 100644 --- a/src/lyxfind.cpp +++ b/src/lyxfind.cpp @@ -51,6 +51,8 @@ #include #include + +//#define ResultsDebug #define USE_QT_FOR_SEARCH #if defined(USE_QT_FOR_SEARCH) #include// sets QT_VERSION @@ -797,7 +799,7 @@ bool regex_replace(string const & s, string & t, string const & searchstr, return rv; } - +#if 0 /** Checks if supplied string segment is well-formed from the standpoint of matching open-closed braces. ** ** Verify that closed braces exactly match open braces. This avoids that, for example, @@ -851,7 +853,7 @@ bool braces_match(string const & beg, LYXERR(Debug::FIND, "Braces match as expected"); return true; } - +#endif class MatchResult { public: @@ -865,6 +867,9 @@ public: int match2end; int pos; int leadsize; +#if defined(ResultsDebug) + vector result = vector (); +#endif MatchResult(): match_len(0),match_prefix(0),match2end(0), pos(0),leadsize(0) {}; }; @@ -1407,6 +1412,8 @@ static void buildAccentsMap() accents["i"] = "ı"; accents["jmath"] = "ȷ"; accents["cdot"] = "·"; + accents["guillemotright"] = "»"; + accents["guillemotleft"] = "«"; accents["hairspace"] = getutf8(0xf); // select from free unicode plane 15 accents["thinspace"] = getutf8(0xf0002); // and used _only_ by findadv accents["negthinspace"] = getutf8(0xf0003); // to omit backslashed latex macros @@ -1497,7 +1504,7 @@ void Intervall::removeAccents() buildAccentsMap(); static regex const accre("(([\\S]|grave|breve|ddot|dot|acute|dacute|mathring|check|hat|bar|tilde|subdot|ogonek|" "cedilla|subring|textsubring|subhat|textsubcircum|subtilde|textsubtilde|dgrave|textdoublegrave|rcap|textroundcap|slashed)\\{[^\\{\\}]+\\}" - "|((i|imath|jmath|cdot|[a-z]+space)|((backslash )?([lL]y[xX]|[tT]e[xX]|[lL]a[tT]e[xX]e?|lyxarrow)))(?![a-zA-Z]))"); + "|((i|imath|jmath|cdot|[a-z]+space)|((backslash )?([lL]y[xX]|[tT]e[xX]|[lL]a[tT]e[xX]e?|lyxarrow))|guillemot(left|right))(?![a-zA-Z]))"); smatch sub; for (sregex_iterator itacc(par.begin(), par.end(), accre), end; itacc != end; ++itacc) { sub = *itacc; @@ -1838,13 +1845,6 @@ void LatexInfo::buildEntries(bool isPatternString) key = sub.str(2)[1]; else { key = sub.str(2); -if (key == "$") { - size_t k_pos = sub.position(size_t(2)); - if ((k_pos > 0) && (interval_.par[k_pos - 1] == '\\')) { -// Escaped '$', ignoring -continue; - } -} } } if (keys.find(key) != keys.end()) { @@ -2183,7 +2183,6 @@ void LatexInfo::buildKeys(bool isPatternString) makeKey("textasciicircum|textasciitilde", KeyInfo(KeyInfo::isChar, 0, false), isPatternString); makeKey("textasciiacute|texemdash", KeyInfo(KeyInfo::isChar, 0, false), isPatternString); makeKey("dots|ldots", KeyInfo(KeyInfo::isChar, 0, false), isPatternString); - makeKey("guillemotright|guillemotleft", KeyInfo(KeyInfo::isChar, 0, false), isPatternString); // Spaces makeKey("quad|qquad|hfill|dotfill", KeyInfo(KeyInfo::isChar, 0, false), isPatternString); makeKey("textvisiblespace|nobreakspace", KeyInfo(KeyInfo::isChar, 0, false), isPatternString); @@ -3178,11 +3177,6 @@ MatchResult MatchStringAdv::findAux(DocIterator const & cur, int len, bool at_be QRegularExpressionMatch match = p_regexp->match(qstr, 0, flags); if (!match.hasMatch()) return mres; - // Check braces on segments that matched all (.*?) subexpressions, - // except the last "padding" one inserted by lyx. - for (int i = 3; i < match.lastCapturedIndex(); ++i) - if (!braces_match(match.captured(i), open_braces)) - return mres; #else regex const *p_regexp; regex_constants::match_flag_type flags; @@ -3197,49 +3191,25 @@ MatchResult MatchStringAdv::findAux(DocIterator const & cur, int len, bool at_be if (re_it == sregex_iterator()) return mres; match_results const & m = *re_it; - // Check braces on segments that matched all (.*?) subexpressions, - // except the last "padding" one inserted by lyx. - for (size_t i = 3; i < m.size() - 1; ++i) - if (!braces_match(m[i], open_braces)) -
[LyX/master] Remove wrong dots from hu.po (#11573)
commit 8100b5384dd05fc01232bf8502f34c711043e69d Author: Juergen Spitzmueller Date: Thu Jan 7 16:37:12 2021 +0100 Remove wrong dots from hu.po (#11573) --- po/hu.po |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/po/hu.po b/po/hu.po index 326cb49..2f3707f 100644 --- a/po/hu.po +++ b/po/hu.po @@ -9881,7 +9881,7 @@ msgstr "A címke, ahogy az a dokumentumban megjelenik" #: lib/layouts/beamer.layout:328 lib/layouts/numarticle.inc:11 #: lib/layouts/powerdot.layout:254 msgid "\\Alph{section}" -msgstr "\\Alph{section}." +msgstr "\\Alph{section}" #: lib/layouts/beamer.layout:366 msgid "Subsection \\arabic{section}.\\arabic{subsection}" @@ -15522,15 +15522,15 @@ msgstr "" #: lib/layouts/numarticle.inc:10 lib/layouts/powerdot.layout:249 msgid "\\arabic{section}" -msgstr "\\arabic{section}." +msgstr "\\arabic{section}" #: lib/layouts/numreport.inc:9 msgid "\\arabic{chapter}" -msgstr "\\arabic{chapter}." +msgstr "\\arabic{chapter}" #: lib/layouts/numreport.inc:10 msgid "\\Alph{chapter}" -msgstr "\\Alph{chapter}." +msgstr "\\Alph{chapter}" #: lib/layouts/numreport.inc:44 msgid "\\arabic{footnote}" -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX/master] Properly disable Apply/OK in InsetParamsDialog (#11440)
commit e947cdab3ea8f91206b71f187e75fd4d244a02c9 Author: Juergen Spitzmueller Date: Thu Jan 7 13:28:10 2021 +0100 Properly disable Apply/OK in InsetParamsDialog (#11440) --- src/frontends/qt/InsetParamsDialog.cpp | 12 +++- 1 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/frontends/qt/InsetParamsDialog.cpp b/src/frontends/qt/InsetParamsDialog.cpp index ebac60b..d2c0cae 100644 --- a/src/frontends/qt/InsetParamsDialog.cpp +++ b/src/frontends/qt/InsetParamsDialog.cpp @@ -193,14 +193,16 @@ docstring InsetParamsDialog::checkWidgets(bool immediate) ? d->widget_->creationCode() : LFUN_INSET_MODIFY; bool const lfun_ok = lyx::getStatus(FuncRequest(code, argument)).enabled(); + bool const changed_inset = ins && (ins != d->inset_ || d->changed_); buttonBox->button(QDialogButtonBox::Ok)->setEnabled(!immediate && widget_ok - && !read_only && valid_argument); - bool const can_be_restored = !immediate && !read_only - && ins && (ins != d->inset_ || d->changed_); + && !read_only && valid_argument + && (!ins || changed_inset)); + bool const can_be_restored = !immediate && !read_only && changed_inset; buttonBox->button(QDialogButtonBox::Reset)->setEnabled(can_be_restored); - buttonBox->button(QDialogButtonBox::Apply)->setEnabled(ins && !immediate + buttonBox->button(QDialogButtonBox::Apply)->setEnabled(!immediate && lfun_ok && widget_ok - && !read_only && valid_argument); + && !read_only && valid_argument + && changed_inset); immediateApplyCB->setEnabled(ins && !read_only); // This seems to be the only way to access custom buttons QList buttons = buttonBox->buttons(); -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX/master] GuiParagraph: apply pending changes when setting "immediate apply" (#11592)
commit 7a992bb699b661325b652bd34d312854264464d9 Author: Juergen Spitzmueller Date: Thu Jan 7 13:05:37 2021 +0100 GuiParagraph: apply pending changes when setting "immediate apply" (#11592) --- src/frontends/qt/GuiParagraph.cpp | 24 +--- src/frontends/qt/GuiParagraph.h |4 +++- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/src/frontends/qt/GuiParagraph.cpp b/src/frontends/qt/GuiParagraph.cpp index 432ce28..b3c7349 100644 --- a/src/frontends/qt/GuiParagraph.cpp +++ b/src/frontends/qt/GuiParagraph.cpp @@ -75,7 +75,7 @@ GuiParagraph::GuiParagraph(GuiView & lv) synchronizedViewCB->setChecked(false); #endif - on_synchronizedViewCB_toggled(); + setButtons(synchronizedViewCB->isChecked()); QDoubleValidator * val = new QDoubleValidator(linespacingValue); val->setNotation(QDoubleValidator::StandardNotation); linespacingValue->setValidator(val); @@ -155,16 +155,26 @@ LyXAlignment GuiParagraph::getAlignmentFromDialog() const } -void GuiParagraph::on_synchronizedViewCB_toggled() +void GuiParagraph::on_synchronizedViewCB_stateChanged(int state) +{ + bool in_sync = state == Qt::Checked; + setButtons(in_sync); + + // Apply pending changes + if (in_sync) + changed(); +} + + +void GuiParagraph::setButtons(bool const in_sync) { - bool in_sync = synchronizedViewCB->isChecked(); buttonBox->button(QDialogButtonBox::Reset)->setEnabled(!in_sync); buttonBox->button(QDialogButtonBox::Apply)->setEnabled(!in_sync); buttonBox->button(QDialogButtonBox::Ok)->setEnabled(!in_sync); - if (!in_sync) - buttonBox->button(QDialogButtonBox::Cancel)->setText(qt_("")); - else + if (in_sync) buttonBox->button(QDialogButtonBox::Cancel)->setText(qt_("")); + else + buttonBox->button(QDialogButtonBox::Cancel)->setText(qt_("")); } @@ -246,7 +256,7 @@ void GuiParagraph::applyView() void GuiParagraph::updateView() { - on_synchronizedViewCB_toggled(); + setButtons(synchronizedViewCB->isChecked()); ParagraphParameters const & pp = params(); diff --git a/src/frontends/qt/GuiParagraph.h b/src/frontends/qt/GuiParagraph.h index 4e8d31b..230390e 100644 --- a/src/frontends/qt/GuiParagraph.h +++ b/src/frontends/qt/GuiParagraph.h @@ -60,12 +60,14 @@ private: bool hasLabelwidth() const; /// LyXAlignment alignPossible() const; + /// + void setButtons(bool const in_sync); private Q_SLOTS: /// void changed(); /// - void on_synchronizedViewCB_toggled(); + void on_synchronizedViewCB_stateChanged(int state); /// void on_linespacing_activated(int); /// Apply changes -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX/master] typo
commit c10aa3064fe9d4009a46ce51bbdd8d3d97c62d75 Author: Jean-Marc Lasgouttes Date: Thu Jan 7 12:36:36 2021 +0100 typo --- src/Cursor.h |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Cursor.h b/src/Cursor.h index 6f4ac22..f549047 100644 --- a/src/Cursor.h +++ b/src/Cursor.h @@ -277,7 +277,7 @@ public: void message(docstring const & msg) const; /// display an error message void errorMessage(docstring const & msg) const; - /// get the resut of the last dispatch + /// get the result of the last dispatch DispatchResult const & result() const; /// Set the cursor language from current input method language @@ -286,7 +286,7 @@ public: * or partial match with the whole list of languages. */ void setLanguageFromInput(); - /// Set the current font of the cursor from its location. + /// Set the current font of the cursor from its location. void setCurrentFont(); /** -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX/master] Hint to deleted included file in ct output (#11809)
commit 6430931e2777d6b324d14cd53cd148913efcb0a3 Author: Juergen Spitzmueller Date: Thu Jan 7 12:08:59 2021 +0100 Hint to deleted included file in ct output (#11809) --- src/insets/InsetInclude.cpp | 10 ++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/src/insets/InsetInclude.cpp b/src/insets/InsetInclude.cpp index 71e9d38..284f4c1 100644 --- a/src/insets/InsetInclude.cpp +++ b/src/insets/InsetInclude.cpp @@ -563,6 +563,16 @@ void InsetInclude::latex(otexstream & os, OutputParams const & runparams) const FileName const included_file = includedFileName(buffer(), params()); Buffer const * const masterBuffer = buffer().masterBuffer(); + if (runparams.inDeletedInset) { + // We cannot strike-out whole children, + // so we just output a note. + os << "\\textbf{" + << bformat(buffer().B_("[INCLUDED FILE %1$s DELETED!]"), + from_utf8(included_file.onlyFileName())) + << "}"; + return; + } + // if incfile is relative, make it relative to the master // buffer directory. if (!FileName::isAbsolute(incfile)) { -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX/master] Fix nesting issue in environment-split (#11971)
commit e562dbac181ab2b9d2caac2d2cf1c8881dab Author: Juergen Spitzmueller Date: Thu Jan 7 11:53:35 2021 +0100 Fix nesting issue in environment-split (#11971) --- src/Text3.cpp | 42 -- 1 files changed, 28 insertions(+), 14 deletions(-) diff --git a/src/Text3.cpp b/src/Text3.cpp index bd6c256..5e64801 100644 --- a/src/Text3.cpp +++ b/src/Text3.cpp @@ -1645,7 +1645,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd) if (para.layout().isEnvironment()) layout = para.layout().name(); depth_type split_depth = cur.paragraph().params().depth(); - depth_type nextpar_depth = 0; + vector nextpars_depth; if (outer || previous) { // check if we have an environment in our scope pit_type pit = cur.pit(); @@ -1670,9 +1670,20 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd) } } if ((outer || normal) && cur.pit() < cur.lastpit()) { - // save nesting of following paragraph - Paragraph cpar = pars_[cur.pit() + 1]; - nextpar_depth = cpar.params().depth(); + // save nesting of following paragraphs if they are deeper + // or same depth + pit_type offset = 1; + depth_type cur_depth = pars_[cur.pit()].params().depth(); + while (cur.pit() + offset <= cur.lastpit()) { + Paragraph cpar = pars_[cur.pit() + offset]; + depth_type nextpar_depth = cpar.params().depth(); + if (cur_depth <= nextpar_depth) { + nextpars_depth.push_back(nextpar_depth); + cur_depth = nextpar_depth; + ++offset; + } else + break; + } } if (before) cur.top().setPitPos(cur.pit(), 0); @@ -1700,17 +1711,20 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd) else lyx::dispatch(FuncRequest(LFUN_PARAGRAPH_BREAK, "inverse")); lyx::dispatch(FuncRequest(LFUN_LAYOUT, layout)); - if ((outer || normal) && nextpar_depth > 0) { - // restore nesting of following paragraph + if ((outer || normal) && !nextpars_depth.empty()) { + // restore nesting of following paragraphs DocIterator scur = cur; - depth_type const max_depth = cur.paragraph().params().depth() + 1; - cur.forwardPar(); - while (cur.paragraph().params().depth() < min(nextpar_depth, max_depth)) { - depth_type const olddepth = cur.paragraph().params().depth(); - lyx::dispatch(FuncRequest(LFUN_DEPTH_INCREMENT)); - if (olddepth == cur.paragraph().params().depth()) - // leave loop if no incrementation happens - break; + depth_type max_depth = cur.paragraph().params().depth() + 1; + for (auto nextpar_depth : nextpars_depth) { + cur.forwardPar(); + while (cur.paragraph().params().depth() < min(nextpar_depth, max_depth)) { + depth_type const olddepth = cur.paragraph().params().depth(); + lyx::dispatch(FuncRequest(LFUN_DEPTH_INCREMENT)); + if (olddepth == cur.paragraph().params().depth()) + // leave loop if no incrementation happens + break; + } + max_depth = cur.paragraph().params().depth() + 1; } cur.setCursor(scur); } -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs