Recently, when I open a file, most likely the issue is limited to rmarkdown filetype (folding provided by vim-pandoc plugin; I am using terminal vim 8.2 in Linux). After working on the file for a while, the folding disappears. The folding keys (zi, zM) and set foldenable does not have any effect, defining a different foldmethod does not help. Accordingly, set foldlevel reports 0 everywhere. The only way to get folds back is to close the file and reopen it.
How could I troubleshoot it to figure out what goes wrong? How could I get the folds back without closing/reopening the file?