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

lines after private should not be indented in all cases #56

Closed
bjeanes opened this issue Nov 11, 2011 · 4 comments
Closed

lines after private should not be indented in all cases #56

bjeanes opened this issue Nov 11, 2011 · 4 comments
Labels

Comments

@bjeanes
Copy link

bjeanes commented Nov 11, 2011

E.g.

def foo
  puts :bar
end
private :foo

# nothing here should be intented

Basically, if private has any arguments, no following methods should be intented.

Ideally indentation after private should be optional entirely, as there isn't conformity in the community about how that should be.

@AndrewRadev
Copy link
Member

As far as I understand your request, this already is the default behaviour. For example:

class Foo
  def foo
    puts :bar
  end
  private :foo

  def bar
    puts :baz
  end
  private :bar
end

The current indenting script doesn't take into account private, regardless of whether it has any arguments or not.

Are you sure you're using the latest version of vim-ruby? Is it possible that you're using some other indenting script instead?

@now
Copy link
Member

now commented Nov 11, 2011

On Fri, Nov 11, 2011 at 20:03, Bodaniel Jeanes
reply@reply.github.com
wrote:

E.g.

   def foo
     puts :bar
   end
   private :foo

   # nothing here should be intented

Basically, if private has any arguments, no following methods should be intented.

Ideally indentation after private should be optional entirely, as there isn't conformity in the community about how that should be.

The rule for indentation of private, protected, and public should be
changed. The standard style is to have them at the same level of
indent as the code that surrounds it, with or without arguments. At
the time, there was a trend to dedent them one level, but it doesn’t
seem to have persisted.

@tpope
Copy link
Member

tpope commented Nov 11, 2011

There word "private" doesn't even appear in indent/ruby.vim. @bjeanes, I'm assuming the problem is with your setup.

@tpope tpope closed this as completed Nov 11, 2011
@bjeanes
Copy link
Author

bjeanes commented Nov 11, 2011

Yes it would seem so. I'll have to dig in to see where that could come from.

@dkearns dkearns added the indent label Sep 18, 2015
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

5 participants