Preben Randhol wrote:
"A.J.Mechelynck" <[EMAIL PROTECTED]> wrote on 15/08/2006 (10:59) :
Have you tried ":set paste"? Or rather, since it's inside a function,

        let save_paste = &paste
        set paste
        "
        " do your stuff
        "
        if ! save_paste
                set nopaste
        endif


No, I haven't tried it. I saw that it reset a lot of other options. Will
all these options be set back to the original options when I call
nopaste?

Preben



From ":help 'paste':

        When the 'paste' option is reset the mentioned options are restored to
        the value before the moment 'paste' was switched from off to on.


So maybe the way to do it is:

        let save_paste = &paste
        if ! &paste
                set paste
        endif
        "
        " do your stuff
        "
        if ! save_paste
                set nopaste
        endif


Best regards,
Tony.

Reply via email to