[texworks] Problem with search in all open files operation

Stefan Löffler st.loeffler at gmail.com
Tue Feb 22 07:13:26 CET 2022


Dear Wojtek,

On 21.02.22 22:45, Wojciech Myszka wrote:
>
> There is something wrong with “Search all open files” operation.
>
>  1. I have created three identical files (let's say a[123].tex)
>     containing the first five paragraphs of lorem ipsum taken from
>     lipsum.com <https://lipsum.com/>.
>  2. The first search for the word “Cras” gives the correct result:
>     lines no. 1, 5, and 9 (three times) in each file.
>  3. Starting the search in the first file (a1.tex) *after deletion* of
>     the last paragraph (now a1.tex is shorter, a2.tex and a3.tex are
>     identical) searching for “Cras” gives incorrect results (the word
>     is found only *two times* in each file — in lines 1 and 5)
>  4. Starting the search from a2.tex (or a3) — results are correct (two
>     times in a1, four times in a2 and a3)
>
> I do not know if I can explain this correctly.
>

I could reproduce it so they explanation was good :). Thanks a lot for 
spotting this. It should be fixed in the code now (automated builds are 
running and should hopefully complete in the next couple of minutes).

> There is also another problem with searching through all open files, 
> difficult to explain and describe:
>
>   * starting the search from the file where the search string is
>     absent gives a result *not found*
>   * starting from the file where the search string is present gives
>     *correct* results for this file and *wrong* results for other
>     files (please check the attachment, where each “found place” is
>     marked blue; the search word was “\\section”); well, OK—I really
>     do not know when the problem appears for the first time, but it
>     used to work earlier.
>

This is in fact the same problem. Essentially, instead of searching all 
open files, the code searched the same (current) file over and over 
again, just reporting the results (or lack thereof) as if they were 
coming from all the other open documents.
And you are right, the bug seems to have been introduced back in June 
2021 in the course of some refactoring.

Best regards,
Stefan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/texworks/attachments/20220222/cbf7ad4f/attachment.html>


More information about the texworks mailing list.