Indent problems with symbols containing keywords - solved?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Indent problems with symbols containing keywords - solved?

Czarek

Hi,

The following gives the wrong indent (vim 7.1.314, Ubuntu):

---------(after indent its the same)-------
class AAA
   def aaa
     a = [ :title,
       :from,
       :until,
     ]
       end
   end
-----------------

It seems the 'until' is matched, even when it's a symbol. I dug through
the 'syntax/ruby.vim' I already had, since the rubyforge git access is
broken (?).

The following is the best I could think of:

add the \@<! pattern to ignore symbols, replacing all instances of
keyword matchers, like:

        \\<\\(while\\|until\\|for\\)\\>")'

with:

        \\<\\(while\\|[:]\@<!until\\|for\\)\\>")'

I did it for just the until keyword and it seems to work fine.

Could the problem be caused by Vim treating the ':' char as part of a
keyword?

Thanks in advance.
       

       


_______________________________________________
vim-ruby-devel mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/vim-ruby-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Indent problems with symbols containing keywords - solved?

Tim Pope-2
On Tue, Mar 17, 2009 at 12:51:25AM +0100, Cezary Bagiński wrote:

>
> Hi,
>
> The following gives the wrong indent (vim 7.1.314, Ubuntu):
>
> ---------(after indent its the same)-------
> class AAA
>   def aaa
>     a = [ :title,
>       :from,
>       :until,
>     ]
>       end
>   end
> -----------------
>
> It seems the 'until' is matched, even when it's a symbol. I dug through
> the 'syntax/ruby.vim' I already had, since the rubyforge git access is
> broken (?).
>
> The following is the best I could think of:
>
> add the \@<! pattern to ignore symbols, replacing all instances of
> keyword matchers, like:
>
> \\<\\(while\\|until\\|for\\)\\>")'
>
> with:
>
> \\<\\(while\\|[:]\@<!until\\|for\\)\\>")'
>
> I did it for just the until keyword and it seems to work fine.

This appears to already be in effect in the latest version of Vim-Ruby.

Cheers,
Tim
_______________________________________________
vim-ruby-devel mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/vim-ruby-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Indent problems with symbols containing keywords - solved?

Czarek
I tried to git-clone from rubyforge instead of git hub, which was dumb.
(http://rubyforge.org/scm/?group_id=16)

HEAD works fine, thanks. Sorry for the trouble.


Tim Pope wrote:

> On Tue, Mar 17, 2009 at 12:51:25AM +0100, Cezary Bagiński wrote:
>> Hi,
>>
>> The following gives the wrong indent (vim 7.1.314, Ubuntu):
>>
>> ---------(after indent its the same)-------
>> class AAA
>>   def aaa
>>     a = [ :title,
>>       :from,
>>       :until,
>>     ]
>>       end
>>   end
>> -----------------
>>
>> It seems the 'until' is matched, even when it's a symbol. I dug through
>> the 'syntax/ruby.vim' I already had, since the rubyforge git access is
>> broken (?).
>>
>> The following is the best I could think of:
>>
>> add the \@<! pattern to ignore symbols, replacing all instances of
>> keyword matchers, like:
>>
>> \\<\\(while\\|until\\|for\\)\\>")'
>>
>> with:
>>
>> \\<\\(while\\|[:]\@<!until\\|for\\)\\>")'
>>
>> I did it for just the until keyword and it seems to work fine.
>
> This appears to already be in effect in the latest version of Vim-Ruby.
>
> Cheers,
> Tim
> _______________________________________________
> vim-ruby-devel mailing list
> [hidden email]
> http://rubyforge.org/mailman/listinfo/vim-ruby-devel

_______________________________________________
vim-ruby-devel mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/vim-ruby-devel
Loading...