Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo


#4880 Find wrongly selects the whole document in complex searches over large spans


This bug is one which I'm constantly coming across when I deal with large documents.
If I do a complex search or a search which spans a lot of text, the whole document is selected.

A similar thing happens during Replace All, though I think in this case the selection extends only to the end of the document and doesn't wrap round. I assume this because the final Replace erazes only the end of the document.

Here's an example where the text isn't too huge, but the search is complex.
Search the attached document with regex:


(This message doesn't display the regex escape characters properly. The correct search is at the start of the attached document)

The attached document consists of a description and then three lines:
The central line is very long - it provides the span which produces this bug.
The first and last lines are identical, and the search should be successful in both
However, the second Find selects the whole document.
This is clearly wrong because the find should be confined to one line (with "[^\r]").

Interestingly the error does NOT occur:
- if the 'garbage' line is halved in length
- if all the angle-brackets are removed from the 'garbage' line
- if the search is simplified

BTW, the reason for this search is to find and replace items in order,
so that the first <w>and</w> will be replaced with "AND1" not with "AND2"

If you are interested:
The purpose in this case is to merge two Greek documents. One is marked up with morphology but has non-accented text, and the other has accented Greek but no morphology.
Isn't it amazing what your wonderful program is being used for!

David IB

1 Attachments