https://marc.info/?l=lyx-devel&m=154458979925296&w=2
This is related to the fix for #9158 and the caching of bibfile
information. On Windows, it is incredibly slow to run kpsewhich,
which we do to check where files actually are, so as to get info
about them (e.g., timestamps). So we have started to cache that
as a map. The map is supposed to be invalidated when various
things happen, but an oversight was causing it to be invalidated
on every cut operation. This is because cutting uses a temporary
Buffer, and the operations on it were affecting the *global* cache
of biblio file info. (It makes sense to have a global cache, since
these files are not document-specific.) Basically, we have to update
the list of bibfiles in that temporary Buffer---but that is one of
the things that invalidated the cache. The solution is only to
invalidate the cache if the list of bibfiles has actually changed
(a sensible idea anyway). The only time that will happen in the
temporary Buffer is when the copied information contains a BibTeX
inset. That should be fairly rare.
The backslash is the escape character used in our parser. Hence,
when used as a path separator on Windows, it has to be itself
escaped or the path enclosed in either double or single quotes.
Windows users are maybe trained to quote paths containing spaces
but not paths with backslashes. So, we automatically escape the
backslashes when they are not already enclosed in quotes.
Previously the permission were destroyed by the newly created
temporary file -- which is later used as new saved file.
Tested on symlinks as well but only on Linux.
This is not possible for '$', because of the latex-meaning to
start/end math inset.
Therefore, if not ignoring format, we still have to use
[\\][\$] in regex in order to find '$' in text.
The boost signal was sent synchronously, and so made the Qt signal to be posted
in FileMonitor::changed after the boost signal returned, so after the sender was
possibly destroyed.
The solution is to make the boost signal asynchronous using the Qt event loop.
Thanks to Scott Kostyshak for the report and MWE.
When deciding how to strike out deleted math in change-tracking
mode, differentiate only on begin-of-line or not, and not on
after-paragraph-break or not.
The assumption that a new paragraph is always started after a
float seems to be not true and was causing this bug.
Given the regex 'r.*r\b' and a string
"abc regular something cursor currently"
we expect to find "regular something cursor".
But while searching we may be confronted with input
"regular something cursor curr"
and so the searched string would be seen longer.
Testcase without this patch:
1.) open de/Additional.lyx
2.) goto 6.1 Astronomy & Astrophysics
3.) open the index
4.) find advaced
a.) not ignoring format
b.) regex = .+
c.) language of regex: English
4.) search next
The seach finds the next break (which is outside of the index)
The following try to display the selection leads to crash
This change is valid for findadv too.
Patterns like '.*' now are greedy, like it is normal in regex
Searching for whole words is corrected, but can be slow.
One can speed up the search with adapted pattern.
So for instance searching for words starting and ending with 'r'
the normal pattern is 'r.*r'. The speed-up pattern could be
'\br[^\s]*r\b'. This halves the search time.
Search results are now different to that of lyx2.3, because the greedy
'.*' is now really greedy.
To achive the same results, we have to use '.*?' instead.
This is a fixup to 8d8988de4. When a file is loaded and the cursor is
set, it is required to first compute metrics to be able to scroll the
screen correctly.
Fixes bug #11377.
A try to decrement the number of tests for a match.
Also a try to handle Hebrew documents. Unfortunatelly
the latex output is missing the language specification
(only the change of encoding is available there).
I failed to find a proper place to add the lang.
That means, searching for e.g. English text in Hebrew documents
is not satisfying.
The needed time to find a simple string dependes on the
paragraph length was O(n^2)
Now it is down to O(n).
Before:
To determine if the pattern matches we compared the
paragraph from current position to the its end.
Increment current position if no match
Now:
Check if the character at current position has at least
the needed features (text, color, language etc)
If not, Increment current position
else proceed as before
Before this commit, navigating with the cursor was visiting either
the nucleus or the script depending on the direction (left or right)
of the cursor movement. Now the 2.3.x behavior of always going through
the nucleus is restored (at least for overset and underset, as stackrel
seems to behave oddly also in 2.3.x).
Also added missing math env alignat
Modified handling of longtable/tabular
Added a routine to count for valid chars. This is needed
for detection of word boundaries.
Due to detection conflicts
regex '.*' vs match of word-boundaries in MatchStringAdv::operator()
we need to use '\b' in regex explicitly. E.g. '\b.*\b'
The backward search works, but
1.) only in current paragraph (this is the same as before)
2.) only in the same language environment.
1.) Added \textmd to be ignored (sometimes it is used and sometimes not)
2.) Typo: multiline --> multline. Searching in 'multline' caused a crash
because processing all of the '{' and '}' in the content of this math
exceeded the size of the interval field.