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

sh syntax highlight breaks on "${*//#/x}": everything after becomes shDoubleQuote #5054

Closed
chkno opened this issue Oct 14, 2019 · 5 comments
Closed
Labels

Comments

@chkno
Copy link

@chkno chkno commented Oct 14, 2019

sh syntax highlighting treats # as introducing a comment when inside "${var// .... /}", but shell does not. "${var/ .... /}" (single replace instead of replace-all -- one initial / instead of two) works as expected.

To Reproduce

  1. Edit this file with syntax highlighting on:
#!/bin/bash

expand_octothorpes() {
  echo "${*//#/octothorpe}"
}

# The rest of this file is highlighted as shDoubleQuote

expand_octothorpes "$*"

Screenshots
quoted-octothorpe

Environment:

Additional context
Possibly related to #364.
Maintainer: @cecamp

@chrisbra

This comment has been minimized.

Copy link
Member

@chrisbra chrisbra commented Oct 14, 2019

does is work if your force bash mode?

@chkno

This comment has been minimized.

Copy link
Author

@chkno chkno commented Oct 14, 2019

The #!/bin/bash forces bash mode -- echo b:current_syntax says bash.

@k-takata k-takata added the runtime label Oct 14, 2019
@cecamp

This comment has been minimized.

Copy link
Collaborator

@cecamp cecamp commented Oct 16, 2019

Please try version 189 (astro-only) from my website

@chkno

This comment has been minimized.

Copy link
Author

@chkno chkno commented Oct 17, 2019

This is fixed with version 189. Thanks!

@chrisbra

This comment has been minimized.

Copy link
Member

@chrisbra chrisbra commented Oct 18, 2019

okay, closing then. I suppose Charles will submit an updated version to Bram eventually.

@chrisbra chrisbra closed this Oct 18, 2019
iiey added a commit to iiey/dotfiles that referenced this issue Dec 6, 2019
Problem: syntax highlight breaks after folding "}}}"
Solution:
    - force bash syntax
    - use sh.vim 189 (vim/vim#5054)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.