[LyX/master] Amend(4) 73188e3 * Added textsl, texttt, uline, uuline, sout, xout to the list of possible leading strings. * Account for correct number of open braces in regex. Now the search works for
commit 4eb5ac9a2c35005461e21dec5cb7f2b214aa4e8d Author: Kornel Benko Date: Mon Oct 1 12:06:42 2018 +0200 Amend(4) 73188e3 * Added textsl, texttt, uline, uuline, sout, xout to the list of possible leading strings. * Account for correct number of open braces in regex. Now the search works for enbled format too. This is hopefully the last amend --- src/lyxfind.cpp | 10 ++ 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp index 40e943f..08faf0a 100644 --- a/src/lyxfind.cpp +++ b/src/lyxfind.cpp @@ -842,7 +842,7 @@ static size_t identifyLeading(string const & s) string t = s; // @TODO Support \item[text] // Kornel: Added textsf, textit and noun - while (regex_replace(t, t, REGEX_BOS "(emph|noun|text(bf|sf|it)|subsubsection|subsection|section|subparagraph|paragraph|part)\\*?\\{", "") + while (regex_replace(t, t, REGEX_BOS "(emph|noun|text(bf|sl|sf|it|tt)|(u|uu)line|(s|x)out|uwave|subsubsection|subsection|section|subparagraph|paragraph|part)\\*?\\{", "") || regex_replace(t, t, REGEX_BOS "\\$", "") || regex_replace(t, t, REGEX_BOS "\\[ ", "") || regex_replace(t, t, REGEX_BOS "item ", "") @@ -932,7 +932,9 @@ MatchStringAdv::MatchStringAdv(lyx::Buffer & buf, FindAndReplaceOptions const & } if (!opt.ignoreformat) { // Remove extra '\}' at end - while ( regex_replace(par_as_string, par_as_string, "(.*)}$", "$1")); + while ( regex_replace(par_as_string, par_as_string, "(.*)}$", "$1")) { + open_braces++; + } // save '\.' regex_replace(par_as_string, par_as_string, "\\.", "_xxbdotxx_"); // handle '.' -> '[^]', replace later as '[^\}\{\\]' @@ -1011,7 +1013,7 @@ int MatchStringAdv::findAux(DocIterator const & cur, int len, bool at_begin) con // Check braces on segments that matched all (.*?) subexpressions, // except the last "padding" one inserted by lyx. for (size_t i = 1; i < m.size() - 1; ++i) - if (!braces_match(m[i].first, m[i].second)) + if (!braces_match(m[i].first, m[i].second, open_braces)) return 0; // Exclude from the returned match length any length @@ -1104,7 +1106,7 @@ string MatchStringAdv::normalize(docstring const & s, bool hack_braces) const // Remove stale empty \emph{}, \textbf{} and similar blocks from latexify // Kornel: Added textsf, textit and noun LYXERR(Debug::FIND, "Removing stale empty \\emph{}, \\textbf{}, \\*section{} macros from: " << t); - while (regex_replace(t, t, "(emph|noun|text(bf|sf|it)|subsubsection|subsection|section|subparagraph|paragraph|part)(\\{\\})+", "")) + while (regex_replace(t, t, "(emph|noun|text(bf|sl|sf|it|tt)|(u|uu)line|(s|x)out|uwave|subsubsection|subsection|section|subparagraph|paragraph|part)(\\{\\})+", "")) LYXERR(Debug::FIND, " further removing stale empty \\emph{}, \\textbf{} macros from: " << t); // FIXME - check what preceeds the brace
[LyX/2.3.x] Amend cab46ff9d1ea3
commit 068e3d4fe52ed0b3928a3d71b800c02d2d218032 Author: Juergen Spitzmueller Date: Sat Sep 29 10:27:20 2018 +0200 Amend cab46ff9d1ea3 (cherry picked from commit f973855bdea94f0c6edf8eace7548a440f005902) --- src/frontends/qt4/GuiCitation.cpp |8 src/frontends/qt4/ui/CitationUi.ui |7 ++- status.23x |2 ++ 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/frontends/qt4/GuiCitation.cpp b/src/frontends/qt4/GuiCitation.cpp index 1af187a..06dd4ed 100644 --- a/src/frontends/qt4/GuiCitation.cpp +++ b/src/frontends/qt4/GuiCitation.cpp @@ -175,6 +175,8 @@ GuiCitation::GuiCitation(GuiView & lv) selectedLV->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); #endif + selectedLV->setToolTip(qt_("Ordered list of all cited references.\n" + "You can reorder, add and remove references with the buttons on the left.")); setFocusProxy(filter_); } @@ -353,6 +355,12 @@ void GuiCitation::updateFormatting(CitationStyle const & currentStyle) starredCB->setToolTip(qt_("Always list all authors (rather than using \"et al.\"), " "if the current citation style supports this.")); } + if (availableLV->selectionModel()->selectedIndexes().isEmpty()) + availableLV->setToolTip(qt_("All references available for citing.")); + else + availableLV->setToolTip(qt_("All references available for citing.\n" + "To add the selected one, hit Add, press Enter or double-click.\n" + "Hit Ctrl-Enter to add and close the dialog.")); } diff --git a/src/frontends/qt4/ui/CitationUi.ui b/src/frontends/qt4/ui/CitationUi.ui index e5c0bc0..bbec63f 100644 --- a/src/frontends/qt4/ui/CitationUi.ui +++ b/src/frontends/qt4/ui/CitationUi.ui @@ -123,9 +123,7 @@ - All references available for citing. -To select one, hit Add, press Enter or double-click. -Hit Ctrl-Enter to select and close the dialog. + QAbstractItemView::NoEditTriggers @@ -241,8 +239,7 @@ Hit Ctrl-Enter to select and close the dialog. - Ordered list of all cited references. -You can reorder, add and remove references with the buttons on the left. + diff --git a/status.23x b/status.23x index caa3efb..c07d505 100644 --- a/status.23x +++ b/status.23x @@ -71,6 +71,8 @@ What's new - Update Simplified Chinese, German, Italian and Slovak user interface localization. +- Add some tooltips in citation dialog in favor of keyboard users (bug 11317). + * BUILD/INSTALLATION
[LyX/2.3.x] GuiCitation: Add some tooltips for the sake of keyboard users
commit 04ed229444236b0efdbc3827d5536d6a6ef5981e Author: Juergen Spitzmueller Date: Sat Sep 29 09:18:26 2018 +0200 GuiCitation: Add some tooltips for the sake of keyboard users Addresses #11317 (cherry picked from commit cab46ff9d1ea3bd801050eb4834f2e16a8ad3152) --- src/frontends/qt4/GuiCitation.cpp |3 ++- src/frontends/qt4/ui/CitationUi.ui | 12 +++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/frontends/qt4/GuiCitation.cpp b/src/frontends/qt4/GuiCitation.cpp index 46cdd8d..1af187a 100644 --- a/src/frontends/qt4/GuiCitation.cpp +++ b/src/frontends/qt4/GuiCitation.cpp @@ -575,9 +575,10 @@ void GuiCitation::regexChanged() void GuiCitation::updateFilterHint() { - QString const hint = instant_->isChecked() ? + QString hint = instant_->isChecked() ? qt_("Enter string to filter the list of available citations") : qt_("Enter string to filter the list of available citations and press "); + hint += qt_("\nThe down arrow key will get you into the list of filtered citations."); filter_->setToolTip(hint); } diff --git a/src/frontends/qt4/ui/CitationUi.ui b/src/frontends/qt4/ui/CitationUi.ui index 23c9535..e5c0bc0 100644 --- a/src/frontends/qt4/ui/CitationUi.ui +++ b/src/frontends/qt4/ui/CitationUi.ui @@ -122,6 +122,11 @@ + + All references available for citing. +To select one, hit Add, press Enter or double-click. +Hit Ctrl-Enter to select and close the dialog. + QAbstractItemView::NoEditTriggers @@ -234,7 +239,12 @@ - + + + Ordered list of all cited references. +You can reorder, add and remove references with the buttons on the left. + +