tantiny 0.4.1 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/Cargo.toml +1 -1
- data/lib/tantiny/version.rb +1 -1
- data/lib/tantiny.so +0 -0
- data/src/query.rs +9 -2
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c687129e0e6f9b4ed586cbdf6dac036e5e15bfc1acba54315688179430c68ba7
|
|
4
|
+
data.tar.gz: 2738e1e30e118035bc92382282b77f726300dd69bd1e6284f9831c3ee9349e60
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cea8e693d0cc014ce22bb3ab8f419e8ce31b448d81ba41205fa1114367279826071d04036529f6e95d386f32775d3c8e4aed8bc87896dc89b085496d1e3026ca
|
|
7
|
+
data.tar.gz: 36ae0a91d8339ffb694824c9157180ef12d05aa3e173ebd172e65bfce952e5bd8fc89b8e056f8ee040c5e4ca83ade238e8033ad17608c213b382a6fd959b1227
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.4.2](https://github.com/altertable-ai/tantiny/compare/tantiny/v0.4.1...tantiny/v0.4.2) (2025-11-04)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **highlighting:** only highlight the matching prefix ([#9](https://github.com/altertable-ai/tantiny/issues/9)) ([8ce9bbe](https://github.com/altertable-ai/tantiny/commit/8ce9bbe56392ed055b56ee7118427e41c1140222))
|
|
9
|
+
|
|
3
10
|
## [0.4.1](https://github.com/altertable-ai/tantiny/compare/tantiny/v0.4.0...tantiny/v0.4.1) (2025-11-03)
|
|
4
11
|
|
|
5
12
|
|
data/Cargo.toml
CHANGED
data/lib/tantiny/version.rb
CHANGED
data/lib/tantiny.so
CHANGED
|
Binary file
|
data/src/query.rs
CHANGED
|
@@ -272,16 +272,23 @@ impl Query {
|
|
|
272
272
|
.last()
|
|
273
273
|
.map(|last_token| token_text.starts_with(last_token))
|
|
274
274
|
.unwrap_or(false);
|
|
275
|
-
let should_highlight = fuzzy_match || prefix_match;
|
|
276
275
|
|
|
277
276
|
// Add the text before the token
|
|
278
277
|
result.push_str(&text[last_pos..start]);
|
|
279
278
|
|
|
280
279
|
// Add the token, highlighted if it matches
|
|
281
|
-
if
|
|
280
|
+
if fuzzy_match {
|
|
282
281
|
result.push_str("<b>");
|
|
283
282
|
result.push_str(&text[start..end]);
|
|
284
283
|
result.push_str("</b>");
|
|
284
|
+
} else if prefix_match {
|
|
285
|
+
let last_token = query_tokens
|
|
286
|
+
.last()
|
|
287
|
+
.expect("Last token is present when prefix_match");
|
|
288
|
+
result.push_str("<b>");
|
|
289
|
+
result.push_str(&text[start..start + last_token.len()]);
|
|
290
|
+
result.push_str("</b>");
|
|
291
|
+
result.push_str(&text[start + last_token.len()..end]);
|
|
285
292
|
} else {
|
|
286
293
|
result.push_str(&text[start..end]);
|
|
287
294
|
}
|