+[8.50b2] "Search with Google" is not always worki

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

Moderators: Hacker, petermad, Stefan2, white

Post Reply
ferhat
Junior Member
Junior Member
Posts: 54
Joined: 2013-09-03, 06:29 UTC

+[8.50b2] "Search with Google" is not always worki

Post by *ferhat »

While working with the new google search of Lister I have detected that in some cases it does not start the web browser to perform search.
I have done a little boundary check to understand this behavior.
I have done the following tests with different browser. Its always the same behavior.

My environment:
---------------------
1)WinXP 32 Bit SP3
2) Win8 64Bit

Steps:
---------
1) Create first text file with 228 times the character a
2) Create second text file with 229 times the character a
3) View the content of first file with Lister, select the whole chars and perform a google search
4) View the content of second file with Lister, select the whole chars and perform a google search


You will see that step 3 will work as expected.
Doing step 4 will not perform a google search.

Additional information:
1)
In my first environment (1) the Lister window is always freezing for about 10 seconds while doing step 4

2)
I have seen that selecting a text with more than 255 character will not show the context menu entry for doing google search. Is this an expected behavior? AFAIK Google allows more than 255 chars in a search query.

3)
I have checked the whole process with process monitor.
Both "step 3" and "step 4" start a new thread for doing the search.
While doing "step 3" I am able to see that my default browser is started by using the API ShellExecute.
While doing "step 4" the thread is terminated before it can call the API ShellExecute



Thanks,
Ferhat
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50541
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

I can reproduce the problem. There is currently an arbitrary limit of 255 characters, I don't know where 229 comes from. I will try to increase the limit a bit - I didn't expect that anyone would make a search for such a long string...
Author of Total Commander
https://www.ghisler.com
ferhat
Junior Member
Junior Member
Posts: 54
Joined: 2013-09-03, 06:29 UTC

Post by *ferhat »

I have checked it with Beta 3 right now.
You have increased the limit but didn't fix the issue at all.

My opinion:
As long as I can see the entry "Search for selected text with Google" in the context menu I assume that I am able to search/ use this feature.
Currently this is not true when you select very long texts.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50541
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

???
The menu items isn't shown now when the string is too long.
Author of Total Commander
https://www.ghisler.com
ferhat
Junior Member
Junior Member
Posts: 54
Joined: 2013-09-03, 06:29 UTC

Post by *ferhat »

Not really....
Your fix works only for TC 32 Bit. The error is still existing inside TC 64Bit.

I have done the following tests:

Test 1:
-------------
1) Create a text file with 1000 chars e.g. 'aaaaa....'
2) Start TC 32Bit
3) Select 980 chars
4) Right click with mouse

observed:
The context menu entry is shown and is working very well!
If I select 981 chars the context menu entry is hidden.

Test 2:
-------------
1) Create a text file with 1000 chars e.g. 'aaaaa....'
2) Start TC 64Bit
3) Select 991 chars
4) Right click with mouse

observed:
The context menu entry is shown and its working but if you select 992 chars the context menu entry is still shown but clicking on "Search for selected text in Google" doesn't do anything!


Thanks,
Ferhat
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50541
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Ah, yes, I set the limit originally to 1000, but reduced it to 980 because the command is longer. Unfortunately I cannot predict the exact length, so it will just do nothing if the line becomes too long. This is intentional.
Author of Total Commander
https://www.ghisler.com
ferhat
Junior Member
Junior Member
Posts: 54
Joined: 2013-09-03, 06:29 UTC

Post by *ferhat »

Hmm just doing nothing sounds bad.
It would be a better solution if you could hide the context menu entry (like in TC 32Bit) if you detect that the selected text is longer than 980 chars.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50541
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Yes, that's the plan...
Author of Total Commander
https://www.ghisler.com
ferhat
Junior Member
Junior Member
Posts: 54
Joined: 2013-09-03, 06:29 UTC

Post by *ferhat »

Ahh, great!
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50541
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Please try with TC 64-bit too!
Author of Total Commander
https://www.ghisler.com
ferhat
Junior Member
Junior Member
Posts: 54
Joined: 2013-09-03, 06:29 UTC

Post by *ferhat »

Hi,

it's not fixed yet (correctly).
I have found a new way to reproduce it with TC 32 and 64Bit
Use the file which I have posted using pastebin.
http://pastebin.com/download.php?i=1P88WtTu

Steps:
1) Select the whole content
2) right click with mouse
3) choose google search....


observed:
the context menu entry appears but clicking on it does nothing.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50541
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

This is one of the rare cases where TC has to convert characters to %hex values. This can make the text longer than allowed. Unfortunately I cannot check this while the context menu is created, so you will have to live with it.
Author of Total Commander
https://www.ghisler.com
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50541
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

I'm moving this to "Will not be changed".
Author of Total Commander
https://www.ghisler.com
Post Reply