Indentation and comments

Nikolai Weibull vim-ruby-devel-list at pcppopper.org
Wed Oct 15 02:30:50 EDT 2003


* Nikolai Weibull <vim-ruby-devel-list at pcppopper.org> [Oct, 15 2003 01:20]:
> * Gavin Sinclair <gsinclair at soyabean.com.au> [Oct, 15 2003 00:51]:
> > There's a recent bug report that says that comments always get
> > "indented" flush against the left margin.
> >
> > Previous revisions had comments ignored in indenting operations.
> >
> > The bug report suggests aligning comments with current indent level,
> > which I support, but different people have different commenting
> > styles.  What do you think should be done?
> OK.  To be able to work correctly we basically need to ignore comment
> lines.  People may mess with them themselves.  If you enter the text
> yourself, everything will work fine.  If you simply cut and paste
> something like
>
> class Foo
> def initialize()
> #sets up stuff
> code()
> end
> end
>
> from an outside source, the #sets up stuff line will not be touched.
> This, I think, is OK for maintaining everything else working correctly.
> They don't flush left if entered interactively.  Either this, or they
> are using some old version that may have had an intermediate bug.  the
> latest CVS works fine.
>
> What happens is that if the script finds that a line is only a comment,
> it is ignored.  If it is completely inside a string it is also ignored.
> The lines current indent is used instead.  I may try to figure out some
> other way of doing this (I'll think over it's necessity) but this is how
> it works atm.
> 	nikolai
OK, fixed.  sorry for multiple messages.  anyway, this should work fine
now.  hope i didn't forget any cases ;-)

--
::: name: Nikolai Weibull    :: aliases: pcp / lone-star / aka :::
::: born: Chicago, IL USA    :: loc atm: Gothenburg, Sweden    :::
::: page: www.pcppopper.org  :: fun atm: gf,lps,ruby,lisp,war3 :::
main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}


More information about the vim-ruby-devel mailing list