This can make a big difference for a very large branch that contains
lots of equations.
This is complementary to the previous patch, since instead of reducing
the number of calls to updatePosCache, we make it faster.
In the same test of scrolling with mouse wheel through the
branch-test.lyx document, one finds a 23% improvement for
BufferView::updateMetrics().
Part of bug #12297.
The setting of insets positions was done twice in updateMetrics.
When one of the paragraph is a huge branch, this can be very expensive.
This leads to a 17% improvement on updateMetrics time on a scrolling test.
Part of bug #12297
The idea of single par update is to try to re-break only the paragraph
containing the cursor (if this paragraph contains insets etc.,
re-breaking will recursively descend).
The existing single paragraph update mechanism was tailored to work
only at top level. Indeed changing a paragraph nested into an inset may
lead to larger changes.
This commit tries a rather naive approach that seems to work well: we
need a full redraw if either
1/ the height has changed
or
2/ the width has changed and it was equal to the text metrics width;
the goal is to catch the case of a one-row inset that grows with
its contents, but optimize the case of typing in a short paragraph
part of a larger inset.
NOTE: if only the height has changed, then it should be
possible to update all metrics at minimal cost. However,
since this is risky, we do not try that right now.
Part of bug #12297.
if the undo element we want to add only changes stuff that was already
modified by the previous one on undo stack (in the same group), then
skip it. There is nothing to gain in adding it to the stack.
The typical use case is when doing a search and replace in a large
document that does many replacements in each paragraph. In this case,
the same paragraph would be stored repeatedly.
Fixes bug #12564.
Qt::ImAnchorRectangle has only been introduced in Qt 5.7. Since it is
used to answer a query from the IM machinery, there is no need for
it with older Qt versions.
The warning says:
CMake Deprecation Warning at .../CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.
Spotted by Scott Kostyshak
This was completely broken: the IDs have been escaped in the LyX file
(which they absolutely shouldn't) but not in all LaTeX output (which
they should).
\ was transformed very early to \textbackslash{}, but then the following
routines escaped braces in the string, so we wrongly ended up in
\textbackslash\{\} and "\{} in the output