zsh-workers
 help / color / mirror / code / Atom feed
From: Tatsuo Furukawa <frkwtto@osk3.3web.ne.jp>
To: mason@primenet.com.au, schaefer@brasslantern.com
Cc: zsh-workers@sunsite.auc.dk
Subject: Re: Patch available for 3.0.6-pre-0
Date: Tue, 27 Apr 1999 00:22:47 +0900	[thread overview]
Message-ID: <199904262252.HAA00691@pop1.ngy.3web.ne.jp> (raw)
In-Reply-To: <slrn7i5f7d.5bm.mason@coral.primenet.com.au>


Hi, Bart & Geoff.

Bart> In particular, emitting the ch capability may require up to six
Bart> or seven bytes, where a relative horizontal or vertical move
Bart> might require fewer (depending on distance).

I didn't know that...

Geoff> This is a replacement for the zle_refresh.c patch (not the
Geoff> globals.h or zsh.h patch parts) moving a couple of things
Geoff> around and moving comments back to their appropriate spot.
Geoff> I've compiled it but haven't tested it a lot yet.

Geoff> Comments welcome.

I tested on hpterm, and (of course!) it worked well.  No problem!

So, I hope that Geoff's patch will be applied new zsh.


Geoff> It's against virgin 3.0.5 sources.

Now, the newest is 3.0.6-pre-1.  So, I made Geoff's patch againt
3.0.6-pre-1 version.  I hope that it will help reducing maintainer's
work.



diff -ur zsh-3.0.6-pre1-orig/Src/globals.h zsh-3.0.6-pre1-new/Src/globals.h
--- zsh-3.0.6-pre1-orig/Src/globals.h	Wed Apr 21 18:53:47 1999
+++ zsh-3.0.6-pre1-new/Src/globals.h	Mon Apr 26 20:33:08 1999
@@ -614,7 +614,7 @@
 {
     "cl", "le", "LE", "nd", "RI", "up", "UP", "do",
     "DO", "dc", "DC", "ic", "IC", "cd", "ce", "al", "dl", "ta",
-    "md", "so", "us", "me", "se", "ue"
+    "md", "so", "us", "me", "se", "ue", "ch"
 };
 #else
 extern char *tccapnams[TC_COUNT];
diff -ur zsh-3.0.6-pre1-orig/Src/zle_refresh.c zsh-3.0.6-pre1-new/Src/zle_refresh.c
--- zsh-3.0.6-pre1-orig/Src/zle_refresh.c	Mon Apr 26 20:21:08 1999
+++ zsh-3.0.6-pre1-new/Src/zle_refresh.c	Mon Apr 26 20:31:26 1999
@@ -810,20 +810,8 @@
 	}
     }
 
-    if (cl == vcs)
-	return;
-
-/* choose cheapest movements for ttys without multiple movement capabilities -
-   do this now because it's easier (to code) */
-    if (cl <= vcs / 2) {
-	zputc('\r', shout);
-	vcs = 0;
-    }
-    if (vcs < cl)
-	tc_rightcurs(cl);
-    else if (vcs > cl)
-	tc_leftcurs(vcs - cl);
-    vcs = cl;
+    if (cl != vcs)
+       singmoveto(cl);
 }
 
 /**/
@@ -841,16 +829,17 @@
     return 0;
 }
 
+/* ct: number of characters to move across */
 /**/
 void
-tc_rightcurs(int cl)
+tc_rightcurs(int ct)
 {
-    int ct,			/* number of characters to move across	    */
+    int cl,			/* ``desired'' absolute horizontal position */
 	i = vcs,		/* cursor position after initial movements  */
 	j;
     char *t;
 
-    ct = cl - vcs;
+    cl = ct + vcs;
 
 /* do a multright if we can - it's the most reliable */
     if (tccan(TCMULTRIGHT)) {
@@ -858,6 +847,13 @@
 	return;
     }
 
+/* do an absolute horizontal position if we can */
+    if (tccan(TCHORIZPOS)) {
+	tcoutarg(TCHORIZPOS, cl);
+	return;
+    }
+
+/* XXX: should really check "it" in termcap and use / and % */
 /* try tabs if tabs are non destructive and multright is not possible */
     if (!oxtabs && tccan(TCNEXTTAB) && ((vcs | 7) < cl)) {
 	i = (vcs | 7) + 1;
@@ -1062,23 +1058,21 @@
 {
     if (pos == vcs)
 	return;
-    if (pos <= vcs / 2) {
+
+/* choose cheapest movements for ttys without multiple movement capabilities -
+   do this now because it's easier (to code) */
+
+    if ((!tccan(TCMULTLEFT) || pos == 0) && (pos <= vcs / 2)) {
 	zputc('\r', shout);
 	vcs = 0;
     }
-    if (pos < vcs) {
+
+    if (pos < vcs)
 	tc_leftcurs(vcs - pos);
-	vcs = pos;
-    }
-    if (pos > vcs) {
-	if (tcmultout(TCRIGHT, TCMULTRIGHT, pos - vcs))
-	    vcs = pos;
-	else
-	    while (pos > vcs) {
-		zputc(nbuf[0][vcs], shout);
-		vcs++;
-	    }
-    }
+    else if (pos > vcs)
+	tc_rightcurs(pos - vcs);
+
+    vcs = pos;
 }
 
 /* generate left and right prompts */
diff -ur zsh-3.0.6-pre1-orig/Src/zsh.h zsh-3.0.6-pre1-new/Src/zsh.h
--- zsh-3.0.6-pre1-orig/Src/zsh.h	Wed Apr 21 18:53:49 1999
+++ zsh-3.0.6-pre1-new/Src/zsh.h	Mon Apr 26 20:33:54 1999
@@ -1249,7 +1249,8 @@
 #define TCALLATTRSOFF  21
 #define TCSTANDOUTEND  22
 #define TCUNDERLINEEND 23
-#define TC_COUNT       24
+#define TCHORIZPOS     24
+#define TC_COUNT       25
 
 #define tccan(X) (tclen[X])

-- 
Tatsuo Furukawa (frkwtto@osk3.3web.ne.jp)


  reply	other threads:[~1999-04-26 22:52 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-04-21  8:15 Bart Schaefer
1999-04-21  8:47 ` Peter Stephenson
1999-04-21 14:14 ` Tatsuo Furukawa
1999-04-21 16:05   ` Bart Schaefer
1999-04-22 15:07     ` Tatsuo Furukawa
1999-04-24  5:53       ` Bart Schaefer
1999-04-25  6:57         ` Geoff Wing
1999-04-26 15:22           ` Tatsuo Furukawa [this message]
1999-04-27 16:24             ` Bart Schaefer
1999-04-21 23:52 ` Wayne Davison
1999-04-24  4:32   ` Bart Schaefer
1999-04-24  7:12     ` Wayne Davison
1999-04-23 12:48 Sven Wischnowsky
1999-04-23 14:13 Sven Wischnowsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199904262252.HAA00691@pop1.ngy.3web.ne.jp \
    --to=frkwtto@osk3.3web.ne.jp \
    --cc=mason@primenet.com.au \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).