Issue
Search for "AGTCCCTCAAG" in Geany. It will fail to find "AGTCCCTCAAG" in "AGTCCCTCAAGTCCCTCAAG". This is also broken in latest Firefox...
Steps to reproduce
Textfile :
Substring: 'AGTCCCTCAAG (forward) (length: 11)' Occurs 2 times forward in the target sequence Forward occurrence in reference sequence: 1 Reversed occurrence in reference sequence: 0 Total occurrences in reference sequence: 1 Unmasked target sequence: AGTCCCTCAAGTCCCTCAAGCCGCCACCGCCGCC Unmasked target sequence: AGTCCCTCA AGTCCCTCAAGCCGCCACCGCCGCC Masked target sequence: ***********TCCCTCAAGCCGCCACCGCCGCC Unmasked reference sequence: AGTCCCTCAAGT Masked reference sequence: ***********T
Expected behaviour
Finds "AGTCCCTCAAG" twice
Closed #3932 as completed.
Geany starts searching for the next occurrence from the _end_ of the current match, so yes it will not find overlapping matches.
Functions associated with search such as: - "mark all" has to work this way, there is no way of marking overlapping occurrences so they can be distinguished. - "replace all" similarly has to look from the end of the text being replaced otherwise it might change the new substitution (and I vaguely remember a bug something like that back in the Geany mesolithic) - regular expressions should start from the end otherwise greedy expressions like `a+` would be found four times in `aaaab` if it restarted from the next character, `aaaa`, `aaa`, `aa`, `a` and that is not likely to be what the user expects and in fact could be quite annoying
And to be consistent all searches do the same thing, start from the end of the previous match.
All other editors and IDEs I have installed (Xed, Gedit, Vscode) all work this way too.
This is a useful and safe way to behave for the general use-case as a code editor where overlapping strings are unlikely to be relevant.
Therefore this is not considered a bug.
If someone really needed the overlapping search capability they could add it in a plugin.
github-comments@lists.geany.org