Re: clearing the command line

2006-05-18 Thread Yakov Lerner

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


Re: clearing the command line

2006-05-18 Thread Eric Arnold

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.


RE: clearing the command line

2006-05-18 Thread Zdenek Sekera
 -Original Message-
 From: Eric Arnold [mailto:[EMAIL PROTECTED] 
 Sent: 18 May 2006 15:09
 To: vim.org user list
 Subject: clearing the command line
 
 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.
 

Not sure if it helps, but try this:

:map ,x :let a=10CR
and execute it by  ',x' (no apostrophies)

and then see for comparison this:
:map ,x :let a=10CR/BS
execute and see the difference.

Is it something you were looking for?

---Zdenek


Re: clearing the command line

2006-05-18 Thread Hari Krishna Dara

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