The removal of duplicates is done in LastCommandsSection::add and uses
the erase-remove idiom for performance.
Most of the patch is a cleanup of GuiCommandBuffer:
* remove history_ member, that was a copy of the session lastcommands
vector. Use instead a wrapper history() around it and a addHistory
wrapper for adding new entries.
* Make sure that there is only one place where commands are added to
history. The code used to maintain a list for interactive editing,
and a list for saving the session. They could be different in terms
of leading/trailing spaces.
* [unrelated] remove command_ member, which is just a copy of
LyXAction list of commmands. Use directly lyxaction instead.
In mathed it is assumed that a labeled line is also implicitly numbered.
However, latex allows to label an equation without numbering it.
The label is then assigned the value of a nearby numbered one.
This commit drops the above mathed assumption in order to allow to import
valid latex code with a labeled but not numbered equation line.
The screen representation omits the line number and encloses the label
in square brackets for further differentiation. However, it is still not
possible to label an equation without numbering it using the GUI.
The aliases are defined by a file in the (system or user) image
directory. The format is pretty simple: each line is like
<str1> <str2>
Where every instance of <str1> will be replaced with <str2>.
Fixes bug #12509.
Adding this particular line created bad redraw interactions. See
thread on lyx-devel here:
https://marc.info/?l=lyx-devel&m=165648365808777&w=2
The code is reorganized a bit:
- the part of updateGUI() that (en|dis)abled elements is not moved to
updateBottons ; the rest is renamed updateWorkAreas()
- only updateButtons is called now in eventFilter
- finally the recursion curse is fixed now in updateWorkAreas() by
setting the old_buffer value _before_ calling copy_params. This
avoid recursion if some bad update were to happen again.
When changing the document class, the message "Converting document to
new document class..." is shown in minibuffer. This message leads to
weird GUI update interactions with the FindAndReplace panel, and
ultimately infinite loops. It would only be useful if the conversion
took a long time.
See this thread for rreference:
https://marc.info/?l=lyx-devel&m=165648365808777&w=2
Therefore, just remove it.
This important part is the last point, the rest is what is needed to
make it happen.
* implement (FindAndReplace|FindAndReplaceWidget)::hasWorkArea, that
tell whether a work area is own by the advanced find & replace
widget.
* factor out method find() from GuiView::findOrBuild.
* implement GuiView::hasVisibleWorkArea, that tells whether a workarea
is visible in the view (current tab in a split or adv. f&r
workarea).
* Finally, in TocWidget::sendDispatch, change the current workarea
temporarily to the document workarea before dispatching the
function. The code tries to be as careful as possible to handle all
cases. The future will tell whether it is good enough.
When the commit string from the inputMethodEvent can be interpreted as
characters bound to some action, dispatch this action instead of
inserting the string.
This is useful on an international keyboard, when diaresis+space gives
a plain double quote. It is better in this case to enter a smart
quote.
Adapted from a patch from Daniel Ramoeller <d.lyx@web.de>.
Fixes bug #10377.
Fix for bug #12547.
- "Interword" becomes "Normal"
- "Protected" becomes "Non-Breaking"
Plus a minor fixes to the "Horizontal Space Settings" dialog:
- Indicate that when "Non-Breaking" is disabled, the space will be non-breaking
In FindAdv we use Qt to interpret regular expressions.
Regex uses for instance '\w', '\d' etc.
'\d' finds not just '0-9' but also e.g. '߂' (Nko Digit Two: U+07c2)
'\w' includes also such numbers.
ATM, only FindAdv uses this function.
In this case we skip the undesired word-characters before starting the search.
There are still some inconsistencies between LyX and Qt of 'what counts as a word-character',
but too hard to resolve.
Since the element 'match_len' in class MatchResult is an integer,
the check 'if (!match(...).match_len))' is changed to
'if (match(...).match_len) <= 0)'
1.) The type of variable at_begin changes from bool to enum matchType
true -> MatchStringAdv::MatchFromStart,
false -> MatchStringAdv::MatchAnyPlace
2.) discard default parameter-values of
MatchStringAdv::operator()
MatchStringAdv::findAux()
1.) Changed arrays dept and closes to vector-type because of runtime error in UserGuide.lyx
with a big paragraph (size > 8900 chars) contained too many opening parentheses
2.) Removed one creation 'textcyrillic'-key because it is later anyway created
3.) Most important (thanks to Scott who found the failure)
Move the check if the found string really is part of MATH to
the relevant place.
Without this change the search using 'Search only in maths' will fail miserably.
When implementing multi-row string breaking, an extra createLine()
statement, which made sense in the original code, was kept by mistake.
This basically made the mechanism ineffective, because it created one
row with the correct length, plus a second one with all the remaining
text, which would have to be itself broken. This went undetected
because the display is still correct.
Additionally, this issue polluted the break cache to the extent that
the hit rate could be 0%.
Together, these two effects created a major slowdown with a document
containing a single ~30000 characters paragraph.
Fixes bug #12534.
When toggleFree is called without a selection, the only result is to
change the cursor currentfont.
In the other cases (selection or implicit selection), we want to reset
the cursor font from the text font.
Fixes bug #12518.
To handle this case, we use '\lyxdollar' string instead.
Also try to handle '\n' in the docstring directly instead in the
string already converted to utf8.
(The utf8-version is still there, but commented out)