On Thu, 18 May 2006 at 7:33am, Eric Arnold wrote:

> On 5/18/06, Yakov Lerner <[EMAIL PROTECTED]> wrote:
> > On 5/18/06, Eric Arnold <[EMAIL PROTECTED]> wrote:
> > > I''ve been chasing this for a while, so I might as well ask, even
> > > though it seems like a stupid question.  What's the right way to clear
> > > the command line between echo blocks in a script, without causing a
> > > full screen redraw?
> > >
> > > Everything I try eventually fails when the command line has been
> > > scrolled/grown upwards by output longer than cmdheight.  I can't see
> > > the exact rule, since some things like:
> > >
> > >     echo :<CR>
> > >
> > >     normal :
> > >
> > > etc., come close, but no cigar.
> >
> > When output was longer than cmdheight, if you look at the sceen
> > contents and the statusline in this situation, you'll
> > see it's shifted upward in a manner that never
> > happens during editing, essentially screen is corrupted. That's why
> > I think redraw is the only way out of this.
> >
> > Yakov
> >
>
> That's true in some, but not all cases, which is what gives me any
> hope.  For example,
>
>               let &cmdheight = 1
>               exe "normal :echo\<cr>"
>               let &cmdheight = s:tmp_cmdheight
>
> works when the statusbar has been pushed up a small number of lines.
> It seems to know how to recover without a full redraw.  If it gets
> pushed up even more, then it fails to clear.
>
> The command also doesn't reflect the pushed position of the
> statusline, so there's no way to put a case for it in the script that
> way.

I never face this issue, as in all my maps, I try to avoid the output of
commands appearing on the screen. Here are some techniques off the top
of my head (you might find more if you search all my plugins, for maps):
- Use silent where possible.
- To execute functions on command-line, use <C-R>=func()<CR> instead of
  func()<CR>
- When it is still necessary to clear the command-line, use :<BS>

-- 
HTH,
Hari

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Reply via email to