-
Notifications
You must be signed in to change notification settings - Fork 1.3k
$_ incorrectly highlighted red #619
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
Comments
Are literal directory names highlighted in green at command position when AUTO_CD is set? AFAICS they aren't [can't test this myself right now], so you're essentially asking for AUTO_CD support to be added. (Once literal directory names are handled, simple parameter expansions will DTRT too.) Would you be interested in contributing this feature? |
By the way, |
Whoops, AUTO_CD paths are made purple (on my system) not green. I'm afraid I don't have the understanding, time or energy to implement this. Alt-. doesn't work for me, I guess either conflict with another zsh script or bad key binds. Thank you for the tip though. |
It's a bit more complicated than just supporting AUTO_CD. Currently
_ properly. We'd need to save the value of _ and then special case the expansion code because _ will have changed many times over once we've gotten to here
|
That pattern would match |
See #617 for |
My reading is two separate issues:
|
Indeed it does match |
Indeed it does match `$_` oops. I agree in general special parameters
should use a `indererminate` style; however, I think `$_` is useful
enough to special case. There may be a cleaner way, but worst case we
could save `${${(z)BUFFER}[-1]}` on `zle-line-finish`.
And what guarantees us that value would be equal to the actual value of $_ that will be used when zsh executes the line? What if there is another plugin after z-sy-h in the set of plugins and it writes to ${BUFFER} before the line is executed?
|
Nothing. However, highlighting on the modified line would already be incorrect for those users (and we do document that we should be sourced last). |
Fair enough. Re 'cleaner way', I thought we could have zle expose the REPL-level value of |
Cross-referencing #695. |
$_ (dollar underscore) is the last parameter from the previous line. I often (with autocd on) enter "$_" directly after a command to jump into the destination directory. However it's always highlighted red. Apologies if this is covered by another issue, I went through a number but couldn't find anything directly related. Thanks.
The text was updated successfully, but these errors were encountered: