pseewald / vim-anyfold

Language agnostic vim plugin for folding and motion based on indentation.
MIT License
268 stars 11 forks source link

Error detected while processing function <SNR>80_ReloadFolds: #21

Closed huangyingw closed 6 years ago

huangyingw commented 6 years ago

Not easy to reproduce, I haven't found the 100% scenario to reproduce this issue. But I am sure it happened at my side 4-5 times daily. I only saw this issue when open/close PROJECTROOT/.git/index repeatedly. .git/index file is a special file under .git folder. Its content is dynamically changed in background. Not sure whether it is related to neovim. I am using neovim, vim is too too too slow for me. And transfer from vim to neovim is very very easy.

Bellowing are the neovim output:

Error detected while processing function 80_ReloadFolds: line 14: E121: Undefined variable: b:anyfold_ind_actual Press ENTER or type command to continue Error detected while processing function 80_ReloadFolds: line 14: E116: Invalid arguments for function len Press ENTER or type command to continue Error detected while processing function 80_ReloadFolds: line 14: E15: Invalid expression: line('$') - len(b:anyfold_ind_actual) Press ENTER or type command to continue Error detected while processing function 80_ReloadFolds: line 14: E121: Undefined variable: b:anyfold_ind_actual Press ENTER or type command to continue Error detected while processing function 80_ReloadFolds: line 14: E116: Invalid arguments for function len Press ENTER or type command to continue Error detected while processing function 80_ReloadFolds: line 14: E15: Invalid expression: line('$') - len(b:anyfold_ind_actual)

throskam commented 6 years ago

I can reproduce it when closing and reopening a buffer (e.g. :bd|e#)

pseewald commented 6 years ago

@huangyingw I hope my fix resolves the issue, please let me know in case you run into this again.

huangyingw commented 6 years ago

@pseewald yes, great thanks, if I see this again, certainly I will let you know.