Thursday, July 12, 2012

Re: vim : fold expansion and refresh

ping <songpingemail@gmail.com> a écrit:
>
> guys:
>
> everytime I expand the fold , I notice the text got a little bit messed
> up somewhere, c-l quickly clean it nicely.
> so if I map "l" as following:
> :map l zo<C-l>
> it works fine, except I can't use its normal function (move right).
> how to solve this issue?
> my guess there should be a small script/function that check if this is
> on a folded text ,
> but my vimL ability doesn't allow me to make it concrete.
> any help I can get ?

Try this (not really tested):

function! CheckFold()
if foldclosed(line('.')) != -1
foldopen
redraw!
endif
return 'l'
endfunction
noremap <expr> l CheckFold()

Hope it helps,
Paul


--
You received this message from the "vim_use" 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

No comments: