Skip to content
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

fix #1165: insert mode lag #1552

Merged
merged 5 commits into from
Mar 15, 2024
Merged

fix #1165: insert mode lag #1552

merged 5 commits into from
Mar 15, 2024

Conversation

mg979
Copy link
Contributor

@mg979 mg979 commented Mar 6, 2024

Ultisnips was traversing the whole runtimepath every time an expansion was attempted, something that happens for every key press since there is autotrigger.

Even without autotrigger, traversal was done at every snippet expansion, which caused slowdowns in that case.

With this change, traversal happens only the first time, or after a source must be refreshed (because a snippets file has been updated).

Note: I cannot run tests (Windows).

Ultisnips was traversing the whole runtimepath every time an expansion
was attempted, something that happens for every key press since there is
autotrigger.

Even without autotrigger, traversal was done at every snippet expansion,
which caused slowdowns in that case.

With this change, traversal happens only the first time, or after
a source must be refreshed (because a snippets file has been updated).
@SirVer
Copy link
Owner

SirVer commented Mar 6, 2024

That would be a great improvement! Looking at the tests it seems you deterministically broke on. Will you have a look at that?

@mg979
Copy link
Contributor Author

mg979 commented Mar 6, 2024

The test test_SnipMate.snipMate_OtherFiletype fails, I don't know why. If I do the steps manually in the editor it works. Any idea?

Force a refresh also for the FileType autocommand.
@mg979
Copy link
Contributor Author

mg979 commented Mar 6, 2024

Should be fixed now, it was broken because it only worked for the first loaded filetype.

mg979 added 3 commits March 7, 2024 09:45
And move the autocommand into the autoload file.
Remove the underscore since it's accessed in the manager class.
@SirVer
Copy link
Owner

SirVer commented Mar 15, 2024

@mg979 Thanks for working on this, Gianmaria! This was a common complaint and I never found the time to track it down. Your work is very appreciated and thanks for fixing the tests!

@SirVer SirVer merged commit 49dc8cb into SirVer:master Mar 15, 2024
11 checks passed
@mg979
Copy link
Contributor Author

mg979 commented Mar 15, 2024

The initial commit broke proper snippets loading actually, not just tests. I think #1496 could also be closed.

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.

2 participants