Home Download Buy Blog Forum Support

Multi line alignment does not match the source code

Multi line alignment does not match the source code

Postby wz3chen on Tue Dec 04, 2012 8:30 pm

In Sublime 2, I would have the following in the file

Code: Select all
return if ENV['SECRETS'].blank? ||
          request.ip == 'test'


But when I open/view the file in anything else, the code looks as follows:

Code: Select all
return if ENV['SECRETS'].blank? ||
                       request.ip == 'test'

The line alignment does not match up.

Would you know why that's happening?

Thanks in advance!
wz3chen
 
Posts: 2
Joined: Tue Dec 04, 2012 8:25 pm

Re: Multi line alignment does not match the source code

Postby bronson on Tue Dec 04, 2012 9:11 pm

Guess: you have hard tabs in the file and have set Sublime to show 4 spaces per tab. Everything else is showing 8 spaces per tab.

Easiest fix: convert the tabs to spaces. Hard tabs only work for small teams who all have their editors set to the same settings.
bronson
 
Posts: 38
Joined: Wed Nov 28, 2012 8:52 pm

Re: Multi line alignment does not match the source code

Postby wz3chen on Wed Dec 05, 2012 9:51 pm

I have my tab sizes as 2 and I had already set "translate_tabs_to_spaces" to true but I'm still having the same problem.
It seems that for the multi line alignment the source is ahead by 4 or 5 spaces.

Sublime:
Code: Select all
  fresh_field :activities,
              :type => Array, :default => [],
              :prompt_in => 30.days,
              :expires_in => 1.year   


Source:
Code: Select all
fresh_field :activities,
                 :type => Array, :default => [],
                 :prompt_in => 30.days,
                 :expires_in => 1.year
wz3chen
 
Posts: 2
Joined: Tue Dec 04, 2012 8:25 pm


Return to Technical Support

Who is online

Users browsing this forum: Max1mus and 27 guests

cron