120 Commits

Author SHA1 Message Date
Jesse Luehrs
5b74652e48 allow reversing the input order
this doesn't actually reverse the stored order, it just adds additional
sorting by the item index
2025-05-23 12:07:40 +02:00
Jesse Luehrs
a4292950b8 allow disabling sorting of search results 2025-05-23 12:07:40 +02:00
Jesse Luehrs
61f2a4e482 also sort results for empty patterns
there are no scores in this case, but it still makes tiebreak handling
more consistent
2025-05-23 12:07:40 +02:00
Jesse Luehrs
d0d6b3a584 factor match sorting into a separate method 2025-05-23 12:07:40 +02:00
Yash Thakur
dc3054066d Fix case-sensitive prefix matching (#71) 2025-03-13 00:35:48 +01:00
Alexandre Pasmantier
c754da51d5 add an extend method to Nucleo's injector (#74)
* feat(injector): add an `extend` method to Nucleo's injector

* Update lib.rs

Co-authored-by: Michael Davis <mcarsondavis@gmail.com>

* remove benches and #73 patch

* udpates following pascalkuthe's review

* simplification

* adding tests

* remove unused method

---------

Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
2025-02-14 10:34:16 +01:00
Alex Rutar
9918bddeed Delete unused files and commented-out code blocks (#68)
* Delete unused file `utf32_string.rs`

* Delete unused file `matcher.rs`

* Delete unused commented-out code block
2024-12-15 15:09:03 +01:00
Alex Rutar
c36c355518 Manually implement Default to fix compilation with --no-default-features (#69) 2024-12-14 14:37:04 +01:00
Pascal Kuthe
d17e29af01 Merge pull request #61 from rutar-forks/handle-windows-newline 2024-12-07 22:18:32 +01:00
Alex Rutar
21fc173b6d Improvements to grapheme truncation for Utf32Str(ing)
This commit corrects the internal handling of grapheme truncation. Most
notably, it fixes two bugs with the previous implementation of
Utf32Str(ing):

1. Fixes a bug where an Ascii variant could have been returned even
   though the original string was not ASCII. (The converse, where a
   Unicode variant consists only of ASCII, is totally fine).
2. Fixes the handling of windows-style newline (i.e. `\r\n`)
   since these are single graphemes. Moreover, the `\r\n` grapheme is
   now mapped to `\n` rather than `\r`. In particular, Utf32Str(ing)s
   constructed from text containing windows-style newlines will result
   in Unicode variants, even if the string is entirely valid Ascii.
2024-12-07 20:35:37 +00:00
Pascal Kuthe
474edc7459 Merge pull request #54 from rutar-forks/delete-ignored-cargo-lock 2024-12-07 18:36:28 +01:00
Pascal Kuthe
7ef5c43a2c Merge pull request #60 from rutar-forks/fix-latin-normalization 2024-12-07 18:36:08 +01:00
Alex Rutar
2200109f32 Improve latin normalization
This improves the normalization for Latin characters by adding a
number of new normalizations, especially in the 'Latin Extended
Additional' block which for some reason was missing every capital
letter.

I did not add normalizations in any new Unicode blocks, but I did
slightly extend the 'Latin 1' block to also capture some of the
subscripts; this is for consistency with the 'Subscripts and
Superscripts' block which was previously handled. I also preserved
the actual implementation of the `normalize` function in terms of
the check order, etc. In particular, the generated code should be
approximately the same. To verify this, I ran some crude
benchmarks on a variety of input (all ASCII, sparse Unicode, heavy
Unicode, all outside normalizatio ranges) and there was no
observable difference, but definitely not super rigorous.

Finally, I inlined all of the char blocks, rather than replying on
the 'sparse table' static generation which was implemented
earlier. In particular, `normalization` is now a `const fn`. At
least in my mind it is a bit easier to read in this form. It also
makes it much clearer when characters are missed.
2024-12-07 17:35:38 +00:00
Pascal Kuthe
f64f3eeabb Merge pull request #65 from rutar-forks/prompt-parse-split 2024-12-07 18:31:27 +01:00
Alex Rutar
15e07ffb88 Remove Cargo.lock from .gitignore file 2024-12-07 17:31:08 +00:00
Alex Rutar
eb2e46f172 Fix new clippy lint 'explicit lifetimes could be elided' 2024-12-07 17:20:52 +00:00
Alex Rutar
dfb82eefa8 Split pattern using is_whitespace property instead of on ASCII space 2024-12-07 17:16:05 +00:00
Pascal Kuthe
f13f2dc940 fix CI 2024-12-07 17:50:28 +01:00
Pascal Kuthe
da34dc6912 Merge pull request #37 from trueNAHO/patch-1 2024-12-07 17:46:33 +01:00
Pascal Kuthe
5e5c93df9b Merge pull request #55 from rutar-forks/doc-typo-fixes 2024-12-07 17:45:42 +01:00
Alex Rutar
8a56371d51 Fix minor documentation typos 2024-12-07 16:44:17 +00:00
Pascal Kuthe
ef24853e31 Merge pull request #57 from rutar-forks/expose-global-match-index
Expose match objects from the snapshot
2024-11-12 15:17:30 -08:00
Alex Rutar
5c722a6500 Fix clippy lint: unannotated transmute 2024-11-12 15:57:03 +02:00
Alex Rutar
74ec935c94 Expose match objects from the snapshot 2024-11-12 11:01:43 +01:00
slekup
6df3cd0b39 Update lib.rs (#46) 2024-05-24 09:33:53 +02:00
Pascal Kuthe
a82a24999b allow access to injected item while creating filter text 2024-04-02 02:32:16 +02:00
blinxen
2ca3e10350 [matcher] Remove unused dev-dependency (#42) 2024-03-31 01:13:50 +01:00
Pascal Kuthe
0d2403a7a4 release v0.4.1 2024-03-11 01:21:25 +01:00
Pascal Kuthe
e31950f5b5 clear in-flight matches when restarting picker 2024-03-11 01:16:56 +01:00
Pascal Kuthe
e9cca9fd56 fixup changelog nucleo-v0.4.0 2024-02-20 20:21:17 +01:00
Pascal Kuthe
355938f0ee release version 0.4 2024-02-20 19:06:59 +01:00
Pascal Kuthe
ff688ee1b8 fix clippy lint 2024-02-20 19:06:58 +01:00
Pascal Kuthe
980413f0da expose number of active injectors from matcher 2024-02-20 18:46:53 +01:00
Pascal Kuthe
88a0853025 add note to docs about using the high level nucleo crate 2024-02-20 17:40:27 +01:00
Pascal Kuthe
3d46b62546 fix false positives for unicode substring matcher 2024-02-20 17:34:51 +01:00
NAHO
44e711b548 docs(readme): capitalize 'Rust' 2024-01-21 17:28:29 +01:00
Pascal Kuthe
c7893db4b4 fix Unicode substring match requiring exact match 2023-12-22 20:04:20 +01:00
Pascal Kuthe
4a04baf6ba fixup benchmark 2023-12-22 19:47:10 +01:00
Pascal Kuthe
2a0fe11e39 release version 0.3.0 nucleo-v0.3.0 2023-12-22 19:44:50 +01:00
Pascal Kuthe
13853d81be fixup release date 2023-12-22 19:40:04 +01:00
Pascal Kuthe
34553f009d fix substring matching Unicode haystacks (#34) 2023-12-22 19:32:42 +01:00
Pascal Kuthe
1edf451192 Correctly handle normalization in pattern API 2023-12-22 19:31:34 +01:00
Riccardo Mazzarini
b41c989daf fix short circuiting logic when doing exact matches (#32)
* fix short circuiting logic in the `exact` module

* add tests for single char needles

* add bugfix to the CHANGELOG
2023-12-17 17:27:10 +01:00
a-kenji
abf7454f4b Fix small typo (#31) 2023-11-01 16:02:13 +01:00
blinxen
e86f523e33 Fix file name and excluded no needed files in Cargo.toml (#30)
* Fix typo in file name

* Exclude files that don't need to be published on crates.io
2023-10-20 19:12:32 +02:00
Pascal Kuthe
74d789c8e3 Merge pull request #28 from blinxen/master 2023-10-15 22:22:27 +02:00
Pascal Kuthe
831f502df3 Merge pull request #29 from blinxen/remove-unused-dep 2023-10-15 22:13:08 +02:00
blinxen
9454f25325 Fix linter errors 2023-10-15 20:46:27 +02:00
blinxen
dfb9c997d3 Remove unused dependency 2023-10-15 20:15:20 +02:00
blinxen
b52199cd75 Symlink license file in subcrate
The published crate on crates.io does not contain a license file
This is required for Fedora packaging (and probably other distributions)
2023-10-15 20:05:05 +02:00