pseewald / vim-anyfold

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

error after making modifications or otherwise leaving insert mode #33

Closed samf closed 4 years ago

samf commented 4 years ago

When I run with autocmd FileType * AnyFoldActivate in my vimrc, I get the following error after modifying the buffer:

Error detected while processing InsertLeave Autocommands for "<buffer=1>"..function <SNR>103_ReloadFolds:
line   38:
E111: Missing ']'

This has started happening only recently. Strangely, you haven't modified vim-anyfold recently. I've tried removing each of my other plugins in turn, and the problem remains. Perhaps a newer version of vim is causing this?

samf commented 4 years ago

I should have mentioned: my current vim is version 8.2.1350.

samf commented 4 years ago

If I comment out line 496:

let b:anyfold_commentlines[changed[0]-1 : changed[1]-1] = s:MarkCommentLines(changed[0], changed[1])

then the problem goes away.

But it looks to me like your [s match with your ]s. I can't see the flaw, but I don't speak vim either. Again, maybe the problem is not in your code, but in recent versions of vim itself.

pseewald commented 4 years ago

Interesting and weird. You're using a very recent version of vim (2 days old) so I just hope this is going to be fixed in Vim soon. I looked for vim issues related to list slicing and I found this and this. So it seems that list slicing does not work unconditionally in vim.

StarWitch commented 4 years ago

Confirming that I'm also receiving this error, also version 1350. Reverting to version 1300 fixes it for me.

StarWitch commented 4 years ago

Looks like 1400 (released today on Mac Homebrew) fixes it. 😄

pseewald commented 4 years ago

Thanks a lot for letting me know, this can be closed then.