Commit graph

1513 commits

Author SHA1 Message Date
LoricAndre c7da16f167
feat: back to stable rust (#980)
* wip: stable rust, but no match indices

* feat: use restored indices api

* chore: use crates.io pushed 0.8.0

* chore: generate completions & manpage

* fix: remove nightly-specific coverage annotations

---------

Co-authored-by: Skim bot <skim-bot@skim-rs.github.io>
2026-02-19 20:53:05 +01:00
Loric ANDRE 1a90f4f52f bench: add filter 2026-02-19 14:57:44 +01:00
Loric ANDRE 003243a93a feat: add --ellipsis option 2026-02-19 13:37:10 +01:00
Loric ANDRE d7117fbbc2 feat: add --print-current, --output-format (closes #981) 2026-02-18 22:14:49 +01:00
Loric ANDRE 5c11314bb6 feat: add set-header action (closes #768) 2026-02-18 19:33:29 +01:00
Loric ANDRE 943e073cee feat: allow setting delimiters in + expansions (closes #935) 2026-02-18 19:18:10 +01:00
Loric ANDRE 1b2da17e88 fix(ci): do not run benches 2026-02-18 16:40:35 +01:00
Loric ANDRE 091c7e8284 docs: benchmarks 2026-02-18 15:57:41 +01:00
Loric ANDRE 5f1d49d997 chore: add rust benchmark 2026-02-18 15:54:50 +01:00
Loric ANDRE 6b128b183b release: v3.3.0 2026-02-18 10:42:07 +01:00
Loric ANDRE 40c2ee6c41 chore: refactor Skim into its own file 2026-02-17 22:22:38 +01:00
figsoda 2a7bd1db11
feat: allow run_with to be run within a tokio runtime (#979)
* feat: allow run_with to be run within a tokio runtime

* feat: add async example
2026-02-17 21:05:50 +00:00
dependabot[bot] e7183acc70
chore(deps): bump clap from 4.5.58 to 4.5.59 (#977)
Bumps [clap](https://github.com/clap-rs/clap) from 4.5.58 to 4.5.59.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.58...clap_complete-v4.5.59)

---
updated-dependencies:
- dependency-name: clap
  dependency-version: 4.5.59
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-17 03:14:28 +01:00
dependabot[bot] 0d399ea4e7
chore(deps): bump roff from 0.2.2 to 1.0.0 (#976)
Bumps [roff](https://github.com/rust-cli/roff-rs) from 0.2.2 to 1.0.0.
- [Changelog](https://github.com/rust-cli/roff-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-cli/roff-rs/compare/v0.2.2...v1.0.0)

---
updated-dependencies:
- dependency-name: roff
  dependency-version: 1.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-17 03:14:18 +01:00
dependabot[bot] c8de29e239
chore(deps): bump futures from 0.3.31 to 0.3.32 (#975)
Bumps [futures](https://github.com/rust-lang/futures-rs) from 0.3.31 to 0.3.32.
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.31...0.3.32)

---
updated-dependencies:
- dependency-name: futures
  dependency-version: 0.3.32
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-17 03:14:04 +01:00
Loric ANDRE 480e147377 fix: possible None unwrap if ansi enabled but not in item 2026-02-16 14:27:16 +01:00
Loric ANDRE 65ba8cffaa feat: event-driven re-render (#949) 2026-02-16 11:05:33 +01:00
LoricAndre 4147eccb94
chore: unify filter mode & squeeze more perf (#974)
* refactor: move filter mode into run_with via should_enter

Remove the standalone `filter` function from main.rs and integrate
filter mode into the main `run_with` pipeline. When `options.filter`
is set, `should_enter` now waits for all items to be processed and
returns false (skipping TUI), and `App::results` returns all matched
items. This unifies filter mode with the rest of the codebase so it
benefits from all other flags (sorting, tiebreaks, etc.).

https://claude.ai/code/session_01T7pa2RRX85MvBtnH7PWtmw

* perf: optimize filter mode to match single-pass performance

Three changes that eliminate the performance regression from routing
filter mode through run_with:

1. should_enter(): Wait for reader to finish BEFORE starting matcher,
   then run matcher exactly once. The old polling loop called
   restart_matcher() repeatedly, each time resetting the ItemPool taken
   counter and re-processing all items from scratch. With 1M items
   arriving in batches, items were matched multiple times.

2. matcher.run(): Remove unnecessary .enumerate() (index was discarded)
   and remove item.clone() — into_par_iter() yields owned values so the
   Arc can be moved directly into MatchedItem.

3. App::results(): In filter mode, drain items instead of cloning to
   avoid 271K MatchedItem clones + Arc allocations.

Benchmark (1M file paths, query "test", 10 runs):
  Old standalone filter: 5.306s ± 0.085s
  New unified filter:    4.932s ± 0.099s  (1.08x faster)

https://claude.ai/code/session_01T7pa2RRX85MvBtnH7PWtmw

* perf: make restart_matcher incremental when force=false

When force=false, skip the item pool reset so take() only returns new
(untaken) items. The callback merges new sorted matches into the
existing sorted result list using an O(n+m) merge, instead of
replacing it. This fixes the root cause: previously every
restart_matcher call re-processed ALL items from scratch because
reset() set the taken counter to 0.

This benefits all polling callers (filter, select-1, exit-0, sync),
not just filter mode. Items arriving in batches are now each matched
exactly once, and matching overlaps with I/O since batches are
processed as they arrive.

When force=true (query changed), behavior is unchanged: full reset
and re-match.

Reverts the filter-specific workaround from the previous commit in
favor of this general fix; the original polling loop in should_enter
is now efficient.

Benchmark (1M file paths, query "test", 10 runs):
  Old standalone filter (master):  4.566s ± 0.055s
  Incremental restart_matcher:     3.654s ± 0.035s  (1.25x faster)

https://claude.ai/code/session_01T7pa2RRX85MvBtnH7PWtmw

* refactor: extract sorted_merge into MatchedItem method

Move the two-sorted-list merge from the restart_matcher closure into
MatchedItem::sorted_merge() for clarity and reusability. The method
merges two Vec<MatchedItem> lists that are already sorted by rank
into a single sorted Vec in O(n+m) time.

https://claude.ai/code/session_01T7pa2RRX85MvBtnH7PWtmw

* fix: preserve incremental matches across render cycles

When restart_matcher runs with force=false, the callback marks results
with a MergeStrategy so the render loop knows how to combine them with
existing items. Previously, render's .take() would drain processed_items
to None, and the next incremental callback would create a fresh batch —
causing the render to replace all items with just the latest batch,
losing previously matched items.

Now:
- Replace: full re-match (force=true), replaces item list entirely
- SortedMerge: incremental sorted results, merged into item_list.items
- Append: incremental unsorted results (--no-sort), appended

This fixes match count consistency in interactive mode. With 1M items
and query "test", match count is now 290,083 on every run (matching
fzf's consistency), vs wildly varying counts before (min 13, max 56,950).

https://claude.ai/code/session_01T7pa2RRX85MvBtnH7PWtmw

* chore: fmt & clippy

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-02-15 19:08:02 +01:00
kimono-koans ad91558749
feat: use a separate thread pool for Matcher runs (#961)
* Initial commit

* Disable Matcher when query is empty

* Revert

* Cleanup

* Use par_chunks for faster search

* Cleanup

* Skip updating atomic on every iter

* Item index unnecessary?

* Cleanup

* Build thread pool at App level

* Initial commit

* Disable Matcher when query is empty

* Revert

* Cleanup

* Use par_chunks for faster search

* Cleanup

* Skip updating atomic on every iter

* Item index unnecessary?

* Cleanup

* Build thread pool at App level

* Make suggested improvements

* chore: cleanup after rebase

* refactor: rewrite insta test harness to use fine-grained Skim:: methods

Split `impl Skim` into a generic `impl<Backend> Skim<Backend>` block so
that `Skim::init()`, `Skim::start()`, `Skim::tick()`, etc. work with
any backend, not just the default CrosstermBackend.

New public API on Skim<B>:
- `init_tui_with(tui)` – inject a caller-provided TUI (e.g. TestBackend)
- `app()` / `app_mut()` – access the application state
- `tui_ref()` / `tui_mut()` – access the TUI
- `app_and_tui()` – simultaneous mutable access to both (avoids borrow
  conflicts in render and handle_event calls)
- `final_event()` – inspect the quit event

TestHarness now wraps `Skim<TestBackend>` and initializes via
`Skim::init()` + `Skim::init_tui_with()`, sharing the production
init path (theme, reader, command expansion) instead of duplicating it.

https://claude.ai/code/session_016PtHKc9YVEpHftDxG5Nger

* chore: make insta harness more realistic

* Cleanup merge errors

* Remove duplicate check

* Cleanup

* No need to clone twice

* fix: fix thread pool race condition

---------

Co-authored-by: Loric ANDRE <loric.andre@pm.me>
Co-authored-by: Claude <noreply@anthropic.com>
2026-02-15 17:34:46 +01:00
Loric ANDRE 19bfd34aaf release: v3.2.0 2026-02-13 15:29:57 +01:00
kimono-koans 5d9743f198
feat: further reduce DefaultSkimItem size (#967)
* Initial commit

* Cleanup

* Prevent some double allocation behavior

* User the proper conversion method

* Further attempt to avoid alloc

* Actually avoid alloc

* Cleanup

* Remove an unnecessary alloc

* Cleanup

* Avoid another alloc

---------

Co-authored-by: LoricAndre <57358788+LoricAndre@users.noreply.github.com>
2026-02-13 15:18:26 +01:00
LoricAndre 65b7c86d7e
chore: enhance PR template [skip ci]
Updated the pull request template to include a checklist item for conventional commit titles and documentation updates.
2026-02-13 14:05:17 +01:00
Loric ANDRE 1e118caec6 fix: republish crate 2026-02-13 10:25:30 +01:00
Loric ANDRE a766762b5a release: v3.1.0 2026-02-13 10:01:15 +01:00
LoricAndre 98a9184055
feat: add set-preview-cmd action to change preview (#969)
* feat: add set-preview-cmd action to change preview

* chore: update manpage

* chore: generate completions & manpage

---------

Co-authored-by: Skim bot <skim-bot@skim-rs.github.io>
2026-02-13 08:32:13 +00:00
LoricAndre de7eab7619
feat(cli): add SKIM_OPTIONS_FILE (#972)
* feat(cli): add SKIM_OPTIONS_FILE

* chore: generate completions & manpage

---------

Co-authored-by: Skim bot <skim-bot@skim-rs.github.io>
2026-02-13 09:24:05 +01:00
Loric ANDRE b02ef7b878 chore: remove duplicate changelog entry 2026-02-12 15:44:39 +01:00
Loric ANDRE 17c801bb07 release: v3.0.1 2026-02-12 15:24:16 +01:00
tzachar 4749154e5b
docs: add link to sqlite_skim (#971) [skip ci] 2026-02-12 15:14:28 +01:00
Loric ANDRE 4c12048762 fix: restart_matcher race condition (closes #970) 2026-02-12 15:08:37 +01:00
Loric ANDRE 267fb0c72e release: v3.0.0 2026-02-12 12:10:29 +01:00
LoricAndre e9fb1877c0
feat(lib): add fine-grained control over skim's event loop (#968)
* feat(lib): add fine-grained control over skim's event loop

* fix: do not panic on reload

* fix: cleaner handling of reload
2026-02-12 11:57:02 +01:00
Loric ANDRE 6bb1008101 chore(ci): make codecov less aggressive 2026-02-11 19:51:49 +01:00
Loric ANDRE d2f0a7f952 fix: run preview on move after selection 2026-02-11 18:34:05 +01:00
Loric ANDRE 149b47f37d feat: readd --sync functionality 2026-02-11 18:22:47 +01:00
Loric ANDRE d11e627ba6 feat!: use smarter setters, remove the need for Some(...) and String::from() in setters 2026-02-11 18:18:35 +01:00
Loric ANDRE 495b9ae611 docs: detail pty preview window flag [skip ci] 2026-02-11 13:30:33 +01:00
LoricAndre 9d0fb5eec9
feat: reduce DefaultSkimItem memory footprint by around 25% by default (#966) 2026-02-11 13:24:49 +01:00
Loric ANDRE a4f32c5533 docs: update nightly version [skip ci] 2026-02-11 10:01:55 +01:00
Loric ANDRE 1b23121956 chore: update frizbee and nightly version 2026-02-11 10:00:56 +01:00
依云 87b14ef577
fix: implement cursor_pos_from_tty ourselves (#963)
* fix: implement cursor_pos_from_tty ourselves

termion's cursor_pos has a very short timeout that won't work across
oceans; also it uses the wrong clock.

There is no need to try stdout first or read from stdin; it always works
with /dev/tty.

Using select because poll is said to not work with /dev/tty on macOS.[^1]

Using nix because it's already at the toplevel of dependencies.

[^1]: https://docs.rs/rustix/1.1.3/rustix/event/fn.poll.html

* chore: get rid of termion
2026-02-11 09:38:02 +01:00
dependabot[bot] d48f3f5e32
chore(deps): bump rand from 0.9.2 to 0.10.0 (#958)
Bumps [rand](https://github.com/rust-random/rand) from 0.9.2 to 0.10.0.
- [Release notes](https://github.com/rust-random/rand/releases)
- [Changelog](https://github.com/rust-random/rand/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-random/rand/compare/rand_core-0.9.2...0.10.0)

---
updated-dependencies:
- dependency-name: rand
  dependency-version: 0.10.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-10 21:51:42 +00:00
dependabot[bot] db507d6f59
chore(deps): bump clap from 4.5.56 to 4.5.57 (#955)
Bumps [clap](https://github.com/clap-rs/clap) from 4.5.56 to 4.5.57.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.56...clap_complete-v4.5.57)

---
updated-dependencies:
- dependency-name: clap
  dependency-version: 4.5.57
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-10 14:01:13 +01:00
dependabot[bot] 812525d582
chore(deps): bump tempfile from 3.24.0 to 3.25.0 (#956)
Bumps [tempfile](https://github.com/Stebalien/tempfile) from 3.24.0 to 3.25.0.
- [Changelog](https://github.com/Stebalien/tempfile/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Stebalien/tempfile/commits)

---
updated-dependencies:
- dependency-name: tempfile
  dependency-version: 3.25.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-10 14:00:52 +01:00
dependabot[bot] ef041436f7
chore(deps): bump interprocess from 2.2.3 to 2.3.1 (#957)
Bumps [interprocess](https://github.com/kotauskas/interprocess) from 2.2.3 to 2.3.1.
- [Release notes](https://github.com/kotauskas/interprocess/releases)
- [Commits](https://github.com/kotauskas/interprocess/compare/2.2.3...2.3.1)

---
updated-dependencies:
- dependency-name: interprocess
  dependency-version: 2.3.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-10 14:00:40 +01:00
dependabot[bot] c051be779e
chore(deps): bump regex from 1.12.2 to 1.12.3 (#959)
Bumps [regex](https://github.com/rust-lang/regex) from 1.12.2 to 1.12.3.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.12.2...1.12.3)

---
updated-dependencies:
- dependency-name: regex
  dependency-version: 1.12.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-10 14:00:27 +01:00
kimono-koans e23a259451
feat: optimize match_item to use ref and not Arc (#962) 2026-02-10 10:16:00 +01:00
Loric ANDRE fdd93644b4 chore: test matchers 2026-02-09 23:31:43 +01:00
Loric ANDRE 00d32b6f9d chore: add coverage flag to README 2026-02-09 22:55:41 +01:00
Loric ANDRE b3ebf9db92 chore: ignore coverage files [skip ci] 2026-02-09 22:48:31 +01:00