Skip to content

Highlight parameter expansion history modifiers #485

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

Open
danielshahaf opened this issue Jan 17, 2018 · 7 comments
Open

Highlight parameter expansion history modifiers #485

danielshahaf opened this issue Jan 17, 2018 · 7 comments

Comments

@danielshahaf
Copy link
Member

$foo:hey should highlight $foo:h as a parameter expansion.

  • both within and without quotes
  • modifiers can be chained, $foo:h:h:t
@danielshahaf
Copy link
Member Author

Modifiers require braces when KSH_ARRAYS is set.

@danielshahaf
Copy link
Member Author

According to zshexpn, modifiers are:

  • :[aAcehlpPqQ&tuxfw]
  • :s/l/r[/] , :gs/x/y/, :s/x/y/:G where the delimiter can vary
  • :F:expr: where the delimiter can vary
  • :W:sep: likewise

@danielshahaf
Copy link
Member Author

danielshahaf commented Jan 19, 2018

@phy1729 You mentioned having some pending changes to this area of the code, please unassign yourself once they've been merged to master (to avoid needless conflicts). Thanks!

@phy1729 phy1729 removed their assignment Jan 20, 2018
@danielshahaf
Copy link
Member Author

I've implemented something that covers the modifiers that take no argument: master...danielshahaf:i485-history-modifiers-v1

... but if I wrote a regression test, it would conflict with #492, so instead I just described the regression test I would create (pending manual verification, of course) and I'll put this on hold pending #492's merge.

@danielshahaf danielshahaf added this to the 0.7.0 milestone Jan 20, 2018
@phy1729
Copy link
Member

phy1729 commented Jan 21, 2018

I think that bit and the parameter handling in _highlight_arguments should be pulled out into a new function. Not sure what to do about the style. Perhaps parameter with a fallback to dollar-double-quoted-argument?

@danielshahaf
Copy link
Member Author

dollar-un-quoted-argument (maybe without that ungrammatical hyphen) would be consistent. variable or parameter-expansion would work.

@danielshahaf
Copy link
Member Author

Triage: #697 (comment)

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

No branches or pull requests

2 participants