Text search in lister may skip some matches

Bug reports will be moved here when the described bug has been fixed

Moderators: white, Hacker, petermad, Stefan2

Post Reply
umbra
Power Member
Power Member
Posts: 871
Joined: 2012-01-14, 20:41 UTC

Text search in lister may skip some matches

Post by *umbra »

Imagine the following text file:
<some text>
<pattern><pattern><pattern><pattern><pattern>
<some text>
Notice that there are no spaces between "<pattern>"'s.
If I press CTRL+F, type "<pattern>" and press ENTER, the first match gets highlighted. Then if I press F3, the second match gets highlighted. And so on.
However if I, instead of pressing F3, press CTRL+F and ENTER, the following match is skipped. As result only odd matches get selected:
<some text>
<pattern><pattern><pattern><pattern><pattern>
<some text>
If those matches are separated by at least one symbol, all of them are found.
I know it's not exactly an efficient way of searching, but it should work anyway.
Tested on TC8 beta 25 (x32 an x64) and TC7.57a.
Windows 7 Pro x64, Windows 10 Pro x64
User avatar
HerbieH
Member
Member
Posts: 145
Joined: 2003-02-11, 10:04 UTC

Post by *HerbieH »

Here is another text search problem in TC 8.0 beta 25 (x32 and x64), that might be related:

In 'Find Files', I search for (f.eks.) 'anything.ini', which contains the 3 text strings: 'c:\t and 'c:\til' and 'c:\T'.
When 'Find text' is marked and the search string is: 'c:\t', then Total Commander finds NOTHING!
When the search string is 'c:\T', Total Commander finds all 3 strings!

OBS: None of the 8 selectable options (including RegEx2) has been marked.


The very same problem occurs, when I search directly in 'anything.ini' using the build-in <F3> lister option.
Furthermore, the search string, I wrote in 'Enter search text' ='c:\T', changes on a second search to 'c:\t', and therefore do not find the 3 ocurrances mentioned above on a second search.

For reference, I have tested the same search pattern with other 'viewers' and editors, and TC is the only one which has this behaviour.

(If you try out this problem, please disreguard the '' around all the strings.)

Greetings
HerbieH*
-Keep on makin' music!
umbra
Power Member
Power Member
Posts: 871
Joined: 2012-01-14, 20:41 UTC

Post by *umbra »

Hi, HerbieH.
No, it is not related. And I don't think it's a bug - maybe an unexpected behavior. TC automatically presumes, that '\t', '\n' and '\\' are escape characters. Check TC's help:
Special characters when searching:
\t Tabstop
\n Newline
\\ Single Backslash
If you want to disable it, you have to prepend an additional backslash to every such combination (e.g. use "\\t" instead of "\t").
HerbieH wrote:OBS: None of the 8 selectable options (including RegEx2) has been marked.
Disabling RegEx won't help. TC cannot search in a literal mode - it always searches in an extended mode. Some editors may call it differently, but basically it's something between a literal mode and a RegEx mode, which means you have to look for such special characters in your search pattern and change them accordingly. I am not aware of any way of disabling of this behavior.
HerbieH wrote:Furthermore, the search string, I wrote in 'Enter search text' ='c:\T', changes on a second search to 'c:\t', ...
Sorry, I cannot confirm that. Maybe you pressed CTRL-F while "c:\t" was selected - in that case TC assumed that you wanted to search for the selected text.
Windows 7 Pro x64, Windows 10 Pro x64
User avatar
Flint
Power Member
Power Member
Posts: 3487
Joined: 2003-10-27, 09:25 UTC
Location: Antalya, Turkey
Contact:

Post by *Flint »

I confirm the bug with jumping over search patterns. It seems that TC just fails to find the instance of the search string directly after the cursor position. If you turn Lister cursor on if will be more clear: put the cursor just between two patterns and try to search — TC jumps over the nearest one.
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 10.52 / Win10 x64
User avatar
HerbieH
Member
Member
Posts: 145
Joined: 2003-02-11, 10:04 UTC

Post by *HerbieH »

To umbra.

Thank you for your very informative answer. 8)

I thought, the \t issue was a clear bug, and that the special control characters were linked to one of the switches.
I do think this 'per design' behaviour is bad, without a switch to turn them on/off.

Greetings from
HerbieH*
-Keep on makin' music!
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48093
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

2umbra
Thanks, I can confirm the problem: In case of repeated searches, TC sets the cursor behind the current search result to avoid that the same result is found again.
Author of Total Commander
https://www.ghisler.com
User avatar
karlchen
Power Member
Power Member
Posts: 4603
Joined: 2003-02-06, 22:23 UTC
Location: Germany

Post by *karlchen »

Hello, Christian.

Bug reported by umbra reproduced using Total Commander 8.0ß25 64-bit.

The bug does no longer occur in Total Commander 8.0 rc1, 32-bit and 64-bit. Each "<pattern>" is found, none skipped, when repeating the search by using <ctrl>f repeatedly.

Cheers,
Karl
MX Linux 21.3 64-bit xfce, Total Commander 10.52 64-bit
The people of Alderaan keep on bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine.
The Prophet's Song
umbra
Power Member
Power Member
Posts: 871
Joined: 2012-01-14, 20:41 UTC

Post by *umbra »

Fixed in TC8 rc1, thanks.
Windows 7 Pro x64, Windows 10 Pro x64
User avatar
Flint
Power Member
Power Member
Posts: 3487
Joined: 2003-10-27, 09:25 UTC
Location: Antalya, Turkey
Contact:

Post by *Flint »

Confirm fixed.
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 10.52 / Win10 x64
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48093
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Thanks!
Author of Total Commander
https://www.ghisler.com
Post Reply