Sublime Forum

Multi line alignment does not match the source code

#1

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

return if ENV'SECRETS'].blank? ||
          request.ip == 'test'

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

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!

0 Likes

#2

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.

0 Likes

#3

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:

fresh_field :activities, :type => Array, :default => ], :prompt_in => 30.days, :expires_in => 1.year

Source:

fresh_field :activities, :type => Array, :default => ], :prompt_in => 30.days, :expires_in => 1.year

0 Likes