| View previous topic :: View next topic |
| Author |
Message |
umbra Power Member

Joined: 14 Jan 2012 Posts: 656
|
Posted: Sat Apr 14, 2012 6:20 am Post subject: Text search in lister may skip some matches |
|
|
Imagine the following text file: | Quote: | <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: | Quote: | <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 8 Pro x64 |
|
| Back to top |
|
 |
HerbieH Junior Member


Joined: 11 Feb 2003 Posts: 42
|
Posted: Sat Apr 14, 2012 4:05 pm Post subject: |
|
|
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! |
|
| Back to top |
|
 |
umbra Power Member

Joined: 14 Jan 2012 Posts: 656
|
Posted: Sat Apr 14, 2012 4:54 pm Post subject: |
|
|
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:
| Quote: | 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 8 Pro x64 |
|
| Back to top |
|
 |
Flint Power Member


Joined: 27 Oct 2003 Posts: 2867 Location: Moscow, Russia
|
Posted: Sun Apr 15, 2012 2:35 pm Post subject: |
|
|
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, other stuff!
Using TC 8.01 / Win7 x64 SP1 |
|
| Back to top |
|
 |
HerbieH Junior Member


Joined: 11 Feb 2003 Posts: 42
|
Posted: Mon Apr 16, 2012 3:25 am Post subject: |
|
|
To umbra.
Thank you for your very informative answer.
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! |
|
| Back to top |
|
 |
ghisler(Author) Site Admin


Joined: 04 Feb 2003 Posts: 24590 Location: Switzerland
|
Posted: Mon Apr 16, 2012 8:50 am Post subject: |
|
|
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
http://www.ghisler.com |
|
| Back to top |
|
 |
karlchen Power Member


Joined: 06 Feb 2003 Posts: 4035 Location: Germany
|
Posted: Fri Apr 27, 2012 3:12 pm Post subject: |
|
|
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 _________________ Enlightened by Lucid Lynx, enchanted by Maya Mint, productive on Precise Pangolin's Minty Sister. |
|
| Back to top |
|
 |
umbra Power Member

Joined: 14 Jan 2012 Posts: 656
|
Posted: Sat Apr 28, 2012 4:12 am Post subject: |
|
|
Fixed in TC8 rc1, thanks. _________________ Windows 7 Pro x64, Windows 8 Pro x64 |
|
| Back to top |
|
 |
Flint Power Member


Joined: 27 Oct 2003 Posts: 2867 Location: Moscow, Russia
|
Posted: Sat Apr 28, 2012 5:01 am Post subject: |
|
|
Confirm fixed. _________________ Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, other stuff!
Using TC 8.01 / Win7 x64 SP1 |
|
| Back to top |
|
 |
ghisler(Author) Site Admin


Joined: 04 Feb 2003 Posts: 24590 Location: Switzerland
|
Posted: Mon Apr 30, 2012 7:37 am Post subject: |
|
|
Thanks! _________________ Author of Total Commander
http://www.ghisler.com |
|
| Back to top |
|
 |
|