Commit graph

16 commits

Author SHA1 Message Date
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
LoricAndre c364c5f128
chore: remove workspace (#883)
* chore: remove workspace

* chore: regen dist config

* fix: readme path

* chore: extra-artifacts as files

* chore: generate dist CI

* chore: prepare for prerelease

* chore: switch to include + generate-files

* chore: use run step for generate-files

---------

Co-authored-by: Loric André <loric.andre@noreply.me>
2026-01-13 11:34:10 +01:00
LoricAndre 7df8b77739
feat: use clap & derive for options, manpage & completions (#586)
Some checks failed
Build & Test / test (linux, ubuntu-latest, stable, x86_64-unknown-linux-musl) (push) Has been cancelled
Build & Test / test (macos, macos-latest, stable, x86_64-apple-darwin) (push) Has been cancelled
Build & Test / clippy (linux, ubuntu-latest, stable, x86_64-unknown-linux-musl) (push) Has been cancelled
Build & Test / clippy (macos, macos-latest, stable, x86_64-apple-darwin) (push) Has been cancelled
Build & Test / rustfmt (push) Has been cancelled
* feat: use clap & derive for options, manpage & completions

* clippy & fmt

* fix: correctly handle errors

* fix: disable doctest

* fix: readd replstr

* fix: reserve --tmux until it is implemented

* explicit panic messages for history files

* fix after merge

---------

Co-authored-by: LoricAndre <loric.andre@pm.me>
2024-11-20 17:01:08 +01:00
LoricAndre 8a579837da chore: fix clippy 2024-11-07 17:12:16 +01:00
grant0417 7d922a02a0 chore: update deps and fix lots of clippy lints 2022-08-21 01:38:16 -07:00
Jinzhou Zhang 40099ce0cc [lib] add as_any for SkimItem for downcast
1. add `as_any` for `SkimItem`
2. fix preview: deal with multi-lines prepared text
3. API for preview (non-)colored text

Skim will take trait object `Arc<dyn SkimItem>` and will return it back
in `SkimOutput`. Caller will need the concrete type reference to call
some type-specific methods.  The `AsAny` trait is used for downcasting
`Arc<dyn SkimItem>` back to reference to its concrete type.

Q: Why not use associated type?
1. Associated type would pollute all the type signatures that deals with
   `SkimItem`. Some traits could no longer be made into trait object
   with generic type in their method signature.
   ```
    pub trait MatchEngine: Sync + Send {
        fn match_item<T: SkimItem>(&self, item: Arc<ItemWrapper<T>>) -> Option<MatchedItem<T>>;
    }
   ```
   To fix it would require much more work than I think.
2. Currently the support for "interaction mode" and "append-and-select"
   action is done inside skim. That means some items added to skim could
   not guaentee to be the associated type.
2020-02-07 10:34:29 +08:00
Jinzhou Zhang e3f3d35561 [collector] add helper SkimItemReader 2020-02-05 17:48:54 +08:00
Jinzhou Zhang 83080e305e fix #216 support item specific preview hook method 2020-02-05 15:04:15 +08:00
Jinzhou Zhang 234175be57 [main] able to read from piped stdin 2020-02-05 12:51:30 +08:00
Jinzhou Zhang bbd8f91eac introduce new trait SkimItem 2020-02-04 22:59:36 +08:00
ngirard 1885180c7e
option_builder.rs: remove extraneous line. 2019-05-02 23:23:17 +02:00
Jinzhou Zhang ad32d9a5e9 fix: compilation error of examples 2019-03-19 17:36:26 +08:00
Jinzhou Zhang 74a1319095 [lib] return item instead of matched items 2018-06-03 08:47:15 +08:00
Jinzhou Zhang a6de5970bc [rustfmt] reformat the code 2018-06-02 19:00:58 +08:00
Jinzhou Zhang 0f88e823ce [options] remove SkimOptionsBuilder
Since there are already `Option` options, another wrap on the option
would be too tedious to work with.
2018-06-02 18:48:30 +08:00
Jinzhou Zhang 1bb74b4568 add example for using library
However the library could only be used once cause it did not release the
resources correctly.
2018-06-02 10:57:47 +08:00