Total Commander Forum Index Total Commander
Forum - Public Discussion and Support
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Text search in lister may skip some matches

 
Post new topic   Reply to topic    Total Commander Forum Index -> TC Fixed bugs Printable version
View previous topic :: View next topic  
Author Message
umbra
Power Member
Power Member


Joined: 14 Jan 2012
Posts: 656

PostPosted: Sat Apr 14, 2012 6:20 am    Post subject: Text search in lister may skip some matches Reply with quote

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
View user's profile Send private message Send e-mail
HerbieH
Junior Member
Junior Member


Joined: 11 Feb 2003
Posts: 42

PostPosted: Sat Apr 14, 2012 4:05 pm    Post subject: Reply with quote

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
View user's profile Send private message
umbra
Power Member
Power Member


Joined: 14 Jan 2012
Posts: 656

PostPosted: Sat Apr 14, 2012 4:54 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Flint
Power Member
Power Member


Joined: 27 Oct 2003
Posts: 2867
Location: Moscow, Russia

PostPosted: Sun Apr 15, 2012 2:35 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
HerbieH
Junior Member
Junior Member


Joined: 11 Feb 2003
Posts: 42

PostPosted: Mon Apr 16, 2012 3:25 am    Post subject: Reply with quote

To umbra.

Thank you for your very informative answer. Cool

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
View user's profile Send private message
ghisler(Author)
Site Admin
Site Admin


Joined: 04 Feb 2003
Posts: 24590
Location: Switzerland

PostPosted: Mon Apr 16, 2012 8:50 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
karlchen
Power Member
Power Member


Joined: 06 Feb 2003
Posts: 4035
Location: Germany

PostPosted: Fri Apr 27, 2012 3:12 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
umbra
Power Member
Power Member


Joined: 14 Jan 2012
Posts: 656

PostPosted: Sat Apr 28, 2012 4:12 am    Post subject: Reply with quote

Fixed in TC8 rc1, thanks.
_________________
Windows 7 Pro x64, Windows 8 Pro x64
Back to top
View user's profile Send private message Send e-mail
Flint
Power Member
Power Member


Joined: 27 Oct 2003
Posts: 2867
Location: Moscow, Russia

PostPosted: Sat Apr 28, 2012 5:01 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
ghisler(Author)
Site Admin
Site Admin


Joined: 04 Feb 2003
Posts: 24590
Location: Switzerland

PostPosted: Mon Apr 30, 2012 7:37 am    Post subject: Reply with quote

Thanks!
_________________
Author of Total Commander
http://www.ghisler.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Total Commander Forum Index -> TC Fixed bugs All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Impressum: This site is maintained by Ghisler Software GmbH

Using phpBB © 2001-2005 phpBB Group