diff options
-rw-r--r-- | CHANGELOG.md | 3 | ||||
-rw-r--r-- | Cargo.lock | 8 | ||||
-rw-r--r-- | Cargo.toml | 4 | ||||
-rw-r--r-- | src/pattern/fuzzy_pattern.rs | 24 |
4 files changed, 29 insertions, 10 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 684e4ad..62a6b74 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +### next +- fix fuzzy patterns not case insensitive on some characters - Fix #746 + ### v1.25.2 - 2023-09-20 <a name="v1.25.2"></a> - optional BROOT_CONFIG_DIR env var - the site now shows all env variables: https://dystroy.org/broot/launch/#environment-variables @@ -234,7 +234,7 @@ dependencies = [ "image", "include_dir", "is_executable", - "lazy-regex 3.0.1", + "lazy-regex 3.0.2", "lfs-core", "libc", "memmap2", @@ -1173,9 +1173,9 @@ dependencies = [ [[package]] name = "lazy-regex" -version = "3.0.1" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57451d19ad5e289ff6c3d69c2a2424652995c42b79dafa11e9c4d5508c913c01" +checksum = "e723bd417b2df60a0f6a2b6825f297ea04b245d4ba52b5a22cb679bdf58b05fa" dependencies = [ "lazy-regex-proc_macros 3.0.1", "once_cell", @@ -2266,7 +2266,7 @@ dependencies = [ "coolor", "crossbeam", "crossterm", - "lazy-regex 3.0.1", + "lazy-regex 3.0.2", "minimad 0.13.0", "serde", "thiserror", @@ -42,7 +42,7 @@ glob = "0.3" id-arena = "2.2.1" image = "0.24" include_dir = "0.7" -lazy-regex = "3.0.1" +lazy-regex = "3.0.2" libc = "0.2" memmap2 = "0.6" once_cell = "1.7" @@ -51,7 +51,7 @@ pathdiff = "0.2" phf = { version = "0.10", features = ["macros"] } rayon = "1.7" resvg = "0.35" -secular = { version = "1.0", features = ["normalization"] } +secular = { version = "1.0", features = ["normalization", "bmp"] } serde = { version = "1.0", features = ["derive"] } smallvec = "1.9" splitty = "1.0" diff --git a/src/pattern/fuzzy_pattern.rs b/src/pattern/fuzzy_pattern.rs index 633d176..12aaec2 100644 --- a/src/pattern/fuzzy_pattern.rs +++ b/src/pattern/fuzzy_pattern.rs @@ -363,18 +363,34 @@ mod fuzzy_pattern_tests { } } } - check_equivalences_in(&["aB", + check_equivalences_in(&[ + "aB", "ab", "àb", - "âB"]); + "âB", + ]); let c12 = "Comunicações"; assert_eq!(c12.len(), 14); assert_eq!(c12.chars().count(), 12); let c14 = "Comunicações"; assert_eq!(c14.len(), 16); assert_eq!(c14.chars().count(), 14); - check_equivalences_in(&["comunicacoes", + check_equivalences_in(&[ + "comunicacoes", c12, - c14]); + c14, + ]); + check_equivalences_in(&[ + "у", + "У", + ]); + } + /// check that there's no problem with ignoring case on cyrillic. + /// This problem arises when secular was compiled without the "bmp" feature. + /// See https://github.com/Canop/broot/issues/746 + #[test] + fn issue_746() { + let fp = FuzzyPattern::from("устр"); + assert!(fp.find("Устройства").is_some()); } } |