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

Reindentation messes up case statements #120

Open
HeroCC opened this issue Apr 20, 2015 · 3 comments
Open

Reindentation messes up case statements #120

HeroCC opened this issue Apr 20, 2015 · 3 comments

Comments

@HeroCC
Copy link

HeroCC commented Apr 20, 2015

OS: Ubuntu 14.04
Version: Sublime Text Build 3083

When using case statements and syntax is set to bash, reindenting the file results in case statements looking like this: (indentation is small because I set tab to 2 spaces, but it reacts the same on a fresh install)

case "${flag}" in
  n) noInstall='true' ;;
u) autoUpdate='true' ;;
f) forseLN='true' ;;
*) error "Unexpected option ${flag}" ;;
esac

While they should look like this:

case "${flag}" in
  n) noInstall='true' ;;
  u) autoUpdate='true' ;;
  f) forseLN='true' ;;
  *) error "Unexpected option ${flag}" ;;
esac

There are many other examples of this (I can provide more) in my code, and a fresh install has the same problem. Is there any way to fix this?

My configuration: here

Thanks!

@PoslavskySV
Copy link

So, what is the status of the issue? Is there any workaround? This bug can really "make one mad"; I heavily use case ... esac in bash for parsing arguments, so after applying "reindent" the indentation in my file is completely broken.

@keith-hall
Copy link

I've done some experimentation, and it looks like the workaround is to remove the meta_scope: meta.scope.case-clause.shell line at https://github.com/sublimehq/Packages/blob/4db940a44b74727ade298927d5ffdb8826fc9769/ShellScript/Shell-Unix-Generic.sublime-syntax#L45

@keith-hall
Copy link

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

4 participants