Hi sergio!

On Sa, 22 Jan 2011, sergio wrote:

> Really, I want to see foldcolum only when at least one fold presents.
> CursorHold is a workaround. I made another one:

Of course it is. There is no other way to find out, if foldmethod 
changed.

> map <F2> :call ToggleFoldColumn()<CR>
> imap <F2> <C-O>:call ToggleFoldColumn()<CR>
> function ToggleFoldColumn()
>   if &foldcolumn == 0
>     set foldcolumn=1
>   else
>     set foldcolumn=0
>   endif
> endfunction
>
> P.S.
> How to understand is any foldable text presents in current buffer?

Make a function and check for each line, whether it is in a fold:

function HasFoldedLine()
let lnum=1
while lnum <= line("$")
    if (foldclosed(lnum) > -1)
        return 1
    endif
    let lnum+=1
endwhile
return 0
endfu 

Mit freundlichen Grüßen
Christian
-- 
Gott erhalte uns die Freundschaft. Man möchte beinah glauben, man sei 
nicht allein.
                -- Kurt Tucholsky (Schnipsel)

-- 
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

Reply via email to