This PR has grown beyond its initial scope due to me over-optimizing everything, but it leads to:
Paving the way for future actually interactive previews
Consistently better performance than fzf in our bench thanks to thread and concurrency optimizations as well as the use of kanal for the items channels
Given the scope, I'm marking this as breaking because:
setting wrap in the preview window layout disables the pty since we don't want to manipulate the raw buffer to word-wrap it manually
kanal channels work slightly differently and might break library usage, even though switching to them did not require any modifications of the examples so it's unlikely that users will see anything break
* fix: force cwd for preview
* fix: correctly set cwd & kill pty child in the right order
* fix: use std threads & reopen new pty for each preview
* feat: use tui-term for displaying
* feat: scroll in pty
* fix: make nested skim previews work
* fix: clippy mistake
* feat: reactive preview triggering
* chore: generate completions & manpage
* chore: optimizations & thread cleanup
* chore: use kanal for faster channels
* fix: tests
* fix: only send items if the matcher hasn't been killed in the meantime (#947)
* tests: add coverage
* tests: fix bin path with coverage
* tests: upload tests to codecov
* chore: make pty opt-in through preview-window
* chore: generate completions & manpage
---------
Co-authored-by: Skim bot <skim-bot@skim-rs.github.io>
* Return items of multi-select in order of selection
* chore: update deps and fix lots of clippy lints
* cargo update
* Fix more lints + ci
* Include repology reference
`skim` is packaged in more then the listed repositories. By referring to repology everyone can easily check whether their package manager of choice has it. Also the list at repology auto updates and includes the information which versions are packaged.
* Add light colors parsing support
* Update ci.yml
* Update ci.yml
* Make bin only deps set optional
* transparency on start
* release notes
* bump
* bump to 0.10.1
* fix: print version from Cargo.toml with latest clap
Upgrading to clap 3 has changed some behavior in clap, as the
version option is automatically populated. This means the custom
code has never been executed.
Lets fix this by using the clap built in functionality to automatically
use the crate version in the builtin version option.
This fixes commit 7d922a02a0
Signed-off-by: Levente Polyak <levente@leventepolyak.net>
* bump version
* update defer-drop to v1.3.0
* Update Cargo.toml
* bump
* Update README.md
* bump
* doc(discord): discord invitation link
* README.md: "Package Managers": add Portage
* document display issue + fix
* Update sk.1
* Update sk-tmux.1
* remove -K and -R flags from tmux popup: uknown flags (#551)
Co-authored-by: ymnejmi <ymnejmi@github.com>
* chore: fix clippy
* Create dependabot.yml
* Bump log from 0.4.17 to 0.4.22 (#581)
Bumps [log](https://github.com/rust-lang/log) from 0.4.17 to 0.4.22.
- [Release notes](https://github.com/rust-lang/log/releases)
- [Changelog](https://github.com/rust-lang/log/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/log/compare/0.4.17...0.4.22)
---
updated-dependencies:
- dependency-name: log
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>
* Bump vte from 0.11.0 to 0.13.0 (#582)
Bumps [vte](https://github.com/alacritty/vte) from 0.11.0 to 0.13.0.
- [Release notes](https://github.com/alacritty/vte/releases)
- [Changelog](https://github.com/alacritty/vte/blob/master/CHANGELOG.md)
- [Commits](https://github.com/alacritty/vte/compare/v0.11.0...v0.13.0)
---
updated-dependencies:
- dependency-name: vte
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>
* Bump derive_builder from 0.11.2 to 0.20.2 (#583)
Bumps [derive_builder](https://github.com/colin-kiegel/rust-derive-builder) from 0.11.2 to 0.20.2.
- [Release notes](https://github.com/colin-kiegel/rust-derive-builder/releases)
- [Commits](https://github.com/colin-kiegel/rust-derive-builder/compare/v0.11.2...v0.20.2)
---
updated-dependencies:
- dependency-name: derive_builder
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>
* bootstrap contributing.md
* Bump shlex from 1.1.0 to 1.3.0 (#556)
Bumps [shlex](https://github.com/comex/rust-shlex) from 1.1.0 to 1.3.0.
- [Changelog](https://github.com/comex/rust-shlex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/comex/rust-shlex/commits)
---
updated-dependencies:
- dependency-name: shlex
dependency-type: direct:production
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Cargo: remove unuseful entries (#382)
* feat: use IndexMap to order selected items
* test: add e2e
* update lock after rebase
* prepare merge
* update lock
* clippy
* Delete test.Dockerfile
* fix lockfile
* fix dep version regressions
---------
Signed-off-by: Levente Polyak <levente@leventepolyak.net>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: grant0417 <grant@ggurvis.com>
Co-authored-by: grant0417 <grantgurvis@gmail.com>
Co-authored-by: Merlin <megoettlinger@gmail.com>
Co-authored-by: TD-Sky <three-dim-sky@foxmail.com>
Co-authored-by: Grant G <grant0417@users.noreply.github.com>
Co-authored-by: EdenEast <edenofest@gmail.com>
Co-authored-by: yazgoo <yazgoo@gmail.com>
Co-authored-by: Levente Polyak <levente@leventepolyak.net>
Co-authored-by: onatm <onat.mercan@truelayer.com>
Co-authored-by: yazgoo <yazgoo@users.noreply.github.com>
Co-authored-by: Vitaly Zdanevich <zdanevich.vitaly@ya.ru>
Co-authored-by: sisrfeng <53520949+sisrfeng@users.noreply.github.com>
Co-authored-by: ymnejmi <134085326+ymnejmi@users.noreply.github.com>
Co-authored-by: ymnejmi <ymnejmi@github.com>
Co-authored-by: LoricAndre <loric.andre@pm.me>
Co-authored-by: LoricAndre <57358788+LoricAndre@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Marco Ieni <11428655+MarcoIeni@users.noreply.github.com>
The finally "display" of an item was drawn by first invoking `display()`
for the content, and then draw the matched indices. When the customized
`display()` did not return the same text as `text()`, the display is
broken.
PR #347 try to fix this by adding a "non-highlight" option. But maybe
it's better to hand over all the drawing tasks to `display()`, including
highlight the matching indices.
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.