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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3aeb0d870c24b42e8bf9b607e6ccb6bccff26b0f5f671a84e248d5465008d268
4
- data.tar.gz: ea8fc4e425bdeeeb16d6a7db8be220b2742ad9c035b1b1a8c4c365a4ac0cd0f1
3
+ metadata.gz: c687129e0e6f9b4ed586cbdf6dac036e5e15bfc1acba54315688179430c68ba7
4
+ data.tar.gz: 2738e1e30e118035bc92382282b77f726300dd69bd1e6284f9831c3ee9349e60
5
5
  SHA512:
6
- metadata.gz: cf150617442ea2f5829de2a1e4e514310295775cfaad414f9438815fd9a5ab5746d161b69fcb87da1d8ee9a8fbf68b3b7a033f76f49a639e35d06633cc9dddda
7
- data.tar.gz: 3a29e2db6f5ba7a71385185058b082ca2420a5dec2805bab73e947c8532ef6f67fde38a61f0d4bf2ef1ced0506e29b7ec75575b58fe7cb3dcaf7e9ef6b07ef25
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
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "tantiny"
3
- version = "0.4.1" # {x-release-please-version}
3
+ version = "0.4.2" # {x-release-please-version}
4
4
  edition = "2021"
5
5
  authors = ["Sylvain Utard", "Alexander Baygeldin"]
6
6
  repository = "https://github.com/altertable-ai/tantiny"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tantiny
4
- VERSION = "0.4.1" # {x-release-please-version}
4
+ VERSION = "0.4.2" # {x-release-please-version}
5
5
  end
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 should_highlight {
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
  }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tantiny
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sylvain Utard