On Oct 5, 2:11 am, Haakon Riiser <[email protected]> wrote:
> Take the following test.c:
>
>   int main()
>   {
>       printf("hello, world\n");
>       return 0;
>   }
>
> Edit this file, and enable foldmethod=indent.  Now, the printf
> and the return lines are folded.  Then, open the fold, for example
> using "za", and put the cursor on the printf-line.  Next, press "O"
> to insert a line above the printf-line.  Finally, press CTRL-P while
> in insert mode to use keyword completion.
>
> What happens for me when I do this is that the fold closes while
> doing keyword completion.  If I accept a keyword, e.g. by pressing
> <Return> or <Space>, the fold opens again.
>

Try this:

http://vim.wikia.com/wiki/Keep_folds_closed_while_inserting_text

(don't let the title fool you, it should also keep folds open,
basically it disables changes in the folds while in insert mode)

-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Raspunde prin e-mail lui