
For some reason, when I opened a file directly the manual fold method was not refreshed correctly initially. The present fix fixes the problem by refreshing the folds after first CursorMoved event, which seems to work nicely. Note that the autocommand is deleted immediately.