fsearch icon indicating copy to clipboard operation
fsearch copied to clipboard

[BUG] found characters are not applyed bold

Open Golddouble opened this issue 2 years ago • 10 comments

Describe the bug When I use not Regex for searching, then the searched characters are marked in the path and files in bold font. When I do the same with Regex there are some cases, where the characters are not marked bold.

To Reproduce You can see in the picture an example: ksnip_20211229-165607

Expected behavior My expectation is, that the path is bold and also "558" is bold. But all is in normal font.

Desktop (please complete the following information):

  • OS: MX Linux 19.4
  • MX package installer
  • Version 0.1

Edit: To be more precise: This seems to happen, when one Regex string is in the path and the other in the file name. If both is in the file name or both is in the path, then the characters are marked bod.

Golddouble avatar Dec 29 '21 16:12 Golddouble

Yes, that's a known issue when the highlighted part applies to both file name and path. It's not even exclusive to regex mode, it also happens with wildcards.

I'll see what I can do about it. Seems like it should be relatively easy to fix.

cboxdoerfer avatar Dec 30 '21 14:12 cboxdoerfer

It looks like I have found another case, where FSearch does not mark correct bold, what it has found: ksnip_20220101-153704

Shouldn't both "a" be bold in "aas1901" ?

Golddouble avatar Jan 01 '22 14:01 Golddouble

This is a further example: ksnip_20220104-135636

Golddouble avatar Jan 04 '22 12:01 Golddouble

Is this result really as it should be?: ksnip_20220104-170340

My expectation was, that it would not find for example $I8CTTC9.pdf because the regex command says: "Do find files, that do not have "p" or "d" or "f" in its name". But $I8CTTC9.pdf has for example a "p" in its name. So I guess this file should not have been found?

I could be wrong. Do I miss anything?

Golddouble avatar Jan 04 '22 16:01 Golddouble

Is this result really as it should be?: ksnip_20220104-170340

Yes.

My expectation was, that it would not find for example $I8CTTC9.pdf because the regex command says: "Do find files, that do not have "p" or "d" or "f" in its name". But $I8CTTC9.pdf has for example a "p" in its name. So I guess this file should not have been found?

No, the regex says: Match any character multiple times followed by a character which is not p, d or f. So in your example the .* matches $$I8CTTC9 and [^pdf]the following ., because it's neither p, d or f.

cboxdoerfer avatar Jan 04 '22 17:01 cboxdoerfer

It looks like I have found another case, where FSearch does not mark correct bold, what it has found: ksnip_20220101-153704

Shouldn't both "a" be bold in "aas1901" ?

Yes, I can confirm that. I'll have a look at it. My guess is that this is caused by the fact that FSearch uses different regular expression libraries for matching and highlighting.

cboxdoerfer avatar Jan 04 '22 17:01 cboxdoerfer

Thank you for your answers.

relating to the example with .*[^pdf]: Oh yes, I see. Thank you. Of course this works in FSearch as it should. Sorry.

relating to the example with

This is a further example: ksnip_20220104-135636

This looks fine to me, what's the issue there?

In this example Regex gives results with "ab" and "ac". So my expectation was, that in "ab" "a" is marked bold and also "b". And in "ac", that "a" is marked bold and also "c" is marked bold. But FSearch does only mark "b" bold in "ab". And only "c" in "ac".

Golddouble avatar Jan 04 '22 19:01 Golddouble

Thank you for your answers.

relating to the example with .*[^pdf]: Oh yes, I see. Thank you. Of course this works in FSearch as it should. Sorry.

No problem. If you really want to exclude files with certain patterns, you should look at negative look-ahead regular expressions. For example to list everything except PDF files, you can use something like this: ^(?!.*\.pdf$)

In this example Regex gives results with "ab" and "ac". So my expectation was, that in "ab" "a" is marked bold and also "b". And in "ac", that "a" is marked bold and also "c" is marked bold. But FSearch does only mark "b" bold in "ab". And only "c" in "ac".

Ah yes, you're right. That's definitely a bug. Thanks!

cboxdoerfer avatar Jan 05 '22 14:01 cboxdoerfer

Similar issue with: abc(?=.*a6)

Fsearch version 0.1

Golddouble avatar Jul 17 '22 17:07 Golddouble

All those issues (mismatching regex search results and highlights and issues when highlighting applies to both path and name) have already been fixed in the 0.2alpha builds. I'm planing to release 0.2 at the end of next month.

cboxdoerfer avatar Jul 17 '22 17:07 cboxdoerfer

0.2 with the fixes is no available. Closing the issue.

cboxdoerfer avatar Aug 20 '22 16:08 cboxdoerfer