Skip to content

Experimental Vim9 support #443

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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Experimental Vim9 support #443

wants to merge 6 commits into from

Conversation

AndrewRadev
Copy link
Member

@AndrewRadev AndrewRadev commented Dec 22, 2021

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.

* master:
  Add a spec for case-in pattern matching
  Only consider `in` at the beginning of a line
  Fix indentation for `in` keyword
  Fix tag maps
  Include "" and "." in 'path'
  Avoid recursively triggering in tag/file maps
  Prevent endless defs from starting a method region
  Add highlighting for shareable_constant_value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant