Confusing lack of search results

Please report only one bug per message!

Moderators: white, Hacker, petermad, Stefan2

Post Reply
rgom
Junior Member
Junior Member
Posts: 8
Joined: 2020-05-07, 07:37 UTC

Confusing lack of search results

Post by *rgom »

Hi all,
I have encountered weird behaviour for search, which costed me some time. Total Commander couldn't find text occurrences despite being there, unless I edited text manually.

Steps to reproduce:
1. Copy word from web page (in my case it was some word from gitlab code). The word I copied was StdOutStdErrTrap. EDIT: I copied the word by double clicking on it.
2. I pressed alt-f7 in Total Commander to search for the text. I pressed alt-t to find text and pasted my text there.
3. I pressed Start search and there were no results.

I had to delete invisible character from the end, then search was successful. I suppose CR (CRLF) character was copy-pasted and attempted to be used.

Expected behaviour: invisible characters are not accepted in text search.

Reproducible: always
Workaround: present

Version: 9.22a, Windows 10, browser: Firefox 76

I'll try to submit the bug, then attach screenshots.
Last edited by rgom on 2020-05-08, 06:47 UTC, edited 1 time in total.
rgom
Junior Member
Junior Member
Posts: 8
Joined: 2020-05-07, 07:37 UTC

Re: Confusing lack of search results

Post by *rgom »

rgom
Junior Member
Junior Member
Posts: 8
Joined: 2020-05-07, 07:37 UTC

Re: Confusing lack of search results

Post by *rgom »

Reproduced on 9.51.
User avatar
Usher
Power Member
Power Member
Posts: 1675
Joined: 2011-03-11, 10:11 UTC

Re: Confusing lack of search results

Post by *Usher »

2rgom
1. If I wanted to select a word, I would double click it.
2. You can use \t and \n in text for search. This behaviour is described in TC Help. However, it would be good to add an option to convert tabs and EOLs to spaces when pasting text from clipboard.
Andrzej P. Wozniak
Polish subforum moderator
rgom
Junior Member
Junior Member
Posts: 8
Joined: 2020-05-07, 07:37 UTC

Re: Confusing lack of search results

Post by *rgom »

Thank you for the feedback.
It seems I have forgotten to indicate that by "Copy word from page" I actually meant "Double click on web page to select word (which is the last in the line)", so yes, I did exactly that.
Still, the problem is that invisible characters can be accepted to text search field (which is not documented). I don't see a valid use case for that, so instead of being an option, I'd rather see <tab> and <crlf> replaced with \t and \n arbitrarily (well, stripping them would suit me as well).
I will update the bug report to include double click information.
Thank you.
User avatar
Usher
Power Member
Power Member
Posts: 1675
Joined: 2011-03-11, 10:11 UTC

Re: Confusing lack of search results

Post by *Usher »

Strange. Double click on this forum works for me with Firefox 52.9 and TC9.51 (both 32-bit), it works also with some gitlab python code. Firefox itself can copy text with formatting (for example, lists with bullets) rather that plain text, but it's not that case, I suppose.
Did you turn on edit mode for the gitlab code?
What about turning on Unicode UTF-16 and UTF-8 in TC search options?
Did you do tests in other browsers (Edge or Chrome) or on other websites? Some websites use JavaScript to block or change content passed to clipboard, some browser extensions may also operate on clipboard content.
Andrzej P. Wozniak
Polish subforum moderator
rgom
Junior Member
Junior Member
Posts: 8
Joined: 2020-05-07, 07:37 UTC

Re: Confusing lack of search results

Post by *rgom »

Thank you.
I can't reproduce it with GitHub, but can do with GitLab. Example link (literally first project I've found on net): https://gitlab.com/pgjones/quart/-/commit/49a70ed62ad1035dbdf884393dd6c70893484b14
When I copy any word which is last on a line (without dot) via double click, it gets copied with extra eol character, as confirmed with Notepad++ (pasted the text there). That's Firefox 76. In Edge on Chrome the problem doesn't exist.
That said, could TC prevent that? I can't tell under which circumstances I can get invisible characters copied to clipboard and I'd like it to be stripped/indicated.
User avatar
Usher
Power Member
Power Member
Posts: 1675
Joined: 2011-03-11, 10:11 UTC

Re: Confusing lack of search results

Post by *Usher »

It's a problem with Gitlab difs. There is no problem with hosted code itself, see other page for example:
https://gitlab.com/advian-oss/python-gobjectservicelib/-/blob/master/tests/test_service.py

I don't know whether it's a problem with Firefox (in formatting text or in JS engine) or with JS code on Gitlab webpage. However, I'm pretty sure that pages on Gitlab are "Best Viewed with Chromium" and were never tested in Firefox.

Tim Berners-Lee in Technology Review, July 1996 wrote:Anyone who slaps a "this page is best viewed with Browser X" label on a Web page appears to be yearning for the bad old days, before the Web, when you had very little chance of reading a document written on another computer, another word processor, or another network.
Andrzej P. Wozniak
Polish subforum moderator
User avatar
Dalai
Power Member
Power Member
Posts: 9352
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: Confusing lack of search results

Post by *Dalai »

It seems to depend on the browser and perhaps the enabled features. In my regular Firefox (52.9) I can't reproduce it, but when using a clean profile in the same version I can reproduce it. Could be some JS or DOM function/feature that tells the site when a user copies something to the clipboard, and modifies the contents in the process (I have that option disabled in my regular Firefox because it's not any web site's business if and when I copy something to the clipboard!).

Anyway, stripping invisible characters sounds like a good idea, but it must be possible to disable it! Keep in mind that spaces are invisible too, especially at the end of a string/line. Since any of these insivible characters can be inside a file, it must be possible to search for them.

[EDIT]
Typo
[/EDIT]


Regards
Dalai
Last edited by Dalai on 2020-05-08, 20:49 UTC, edited 1 time in total.
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
rgom
Junior Member
Junior Member
Posts: 8
Joined: 2020-05-07, 07:37 UTC

Re: Confusing lack of search results

Post by *rgom »

Maybe instead of "invisible" I should consistently use "non-printable". Space is printable, so is safe. CRLF - no. Tab? Good luck distinguishing it visually in the text (and you can't type it in).
And for me it would be perfectly fine to replace crlf with \n and tab with \t in search box, unconditionally.
I answer yes to the following question:
- would I like the behaviour to be changed? (yes, because it took me by surprise)
I answer no to the following question:
- would an option to conditionalize it be useful?
I answer don't know to the following question:
- should it be generalized for other (non-printable/invisible/unicode/...) characters?

Regards
User avatar
Dalai
Power Member
Power Member
Posts: 9352
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: Confusing lack of search results

Post by *Dalai »

Yes, replacing CRLF, LF, CR and TAB would also be possible because TC needs \n or \t anyway to find any of them.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Post Reply