fsearch
fsearch copied to clipboard
[BUG] found characters are not applyed bold
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:
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.
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.
It looks like I have found another case, where FSearch does not mark correct bold, what it has found:
Shouldn't both "a" be bold in "aas1901" ?
This is a further example:
Is this result really as it should be?:
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?
Is this result really as it should be?:
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
.
It looks like I have found another case, where FSearch does not mark correct bold, what it has found:
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.
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:
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".
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!
Similar issue with:
abc(?=.*a6)
Fsearch version 0.1
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.
0.2 with the fixes is no available. Closing the issue.