Improve comment
This commit is contained in:
parent
e91b76c517
commit
16e001c3a2
1 changed files with 5 additions and 3 deletions
|
@ -33,11 +33,13 @@ bool fzf_file_preview true
|
||||||
|
|
||||||
|
|
||||||
define-command -hidden fzf-file -params 0..1 %{ evaluate-commands %sh{
|
define-command -hidden fzf-file -params 0..1 %{ evaluate-commands %sh{
|
||||||
|
# Default fzf-file behavior
|
||||||
search_dir="."
|
search_dir="."
|
||||||
if [ "$1" = "buffile-dir" ]; then
|
if [ "$1" = "buffile-dir" ]; then
|
||||||
# dirname will return '.' if the file is non-existent.
|
# If the buffile-dir functionality (which is currently mapped to <fzf-mode> F) is
|
||||||
# This value is a fail-safe default if we ever use buffile-dir functionality
|
# invoked by mistake on a buffile like `*scratch*` or `*grep*` and similar, there will be
|
||||||
# by mistake on files that do not have a directory e.g. *scratch*
|
# no slashes in the buffile name and `dirname` will return `.` which means the functionality
|
||||||
|
# will revert to the normal fzf-file behavior -- which is what we want in this scenario.
|
||||||
search_dir=$(dirname "$kak_buffile")
|
search_dir=$(dirname "$kak_buffile")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue