Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to complete ${T<tab> outside of quotes #89

Open
systemmonkey42 opened this issue Jan 28, 2024 · 1 comment
Open

Unable to complete ${T<tab> outside of quotes #89

systemmonkey42 opened this issue Jan 28, 2024 · 1 comment
Assignees

Comments

@systemmonkey42
Copy link

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.

@lincheney lincheney self-assigned this Feb 19, 2024
@lincheney
Copy link
Owner

i've made a basic fix here 62c49fb
But it won't handle more complicated cases, like ${var:-${another_var

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants