On 2014-11-26, Marius Gedminas wrote:

> I'm pretty sure the problem is not related to diffexpr, but rather the
> :silent prefix in front of the shell command you're running.
> 
> If I do
> 
>   :!sleep 1
> 
> vim redraws the screen correctly.
> 
> If I do
> 
>   :silent !sleep 1
> 
> vim clears the screen and doesn't redraw it.  This is in fact
> documented:
> 
>     ":silent" will also avoid the hit-enter prompt.  When
>     using this for an external command, this may cause the
>     screen to be messed up.  Use |CTRL-L| to clean it up
>     then.
> 
> although I don't understand why the seemingly-buggy behavior was
> documented rather than fixed.

Thank you very much!  That pointed me to a workaround.  I changed
the original command in my MyDiff() function,

    silent execute "!diff -d -a --binary " . opt . v:fname_in . " "
        \ . v:fname_new . " > " . v:fname_out

to

    call system("diff -d -a --binary " . opt . v:fname_in . " "
        \ . v:fname_new . " > " . v:fname_out)

and it's working perfectly so far.

The behavior of :silent does seem like a bug, though, because it
works fine (in this instance anyway) as long as screen-switching is
not enabled.  It doesn't seem that refreshing of the screen should
be affected by having switched to the other screen and back.

Regards,
Gary

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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui