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

Continuation lines use tab and space mixtures #4

Closed
todb opened this issue Jan 29, 2010 · 5 comments
Closed

Continuation lines use tab and space mixtures #4

todb opened this issue Jan 29, 2010 · 5 comments
Labels

Comments

@todb
Copy link

todb commented Jan 29, 2010

It appears that continuation lines will always use a mix of spaces and tabs (using the current tabstop width) to align text on successive lines. See:

class B
    foob(:a,
       :b,
       :c
      )
end

With a tabstop set to 4, the ":b" is indented one tab and 3 spaces.

It seems preferable to simply indent normally, and not mess with all this alignment business. The major problem is when tabstops are changed, the alignment gets all thrown off (the typical problem when aligning with tabs).

I am a huge vim noob, so if I've missed something basic in my futzing with various indentation options, please ignore this.

Thanks!

(confirmed against the latest dev version:
$gem list | grep vim
vim-ruby (2010.01.29)
)

@todb
Copy link
Author

todb commented Jan 29, 2010

I'm not really good at explaining this, but here's an example screenshot. The first part is Python's continuation style, the second is Ruby's, both with a tabstop of 4 and with list on.

http://i.imgur.com/tDwIr.png

@todb
Copy link
Author

todb commented Jan 29, 2010

Here's another example:

class Klass
    some_long_var_name = case value
                         when :a
                             do_a
                         when :b
                             do_b
                         end
end

I do think I found the crux of the problem -- it appears that everyting in ruby-vim is based on the column number, which is great if all your tabs are spaces, but not so great if you (like me) are trying to use hard tabs when writing Ruby.

Because of this ruby-vim may just be unsuited to hard tabs, period. I may have to write my own indentation script after all.

@gsinclair
Copy link
Contributor

Perhaps that's the case. If you can find a way to make the current indent file work with hard tabs, let us know!

@now
Copy link
Member

now commented Oct 28, 2010

I am unable to reproduce the first example using any sane settings for tabstop and shiftwidth (4, 4). Tabstop actually doesn’t matter as the only thing that matters here is expandtab and shiftwidth.

The second example is indented correctly.

I suggest that you don’t use tabs, as no one else seems to be using them for Ruby, and that you keep your indentation level to the standard 2.

@now
Copy link
Member

now commented Nov 19, 2010

I am closing this as I can’t reproduce it.

@dkearns dkearns added the indent label Sep 18, 2015
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants