Open systemmonkey42 opened 7 months ago
Outside of a quoted string, "${VAR" is split into "$" "{" and "VAR", and pressing TAB attempts filename completion on "VAR".
The following patch
@@ -14,7 +14,7 @@ _fzf_bash_completion_shell_split() { $_fzf_bash_completion_grep -E -o \ -e '\|+|&+|<+|>+' \ -e '[;(){}&\|]' \ - -e "(\\\\.|[^\"'[:space:];(){}&\\|<>${wordbreaks}])+" \ + -e "(\\\\.|\$\{[^}]*(\}|$)|[^\"'[:space:];(){}&\\|<>${wordbreaks}])+" \ -e "\\\$'(\\\\.|[^'])*('|$)" \ -e "'[^']*('|$)" \ -e '"(\\.|\$($|[^(])|[^"$])*("|$)' \
seems to help, but I'm sure there are unintended side effects.
i've made a basic fix here https://github.com/lincheney/fzf-tab-completion/commit/62c49fb10f16db3d855586382e91066d2cea9c93 But it won't handle more complicated cases, like ${var:-${another_var
${var:-${another_var
Outside of a quoted string, "${VAR" is split into "$" "{" and "VAR", and pressing TAB attempts filename completion on "VAR".
The following patch
seems to help, but I'm sure there are unintended side effects.