Skip to content

Releases: natecraddock/zf

0.10.2

12 Nov 20:54
Compare
Choose a tag to compare

zg (a dependency of libvaxis) was transferred to a new repo and libvaxis would fail to build. Update to the new libvaxis

0.10.1

29 Oct 03:33
Compare
Choose a tag to compare

A small bugfix release to fix the keybindings so that ctrl-p moves the selection up

Additionally:

Thanks for the contributions!

zf 0.10.0

02 Oct 02:13
Compare
Choose a tag to compare

This release adds support for an fzf inspired --preview option, updates the Zig module API, and rewrites the UI to use libvaxis.

Preview

The --preview option can be used to run a command for the currently selected line. The stdout of the command is collected and displayed in a preview window on the right. {} characters in the command will be substituted with the current line.

The --preview-width option can be used to set the width of the preview window as a percent. Values from 20% to 80% are accepted, with or without the percent sign.

As an example

fd -tf | zf --preview 'cat {}'

will pipe a list of files to zf and use cat to display the contents of the currently selected file on the right of the window.

Zig Module API

Zf can be used as a Zig module to add fuzzy matching to your project. The API was simplified in this release.

Rather than accept boolean parameters, the options are now in a struct passed to the function.

This means

zf.rank(string, token, false, false);
zf.rank(string, token, false, true);

Is now written as

zf.rank(string, token, .{});
zf.rank(string, token, .{ .plain = true });

This makes the default case simpler, and also makes the boolean parameters clear at the call site.

The case_sensitive parameter was also named to to_lower for more clarity. See the library docs for more information.

Other Changes

  • The UI was completely rewritten to use libvaxis instead of my own custom terminal rendering code.
  • The env variable ZF_PROMPT no longer supports terminal escape sequences. It was difficult to support this when rewriting to use libvaxis. Support for this feature may return in the future if there is interest.
  • Adds an option to zig build to compile as a PIE executable. This should be useful for package mainainers. Use zig build -Dpie to enable this option
  • Zf no longer does unicode normalization of the input.

zf 0.9.2

23 Jun 03:05
Compare
Choose a tag to compare

This release supports both Zig 0.12.1 and 0.13.0.

No changes since the last release. Just tagging a new version so package managers can build with the newest releases of Zig.

zf 0.9.1

07 Feb 03:02
Compare
Choose a tag to compare

A small release to fix two potential crashes

  • fix: fix crash when input is invalid utf8
    (50e3a8)

    zf incorrectly assumed that the input was valid utf-8 encoded unicode. Now the input is validated before normalization.

  • fix: avoid integer overflow when selecting line down
    (0456b7)

zf 0.9.0

30 Sep 15:13
Compare
Choose a tag to compare

This is a smaller release. The main goal of this is to have a stable version of zf that targets Zig 0.11.0. There are also improvements to support the new Zig package manager, refactorings, and small fixes.

I originally planned to include a UI preview feature in this release, but I ran into some issues with in release builds and I haven't had time to debug properly. So that will be postponed until the next release of zf. But a lot of refactoring and code to support a UI preview is already included in this release.

And although this news is months old, zf is now available in nix.

See the changelog for full details.

zf 0.8.0

15 Mar 22:02
Compare
Choose a tag to compare

This release adds multiselect to the UI, improves the strict path matching feature added in the previous release, and improves the highlighting logic to be more accurate. The library API has also been updated.

See the changelog for full details.

zf 0.7.0

11 Feb 21:53
Compare
Choose a tag to compare

The headline feature of this release is strict path matching, another way that zf is optimized for filtering filepaths with accuracy and precision.

With strict path matching, when a query token contains a / character, any other characters after the slash must appear in a single path segment. As an example, the query /foo would match /foo/bar/ but not /fo/obar because the characters "foo" must appear in a single path segment.

This is useful for narrowing down results when you know the exact path structure of your files. As a more complex example, with the following paths

app/models/foo/bar/baz.rb
app/models/foo/bar-baz.rb
app/models/foo-bar-baz.rb
app/monsters/dungeon/foo/bar/baz.rb

The query a/m/f/b/baz filters to only app/models/foo/bar/baz.rb whereas in previous versions of zf the string app/monsters/dungeon/foo/bar/baz.rb is also included in the results. To end strict path matching, just add a space to start a new token.

This release also includes many fixes, refactors, optimizations, unicode support, and a few other small features.

See the changelog for more details.

zf 0.6.0

10 Dec 23:16
Compare
Choose a tag to compare

This release is focused on small optimizations, refactors, and using zf as a library. Because zf is now packaged as a Zig library, it makes sense to switch back to semantic versioning which makes this version 0.6.0 rather than 0.6. This release also updates the source code to support Zig 0.10.0.

While refactoring zf to be more easily consumed by a library, I designed the library to require zero allocations and be passed external slices of memory. Alongside this I also added a restriction to zf as a cli tool. The number of space-separated tokens in the query is now limited to 16. This seems like a safe upper limit, but can be raised if needed.

See the changelog for more details.

zf 0.5

02 Jul 21:43
Compare
Choose a tag to compare

This smaller release fixes a few bugs and adds support for a few environment variables. A long time coming (I've been focused on other projects), I'm finally back to work on zf. The next release will be focused on utf-8 unicode support.

See the changelog for more details.