views:

52

answers:

1

Why do some folds in vim are saved some not while some are being saved? I have the following in my .vimrc:

autocmd BufWinLeave *.* mkview
autocmd BufWinEnter *.* silent loadview

Example: I make these 2 folds in a file:

+--  2 lines: if(!bRet)---------------------------...
    return bRet;
}   
+-----------  5 lines: else-----------------------...

When I reload, I get:

+--  2 lines: if(!bRet)---------------------...
    return bRet;
}
else
{
    o_Logger.EHLog(Logger::LT_ERROR, true, 0, __FILE__, __LINE__, "File name loading failed");
    return false;
}

Why does that happen and how to rectify it?

A: 

What type of folding are you using? Manual?

Also, are you sure the second fold is not restored? Given what you've said, it's possible the fold exists but is restored as open rather than closed.

To test run the command [:set foldlevel=0] after you open the document. Does the "missing" fold not appear?

Herbert Sitz