klogg icon indicating copy to clipboard operation
klogg copied to clipboard

Bug with recent searches: 'Don't Match Case' option applied to special (escaped) characters

Open reflekteur opened this issue 4 years ago • 2 comments

Specifically the issue occurs with 'Match case' toggle turned off. The search box then considers queries abc\d{5} and abc\D{5} to be the same query and just pulls the previous search results from the cache.

Desired behaviour: Search respects 'Don't Match Case' option for the regular letters, but still correctly identifies special characters (like 'digit'/'not digit' in this particular example) and interprets abc\D{5} as a distinct query.

Useful extra information
-------------------------
> Klogg version 20.12.0.813 (built on 2020-12-24 from commit 576b91d) [built for x86_64-little_endian-llp64]
> running on Windows 10 Version 2009 (winnt/10.0.19043) [x86_64]
> and Qt 5.15.2

reflekteur avatar Aug 19 '21 13:08 reflekteur

Thanks, good catch.

variar avatar Aug 19 '21 13:08 variar

@reflekteur unfortunately, this looks impossible to fix using current auto-completion provided by Qt. QCompleter does not allow to customize string comparison function. It might be possible with some custom widgets. While I continue to investigate, there is a workaround: set klogg to case-sensitive mode and disable case sensitivity in pattern itself using (?i) so in your examples patterns will be

(?i)abc\D{5}
(?i)abc\d{5}

variar avatar Aug 29 '21 07:08 variar