Home Download Buy Blog Forum Support

Bash case indentation

Bash case indentation

Postby Zopiac on Sun Nov 25, 2012 10:50 pm

With the bash shell script syntax, case switches don't indent properly, ex:

typing
Code: Select all
case $1 in
a)
echo hello
;;
b)
echo
goodbye
;;
*)
echo what?
;;
esac


should display:
Code: Select all
case $1 in
   a)
      echo hello
      ;;
   b)
      echo goodbye
      ;;
   *)
      echo what?
      ;;
esac


but instead displays:
Code: Select all
case $1 in
   a)
echo hello
;;
b)
echo
goodbye
;;
*)
echo what?
;;
esac


Sorry if there's a better place to post this, but it's been bugging me all day! Especially since I tend to rely on "reindent lines" to fix any indentation blunders that may have popped up, but that just sends all of the case clauses flush to the left.
Zopiac
 
Posts: 1
Joined: Sun Nov 25, 2012 10:42 pm

Re: Bash case indentation

Postby psychomachine on Thu Jan 17, 2013 8:46 pm

hey zopiac,

did you ever figure this one out? i am wondering about exactly the same thing.
psychomachine
 
Posts: 15
Joined: Thu Jan 17, 2013 8:45 pm

Re: Bash case indentation

Postby lax313 on Fri Mar 07, 2014 3:31 pm

I'm sorry for another "me too" post, but the ugly is killing my eyes!

I tried to take a look at it and ended up in
Code: Select all
Packages/ShellScript/Shell-Unix-Generic.tmLanguage


But I found it a bit overwhelming to understand the finer point of syntax definitions in sublime text just to fix this.

I guess this is just a call for help from someone with a more appropriate skill set than I have.
lax313
 
Posts: 1
Joined: Fri Mar 07, 2014 10:55 am


Return to General Discussion

Who is online

Users browsing this forum: Google [Bot], prmaple and 29 guests