Kornel Benko [Sun, 29 May 2022 10:06:18 +0000 (12:06 +0200)]
Introduce isNumberChar(char_type) function
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.
When generating makefiles, by default qmake tries to use
relative paths if it can replace at most 4 subdirs with "../"
to reach the QTDIR from the project file location.
This maximum can be changed by defining QMAKE_PROJECT_DEPTH, and
setting it to zero forces qmake to always use absolute paths.
This is necessary because the paths for includes and libs are
generated by a temporary project file located in a temporary dir
not corresponding to the real source dir.
Kornel Benko [Wed, 25 May 2022 19:34:17 +0000 (21:34 +0200)]
FindAdv: Fix expression checking for 'int' as if it were bool
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)'
Kornel Benko [Wed, 25 May 2022 18:43:49 +0000 (20:43 +0200)]
FindAdv: Attempt to make the code less crabbed
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()
Kornel Benko [Tue, 24 May 2022 21:41:31 +0000 (23:41 +0200)]
FindAdv:
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.
Scott Kostyshak [Tue, 24 May 2022 13:44:51 +0000 (09:44 -0400)]
Revert "User Guide: add quotes to a PackageOptions command"
Jürgen fixed the core issue at a77c84a0 so this workaround is not
needed anymore. It is more intuitive, and easier to remember, to not
use the double-quotes.
Fixup d723b903: Fix slow display of large paragraphs
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.
Kornel Benko [Fri, 13 May 2022 07:30:30 +0000 (09:30 +0200)]
FindAdv: In format search could '$'-char be interpreted as math-start.
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)
Kornel Benko [Thu, 12 May 2022 11:22:21 +0000 (13:22 +0200)]
FindAdv: Remove invalid closings
If the searched area contains deleted parts, there may be more closing
as opening parentheses in latex output. We have to remove them before
further processing.
Kornel Benko [Mon, 9 May 2022 20:06:02 +0000 (22:06 +0200)]
FindAdv: Use private variable for_search
Using the new inline statements
find_effective(), find_with_non_output(), find_with_deleted(),
find_set_feature(), find_add_feature() and find_clean_features()
makes the code a slightly better readable.
Kornel Benko [Sun, 8 May 2022 12:30:45 +0000 (14:30 +0200)]
FindAdv: Amend 627cd6de: Use '~' instead of "\\ " for search if possible
Also fix a thinko in interpreting the found values.
The match_len describes the length of the second regex field,
while matchend is the length of the search field 0.
Scott Kostyshak [Sat, 30 Apr 2022 01:09:33 +0000 (21:09 -0400)]
ctests: update description for lyxbugs/6197
With an updated TeX Live 2022, LuaTeX no longer gives a missing
symbol for this test file (manual inspection confirms the symbols
are correctly displayed).
We are removing leading values from the start of string, so
the size of removed data was wrong because s.find() could find
a position inside the leading part.
Improve selection when selecting out of inset by the left
1/ put cusror in some display inset
2/ use shift-left until the cursor exits the inset
3/ see how the selection extends on the right.
This is not really a selection drawing bug, but rather the fact that
the anchor will be normalized to the first position after the inset,
which is in the next row.
This can be avoided by using the boundary property.