diff --git a/README.md b/README.md index 94fc0575..5ac73043 100644 --- a/README.md +++ b/README.md @@ -118,7 +118,7 @@ fzf supports global default options via the [FZF_DEFAULT_OPTS](https://github.co ### Pass fzf options for a specific command -The following variables can store custom options that will be passed to fzf by their respective command: +The following variables configure the fzf options for their respective command: | Command | Variable | | ----------------- | --------------------- | diff --git a/conf.d/fzf.fish b/conf.d/fzf.fish index 8156c11b..9f062f4b 100644 --- a/conf.d/fzf.fish +++ b/conf.d/fzf.fish @@ -26,3 +26,10 @@ function _fzf_uninstall --on-event fzf_uninstall echo "You may need to manually remove fzf_configure_bindings from your config.fish if you were using custom key bindings." set_color normal end + +function _fzf_migration_message --on-event fzf_update + set_color FF8C00 # dark orange + printf '\n%s\n' '[fzf.fish] Breaking change: if you have $fzf_dir_opts or $fzf_shell_vars_opts set in your environment, rename them to $fzf_directory_opts and $fzf_variables_opts respectively.' + printf '%s\n\n' 'See https://github.com/PatrickF1/fzf.fish/wiki/Migration-Guides#v10.1.' + set_color normal +end diff --git a/functions/_fzf_search_directory.fish b/functions/_fzf_search_directory.fish index ad30a303..c09f90b3 100644 --- a/functions/_fzf_search_directory.fish +++ b/functions/_fzf_search_directory.fish @@ -5,8 +5,7 @@ function _fzf_search_directory --description "Search the current directory. Repl set -f fd_cmd (command -v fdfind || command -v fd || echo "fd") set -f --append fd_cmd --color=always $fzf_fd_opts - # $fzf_dir_opts is the deprecated version of $fzf_directory_opts - set -f fzf_arguments --multi --ansi $fzf_dir_opts $fzf_directory_opts + set -f fzf_arguments --multi --ansi $fzf_directory_opts set -f token (commandline --current-token) # expand any variables or leading tilde (~) in the token set -f expanded_token (eval echo -- $token) diff --git a/functions/_fzf_search_variables.fish b/functions/_fzf_search_variables.fish index bf823403..c9a2e31e 100644 --- a/functions/_fzf_search_variables.fish +++ b/functions/_fzf_search_variables.fish @@ -27,8 +27,7 @@ function _fzf_search_variables --argument-names set_show_output set_names_output --preview-window="wrap" \ --multi \ --query=$cleaned_curr_token \ - # $fzf_shell_vars_opts is the deprecated version of $fzf_variables_opts - $fzf_shell_vars_opts $fzf_variables_opts + $fzf_variables_opts ) if test $status -eq 0 diff --git a/tests/search_directory/expands_var_in_query.fish b/tests/search_directory/expands_var_in_query.fish index b9ebd546..e51ef68b 100644 --- a/tests/search_directory/expands_var_in_query.fish +++ b/tests/search_directory/expands_var_in_query.fish @@ -1,6 +1,6 @@ set target "file 1.txt" -set --global fzf_dir_opts --select-1 +set --global fzf_directory_opts --select-1 mock commandline --current-token "echo \$target" mock commandline "--current-token --replace --" "echo \$argv" mock commandline \* ""