vim-ruby
vim-ruby copied to clipboard
Experimental Vim9 support
Not planning to merge this, just playing around. Changes were mostly mechanical, so it wasn't a big deal to apply. I might do something like keep both versions of the code in separate files and if-clause them, which might actually make it mergeable.
Performance-wise, I tested on a particularly annoying edge case, a list of 199 entries that looks like this:
[
'Test',
'Test',
# ...
'Test',
]
Every indent needs to find the "most significant line" with a linear search, going through every line above until the [. Anyway, here's a result of profile func GetRubyIndent on master:
FUNCTION GetRubyIndent()
Defined: ~/.vim/bundle/ruby/indent/ruby.vim:189
Called 201 times
Total time: 16.409863
Self time: 0.055199
And here it is when it calls the vim9 function:
FUNCTION GetRubyIndent()
Defined: ~/.vim/bundle/ruby/indent/ruby.vim:53
Called 201 times
Total time: 11.736142
Self time: 0.003108
It's nothing too dramatic, but it's not nothing, I guess.