-
Notifications
You must be signed in to change notification settings - Fork 69
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
Inserting a new line in a large script might be slow #116
Comments
mine is even slower, and I've got a decent macbook:
|
Thanks for the report/info in general. I've looked into optimizing this a while back, but it is not trivial. You can try changing vim-python-pep8-indent/indent/python.vim Line 51 in 3e61be5
There are many tests at least, so you would be covered when trying to optimize it yourself. |
Also an example script would be useful in general (anonymized if needed, or just something that triggers this) - IIRC it might be especially slow with unmatched opening I guess that it is (especially) slow for your with unclosed opening parenthesis as well? |
One idea might be to use a timeout with Related issue for Vim's own python indent script: vim/vim#1098 (comment) |
@toejough |
To mitigate this you might want to try #118 (or just add the timeout yourself to the call). I've found some older stashes in this regard, where I've experimented e.g. with doing a quick round first (only looking up e.g. 5 lines), before looking potentially 1000 lines up for Also caching might help in general. Anyway, it appears to be related to your specific use case (the lines before See #99 (comment) for discussion about using the Python AST actually. |
Came across some bummer in Vim itself: it appears to evaluate the skip expression always.. :/ |
wow, thank you for the prompt and informative responses!! 🥇 The updates in 118 (at least as of the last passing check I saw - efa7e6b) cut the delay from this plugin in half. That's some significant improvement - thank you! Happy to try out other updates if you'd like but what's in 118 is already significantly better (at least for me!) |
Great to hear, pushed some more. |
Merged #118. Please open new issues with remaining things (and examples) for improvements. |
vim 8 insert new line, python filesize 1K
The text was updated successfully, but these errors were encountered: