* Add --hide-nth flag to hide fields while keeping them searchable
Introduce a `--hide-nth <fieldspec>` option that takes the same
comma-separated field index expressions as `--nth`/`--with-nth`. The
listed fields are removed from the displayed line but remain part of the
text used for matching, so a query can still match them. Characters in
the hidden fields are ignored for match highlighting and horizontal
scrolling.
Implementation:
- Resolve the fieldspec to byte ranges in the same coordinate space as
the matching/display text and store them as `hidden_ranges` in
DefaultSkimItem metadata, exposed via a new `SkimItem::hidden_ranges()`
trait method. text()/output() keep the full text so hidden fields stay
searchable and are preserved on output.
- DefaultSkimItem::display() removes hidden characters and remaps match
highlight positions into visible coordinates (project_visible_text /
project_match_indices); this path takes precedence over ANSI styling.
- ItemRenderer::render_item applies the same projection to derive the
visible sub-line text and hscroll match range, so hidden characters are
ignored for horizontal scrolling.
Add unit tests for range normalization/projection and item behavior,
plus insta snapshot tests covering display removal, searchability, and
hscroll. Update ARCHITECTURE.md.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BCunXeAFMYAFduTc8SNjSM
* Preserve ANSI colors for surviving text under --hide-nth
Previously the hidden-field rendering path was applied ahead of the ANSI
display branch and rebuilt the line from the ANSI-stripped text, so
combining --hide-nth with --ansi dropped the colors of the visible
fields.
Integrate hidden-field removal into the ANSI branch instead: after
parsing the styled spans, drop the hidden characters while preserving
each span's style (retain_visible_spans) and remap the match positions
into the resulting visible coordinate space, then run the normal
highlighting. The plain (non-ANSI) branch keeps its project-and-to_line
handling. Surviving characters now keep their ANSI colors while hidden
fields stay searchable.
Add unit tests for ANSI color preservation and remapped highlighting,
plus ANSI color-snapshot integration tests. Update ARCHITECTURE.md.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BCunXeAFMYAFduTc8SNjSM
* Set hidden fields via builder instead of DefaultSkimItem::new param
Remove the `hidden_fields` parameter from `DefaultSkimItem::new` and set
the hidden fields through a `hidden_fields(&[FieldRange], &Regex)`
builder method instead. The builder resolves the fields against the
item's own `text()` (the same coordinate space `new` would have used),
so the result is identical while keeping `new`'s signature unchanged for
its many existing call sites.
The reader chains `.hidden_fields(&opt.hidden_fields, &opt.delimiter)`
onto construction. Revert the extra `&[]` argument at the other call
sites (selector, fuzz target, tests) and update the hide-nth tests to
use the builder. Update ARCHITECTURE.md.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BCunXeAFMYAFduTc8SNjSM
* chore: generate files
---------
Co-authored-by: Claude <noreply@anthropic.com>
* Shrink binary: trim image decoders and swap color-eyre for eyre
Two dependency changes that cut the default `sk` binary from 13.6 MiB to
8.55 MiB (-5.06 MiB, -37%) with no loss of core functionality:
- image: build the `image` crate with only the common decoders (png,
jpeg, gif, webp) instead of its full default format set, and drop
ratatui-image's `image-defaults`. This removes AVIF encoding (ravif,
avif-serialize), OpenEXR (exr), TIFF, QOI and other decoders that are
irrelevant to terminal image previews. Previewing those formats now
falls back to the normal command preview.
- error handling: replace color-eyre with plain eyre. color-eyre only
provided colored panic/error backtraces; skim used none of its
Section/Help extension APIs. This drops the backtrace/gimli/addr2line/
color-spantrace stack. `color_eyre::install()` is no longer needed.
Tests, benches and examples are migrated from color_eyre to eyre so the
crate is fully removed from the dependency graph.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BQtxeCS4gM7dumghqmNgST
* chore: fmt
* docs: ARCHITECTURE.md
* chore(flake): add cargo-bloat
---------
Co-authored-by: Claude <noreply@anthropic.com>
* feat!: feature-gate listen and image to allow opting out
This is breaking since disabling the default features now also disables
those. It is NOT breaking for cli users, only for library ones.
* fix: add warn on listener transfer failure
* feat(theme): add a themeable scrollbar color for the item list
The item-list scrollbar was the only rendered UI element without a
ColorTheme entry. ratatui's Scrollbar defaults thumb_style to an empty
Style, so the thumb merged nothing onto the cells it drew over and
inherited their fg/bg — most visibly the current-line highlight, which
the thumb adopted as the cursor scrolled past it.
Add a `scrollbar` color to ColorTheme, parse it from `--color`
(`scrollbar:<spec>`), default it per theme to the border color (the four
catppuccin themes use their muted `overlay0` instead), and pass it as the
Scrollbar thumb style. The thumb now reads as uniform chrome instead of
tracking whatever row sits under it. The colorless `none` theme leaves it
unset, so NO_COLOR still renders no thumb styling.
Documented in the README color table and the manpage; covered by theme
unit tests and @snap_color integration tests (default border color and a
custom --color=scrollbar override, both over the highlighted current line).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore: generate-files & misc
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Loric ANDRE <loric.andre@pm.me>
* chore: deps: Only use frizbee on x86_64 and aarch64
* chore: update docs for frizbee support
* chore: docs [skip ci]
---------
Co-authored-by: LoricAndre <57358788+LoricAndre@users.noreply.github.com>