Alt+F7 Search results misleading

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: white, Hacker, petermad, Stefan2

Post Reply
mihaipi
Junior Member
Junior Member
Posts: 10
Joined: 2006-11-28, 11:28 UTC

Alt+F7 Search results misleading

Post by *mihaipi »

I think it is related to a previous report - http://www.ghisler.ch/board/viewtopic.php?t=26156

Searching for Load\n or Edit\n gives false results - files without that string and misses files with that string. No options selected, just Alt+F7 inside the folder and that text entered in 'Find text' field.

My test folder is 'ui_igo8' from an Igo skin - Dimka.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48231
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Unfortunately I cannot reproduce the problem.

I downloaded the file from
http://www.igo8mods.com/diMkaspecter1533a.zip

Only one file containing Edit\n is found (Edit followed by a hard line break):
ui_igo8\common\ui\poi.ui
contains the line:
NEXTSTATE st_ManagePOIEdit

No file containing Load\n is found.

Can you give me examples of files which should be found but aren't?

Maybe you just have "word wrap" enabled, so it looks like the line ends with Edit or Load, but really doesn't?
Author of Total Commander
https://www.ghisler.com
mihaipi
Junior Member
Junior Member
Posts: 10
Joined: 2006-11-28, 11:28 UTC

Post by *mihaipi »

Sorry, try http://www.igo8mods.com/diMkaWertVRV_1139.rar

Searching for Load\n you get as result
ui_igo8\common\ui\start.ui and speedcam.ui , but none of them contain that string.

You should find this string in \ui_igo8\480_800\ui\advmenu_480_800.ui and 2 more files, line 165.

Searching for the same string, but with Unicode selected, I get 0 results.

Additionally:
Searching for Load\ has as result the 3 files advmenu_***, but if I enable unicode I get 0 results.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48231
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

I see - this is just a big misunderstanding. When you use
Load\n
as search string, TC will search for the word "Load" followed by a line break. Also \t will find a tab character. So just look for
Load\\n
instead.
with Unicode selected, I get 0 results
The files are not Unicode UTF-16, but UTF-8. So if you check UTF-8, you will get the same results as in text mode, because the search string doesn't contain any Unicode characters.
Author of Total Commander
https://www.ghisler.com
User avatar
MVV
Power Member
Power Member
Posts: 8704
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

ghisler(Author) wrote:I see - this is just a big misunderstanding. When you use
Load\n
as search string, TC will search for the word "Load" followed by a line break. Also \t will find a tab character. So just look for
Load\\n
instead.
I think TC search dialogs should have checkbox 'Use Escapes' so user can disable such non-obvious feature. And, sometimes user just doesn't need to search with escapes but w/o such checkbox he must double all slashes - sometimes it is boring (e.g. I want to search for C:\dir1\dir2\dir3\...\file1.ext).
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48231
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Sorry, it has been like this for many many years, I will not change that now.
Author of Total Commander
https://www.ghisler.com
mihaipi
Junior Member
Junior Member
Posts: 10
Joined: 2006-11-28, 11:28 UTC

Post by *mihaipi »

I understand why this happened, but as MVV said, I was looking for that exact text string. Some checkbox could fix this 'grammar' problems, or just a warning...
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48231
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

How do you imagine that? An error dialog each time the user types a backslash? That would be extremely annoying. :(
Author of Total Commander
https://www.ghisler.com
User avatar
MVV
Power Member
Power Member
Posts: 8704
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Maybe you can add third state for RegEx checkbox and change its caption?

So, unchecked (with caption like 'Esc/RegEx') = search for exact text, grayed (with caption like 'Esc') = search for escaped text, checked (with caption 'RegEx') = search for regular expression. Regex and escapes can't be combined anyway so such way will allow to use same checkbox for both functions (both 'RegEx' checkboxes in search for text Lister's dialog and search files dialog may be modified this way).

I think people will like such modification (especially if you add some INI option with values: '0: two-state regex checkboxes, old-school behaviour' or '1: tho-state regex checkboxes, search for plain text if unchecked' or '2: three-state regex checkboxes').

Maybe this will be a great innovation for TC 8.0? :wink:
I think such feature should be easy to realize since you already have all its possibilities, you just need to enable/disable them when needed.
Post Reply