From 3d3267b4fd73e6292d317f96d60ef69ea035912d Mon Sep 17 00:00:00 2001 From: Ajeet D'Souza <98ajeet@gmail.com> Date: Thu, 19 Sep 2024 16:11:06 +0800 Subject: [PATCH] chore(release): v0.9.6 --- CHANGELOG.md | 53 +++++++++++++++++++++++++++-------------------- Cargo.lock | 2 +- Cargo.toml | 2 +- src/shell.rs | 10 +++++++++ templates/zsh.txt | 16 +++++++------- 5 files changed, 51 insertions(+), 32 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c6f249..4d76e14 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,18 +7,25 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.9.6] - 2024-09-19 + +### Fixed + +- Fish: `builtin abbr` doesn't work on older versions. +- Zsh: make `__zoxide_z_complete` available with `--no-cmd`. + ## [0.9.5] - 2024-09-13 ### Added -- zsh: improved `cd` completions. +- Zsh: improved `cd` completions. - Lazily delete excluded directories from the database. -- fish: detect infinite loop when using `alias cd=z`. +- Fish: detect infinite loop when using `alias cd=z`. - Installer: added flags for `--bin-dir`, `--man-dir`, `--arch`, and `--sudo`. - Nushell: support for v0.94.0+. -- bash/fish/zsh: support for `z -- dir` style queries. -- fish: improved Space-Tab completions. -- ksh: added support for the Korn shell. +- Bash/Fish/Zsh: support for `z -- dir` style queries. +- Fish: improved Space-Tab completions. +- Ksh: added support for the Korn shell. ### Changed @@ -28,12 +35,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed -- zsh: Space-Tab completion repeating output multiple times when matching single +- Zsh: Space-Tab completion repeating output multiple times when matching single directory -- fish / Nushell / PowerShell: handle queries that look like args (e.g. `z -x`). -- elvish: `z -` now works as expected. -- fish: generated shell code avoids using aliased builtins. -- fish: `cd` command is now copied directly from +- Fish / Nushell / PowerShell: handle queries that look like args (e.g. `z -x`). +- Elvish: `z -` now works as expected. +- Fish: generated shell code avoids using aliased builtins. +- Fish: `cd` command is now copied directly from `$__fish_data_dir/functions/cd.fish`. This should minimize the chances of an infinite loop when aliasing `cd=z`. - Symlinks not getting added to the database when `$_ZO_RESOLVE_SYMLINKS=0`. @@ -43,7 +50,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -- zsh: improved Space-Tab completions. +- Zsh: improved Space-Tab completions. ## [0.9.3] - 2024-02-13 @@ -285,9 +292,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed -- `cd -` on fish shells. +- `cd -` on Fish shells. - `__zoxide_hook` no longer changes value of `$?` within `$PROMPT_COMMAND` on - bash. + Bash. ### Removed @@ -326,7 +333,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `$_ZO_EXCLUDE_DIRS` now supports globs. - `zoxide init` now defines `__zoxide_z*` functions that can be aliased as needed. -- Support for the [xonsh](https://xon.sh/) shell. +- Support for the [Xonsh](https://xon.sh/) shell. - `zoxide import` can now import from Autojump. ### Changed @@ -335,7 +342,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed -- Clobber conflicting alias definitions in bash/fish/zsh/POSIX shells. +- Clobber conflicting alias definitions in Bash/Fish/Zsh/POSIX shells. ### Removed @@ -346,7 +353,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed -- Bug in Fish init script +- Bug in Fish init script. ## [0.4.2] - 2020-07-03 @@ -371,7 +378,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added -- Support for powershell. +- Support for PowerShell. ### Removed @@ -399,7 +406,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed -- fish no longer `cd`s to the user's home when no match is found. +- Fish no longer `cd`s to the user's home when no match is found. ## [0.3.1] - 2020-04-03 @@ -439,7 +446,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed -- Incorrect exit codes in `z` command on fish. +- Incorrect exit codes in `z` command on Fish. ### Removed @@ -452,7 +459,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `$_ZO_ECHO` to echo match before `cd`ing. - Minimal `ranger` plugin. - PWD hook to only update the database when the current directory is changed. -- Support for bash. +- Support for Bash. - `migrate` subcommand to allow users to migrate from `z`. ### Fixed @@ -466,11 +473,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `init` subcommand to remove dependency on shell plugin managers. - Support for `z -` command to go to previous directory. - `Cargo.lock` for more reproducible builds. -- Support for the fish shell. +- Support for the Fish shell. ### Fixed -- `_zoxide_precmd` overriding other precmd hooks on zsh. +- `_zoxide_precmd` overriding other precmd hooks on Zsh. ## [0.1.1] - 2020-03-08 @@ -492,7 +499,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - GitHub Actions pipeline to build and upload releases. -- Support for zsh. +- Add support for Zsh. [0.9.5]: https://github.com/ajeetdsouza/zoxide/compare/v0.9.4...v0.9.5 [0.9.4]: https://github.com/ajeetdsouza/zoxide/compare/v0.9.3...v0.9.4 diff --git a/Cargo.lock b/Cargo.lock index e09cce9..d8f5326 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1090,7 +1090,7 @@ dependencies = [ [[package]] name = "zoxide" -version = "0.9.5" +version = "0.9.6" dependencies = [ "anyhow", "assert_cmd", diff --git a/Cargo.toml b/Cargo.toml index f872ca1..fc61e00 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ name = "zoxide" readme = "README.md" repository = "https://github.com/ajeetdsouza/zoxide" rust-version = "1.74.1" -version = "0.9.5" +version = "0.9.6" [badges] maintenance = { status = "actively-developed" } diff --git a/src/shell.rs b/src/shell.rs index 19e72c2..10e6235 100644 --- a/src/shell.rs +++ b/src/shell.rs @@ -114,6 +114,16 @@ mod tests { .stderr(""); } + #[apply(opts)] + fn fish_no_builtin_abbr(cmd: Option<&str>, hook: InitHook, echo: bool, resolve_symlinks: bool) { + let opts = Opts { cmd, hook, echo, resolve_symlinks }; + let source = Fish(&opts).render().unwrap(); + assert!( + !source.contains("builtin abbr"), + "`builtin abbr` does not work on older versions of Fish" + ); + } + #[apply(opts)] fn fish_fish(cmd: Option<&str>, hook: InitHook, echo: bool, resolve_symlinks: bool) { let opts = Opts { cmd, hook, echo, resolve_symlinks }; diff --git a/templates/zsh.txt b/templates/zsh.txt index a8aed66..82a6b8a 100644 --- a/templates/zsh.txt +++ b/templates/zsh.txt @@ -91,6 +91,12 @@ function {{ cmd }}i() { __zoxide_zi "$@" } +{%- when None %} + +{{ not_configured }} + +{%- endmatch %} + # Completions. if [[ -o zle ]]; then __zoxide_result='' @@ -126,7 +132,7 @@ if [[ -o zle ]]; then function __zoxide_z_complete_helper() { if [[ -n "${__zoxide_result}" ]]; then # shellcheck disable=SC2034,SC2296 - BUFFER="{{ cmd }} ${(q-)__zoxide_result}" + BUFFER="{{ cmd.unwrap_or("cd") }} ${(q-)__zoxide_result}" __zoxide_result='' \builtin zle reset-prompt \builtin zle accept-line @@ -135,16 +141,12 @@ if [[ -o zle ]]; then fi } \builtin zle -N __zoxide_z_complete_helper +{%- if let Some(cmd) = cmd %} [[ "${+functions[compdef]}" -ne 0 ]] && \compdef __zoxide_z_complete {{ cmd }} +{%- endif %} fi -{%- when None %} - -{{ not_configured }} - -{%- endmatch %} - {{ section }} # To initialize zoxide, add this to your configuration (usually ~/.zshrc): #