You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Vim hangs due to the bug in the autofolding. With disabled autofolding (g:pymode_folding = 0), everything is ok.
To repeat the error, try to open a file whose first line contains the class definition. For example:
Meanwhile I suggest that you either put a blank line on top of the file (not so elegant) or put a docstring on it (which is recommended anyways). Those recommendations to not nullify the problem.
This did not solve for me using the example of pymode/__init__.py (using the first definition as definition). The following worked but then messed up the nested class declaration:
However the folding function is a recurrent trouble. Therefore I'm improving python-modes debugging functionlity rather than just doing a quickfix. Hang on tight, I'll post it within a week!
Activity
fmv1992 commentedon Nov 13, 2017
That is correct. I can confirm this bug and is very annoying.
We should revisit our folding file:
https://github.com/python-mode/python-mode/blob/bf018e262a0601bf5c9290e02d038f4694ff03cc/autoload/pymode/folding.vim
Meanwhile I suggest that you either put a blank line on top of the file (not so elegant) or put a docstring on it (which is recommended anyways). Those recommendations to not nullify the problem.
Thanks for reporting :)
fmv1992 commentedon Nov 14, 2017
Or even better, help us fixing this problem : )
kostochkin commentedon Nov 14, 2017
I have no experience in the VIM scripting, but this small change resolve the problem for me:
Before:
After:
fmv1992 commentedon Nov 15, 2017
This did not solve for me using the example of
pymode/__init__.py(using the first definition as definition). The following worked but then messed up the nested class declaration:I'll keep investigating. I have already spent hours (if not days) on this folding file and it never gets perfect : )
fmv1992 commentedon Nov 16, 2017
I think a found a solution.
However the folding function is a recurrent trouble. Therefore I'm improving python-modes debugging functionlity rather than just doing a quickfix. Hang on tight, I'll post it within a week!
fmv1992 commentedon Nov 18, 2017
As per our new troubleshooting mechanism I can more accurately describe our
problem.
We can see that the first line of the code gets its indent level correctly but
the second causes vim to hang:
fmv1992 commentedon Nov 19, 2017
Hey @kostochkin,
I think it was easier than expected.
Just removing the 'c' from searchpos() seems to have solved the issue.
Please give me feedback on this (if it solves for you as well).
Do not forget to checkout a version equal to or after
c7e6baa .
Indeed very tricky this folding issue.
Hope to hear from you soon.
Sample file:
Result of debug:
kostochkin commentedon Nov 19, 2017
It solved the problem for me. Works as expected. Thank you :)