File tree 1 file changed +11
-1
lines changed
plugin/refactorings/general
1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -134,15 +134,24 @@ function! s:ruby_identify_tokens( tokenlist )
134
134
135
135
let ignore_to_eos = 0
136
136
137
+ let i = 1
137
138
for token in a: tokenlist
139
+ try
140
+ let next_token = a: tokenlist [i + 1 ]
141
+ catch
142
+ endtry
138
143
if index (reserved,token) != -1
139
144
let sym = " KEYWORD"
140
145
elseif match (token, ' \v^\s+$' ) != -1
141
146
let sym = " WS"
142
147
elseif match (token, ' \v^\:\w+$' ) != -1
143
148
let sym = " SYMBOL"
144
149
elseif match (token, ' \v^\I\i*$' ) != -1
145
- let sym = " VAR"
150
+ if match (next_token, ' \:' != -1 )
151
+ let sym = " SYMBOL"
152
+ else
153
+ let sym = " VAR"
154
+ endif
146
155
elseif match (token, ' \v^\@\I\i*$' ) != -1
147
156
let sym = " IVAR"
148
157
elseif match (token, ' \v^\d+(\.\d+)?$' ) != -1
@@ -189,6 +198,7 @@ function! s:ruby_identify_tokens( tokenlist )
189
198
endif
190
199
191
200
return statements
201
+ let i += 1
192
202
endfunction
193
203
194
204
" Synopsis:
You can’t perform that action at this time.
0 commit comments