On Tue, Nov 25, 2014 at 11:12:50AM -0800, Gary Johnson wrote:
> On 2014-11-24, Gary Johnson wrote:
> > On 2014-11-23, Gary Johnson wrote:
> > 
> > > I'll try to find an old version that doesn't exhibit the problem in
> > > my normal work environment.
> > 
> > Well, that didn't pan out, either.  I went back to almost a year
> > ago, to 7.4.135, and I still see the display not fully refresh after
> > a command that causes 'diffexpr' to be evaluated.  I'll try to find
> > out why and create a patch and/or a workaround.
> > 
> > I don't know why I didn't notice this until recently.
> 
> Progress!  I remembered what I changed about the time this problem
> appeared!
> 
> I normally clear 't_ti' and 't_te' in my ~/.vimrc because I usually
> want whatever I was editing to remain on the screen after I exit vim
> so that I can continue to refer to it as I execute other commands.
> I recently added an exception for vimdiff because for my work flow I
> would rather have the screen restored to what it was before I
> executed vimdiff.
> 
> That changed Vim's processing of 'diffexpr'.  When screen switching
> was disabled, Vim's display was always updated correctly.  Now that
> I have screen switching enabled for vimdiff, Vim swaps screens
> before executing the 'diffexpr' shell command.  After the shell
> command has executed, vim attempts to restore the screen it uses for
> editing by calling starttermcap (from within do_shell at line 1508
> of ex_cmds.c).  That function, rather than restoring the previous
> screen contents, clears the screen completely.  Subsequently-called
> functions that update the screen contents update only the parts they
> think have changed, leaving the screen a patchwork of text.
> 
> At this point I understand part of the problem, but I don't
> understand the mechanics of Vim's screen management well enough to
> be able to spot what's missing.  I'll continue to work on it, but I
> hope by posting here I'll prompt someone else's insight.

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.

Marius Gedminas
-- 
/*
 * This function is about (re)setting the class of a held lock,
 * yet we're not actually holding any locks. Naughty user!
 */

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

Attachment: signature.asc
Description: Digital signature

Raspunde prin e-mail lui