From 7f4ee93e7e5744a657179ae8f71af3bf8bf5e151 Mon Sep 17 00:00:00 2001 From: Hexin Date: Wed, 20 Nov 2024 02:10:27 +0900 Subject: [PATCH] Use parameter expansion --- src/core/parser.zsh | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/core/parser.zsh b/src/core/parser.zsh index 0c0a8f5..7e0b1f4 100644 --- a/src/core/parser.zsh +++ b/src/core/parser.zsh @@ -1,14 +1,8 @@ #!/usr/bin/env zsh _fzf_complete_get_command_pos() { - local cmd local arguments=("${(Q)${(z)@}[@]}") - - if [[ -n $cmd_word ]]; then - cmd=$cmd_word - else - cmd=$(__fzf_extract_command "$@") - fi + local cmd=${cmd_word-$(__fzf_extract_command "$@")} echo ${arguments[(i)$cmd]} }