zsh-workers
 help / color / mirror / code / Atom feed
* Another completion cursor-placement glitch
@ 2001-06-13 10:09 Bart Schaefer
  2001-06-13 14:00 ` Sven Wischnowsky
  0 siblings, 1 reply; 2+ messages in thread
From: Bart Schaefer @ 2001-06-13 10:09 UTC (permalink / raw)
  To: zsh-workers

In a freshly-started shell with `prompt bart` in effect, I typed <C-x h> for
complete-help after the scp command and the cursor got left where the `+' is
in the cut'n'paste below (one line too high):

zagzig [fg] ~     +                                            01-06-13  3:01AM
schaefer[501] scp                                                         4.0.1
tags in context :completion::complete:scp::
    argument-rest options  (_arguments _ssh _ssh)
tags in context :completion::complete:scp:argument-rest:
    files hosts users  (_alternative _ssh _ssh) 
    all-files          (_files _alternative _ssh _ssh) 
    hosts              (_hosts _combination _ssh_hosts _alternative _ssh _ssh) 
    users              (_users _combination _ssh_users _alternative _ssh _ssh)

Yeah, I know, I should be in bed, then I wouldn't see these wierd bugs.  It
happens with `zsh -f' plus compinit, so it's not the prompt causing it.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Another completion cursor-placement glitch
  2001-06-13 10:09 Another completion cursor-placement glitch Bart Schaefer
@ 2001-06-13 14:00 ` Sven Wischnowsky
  0 siblings, 0 replies; 2+ messages in thread
From: Sven Wischnowsky @ 2001-06-13 14:00 UTC (permalink / raw)
  To: zsh-workers

Bart Schaefer wrote:

> In a freshly-started shell with `prompt bart` in effect, I typed <C-x h> for
> complete-help after the scp command and the cursor got left where the `+' is
> in the cut'n'paste below (one line too high):
> 
> zagzig [fg] ~     +                                            01-06-13  3:01AM
> schaefer[501] scp                                                         4.0.1
> tags in context :completion::complete:scp::
>     argument-rest options  (_arguments _ssh _ssh)
> tags in context :completion::complete:scp:argument-rest:
>     files hosts users  (_alternative _ssh _ssh) 
>     all-files          (_files _alternative _ssh _ssh) 
>     hosts              (_hosts _combination _ssh_hosts _alternative _ssh _ssh) 
>     users              (_users _combination _ssh_users _alternative _ssh _ssh)
> 
> Yeah, I know, I should be in bed, then I wouldn't see these wierd bugs.  It
> happens with `zsh -f' plus compinit, so it's not the prompt causing it.

;-)

One half was a off-by-one error.  The printing functions for the
explanation strings included newlines in their calculations of the
lengths of lines printed so far.  The other part was that these
functions didn't do that space-backspace thing at the end if the last
line in the listing happened to be as long as the screen is wide.

Another candidate for 4.0.


Bye
  Sven

Index: Src/Zle/complist.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/complist.c,v
retrieving revision 1.41
diff -u -r1.41 complist.c
--- Src/Zle/complist.c	2001/05/08 08:14:34	1.41
+++ Src/Zle/complist.c	2001/06/13 13:58:30
@@ -887,7 +887,7 @@
 	    if (*p == '\n') {
 		if (dopr == 1 && mlbeg >= 0 && tccan(TCCLEAREOL))
 		    tcout(TCCLEAREOL);
-		l += 1 + (cc / columns);
+		l += 1 + ((cc - 1) / columns);
 		cc = 0;
 	    }
 	    if (dopr == 1) {
@@ -909,9 +909,12 @@
 	    }
 	}
     }
-    if (dopr && mlbeg >= 0 && tccan(TCCLEAREOL))
-	tcout(TCCLEAREOL);
-
+    if (dopr) {
+        if (!(cc % columns))
+            fputs(" \010", shout);
+        if (mlbeg >= 0 && tccan(TCCLEAREOL))
+            tcout(TCCLEAREOL);
+    }
     if (stat && n)
 	mfirstl = -1;
 
Index: Src/Zle/zle_tricky.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_tricky.c,v
retrieving revision 1.27
diff -u -r1.27 zle_tricky.c
--- Src/Zle/zle_tricky.c	2001/05/16 10:27:07	1.27
+++ Src/Zle/zle_tricky.c	2001/06/13 13:58:31
@@ -1949,7 +1949,7 @@
 			    putc(' ', shout);
 		    }
 		}
-		l += 1 + (cc / columns);
+		l += 1 + ((cc - 1) / columns);
 		cc = 0;
 	    }
 	    if (dopr) {
@@ -1960,6 +1960,8 @@
 	}
     }
     if (dopr) {
+        if (!(cc % columns))
+            fputs(" \010", shout);
 	if (tccan(TCCLEAREOL))
 	    tcout(TCCLEAREOL);
 	else {

-- 
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-06-13 14:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-13 10:09 Another completion cursor-placement glitch Bart Schaefer
2001-06-13 14:00 ` Sven Wischnowsky

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).