[Commit] jove Makefile, 1.8, 1.9 c.c, 1.5, 1.6 disp.c, 1.4, 1.5 fp.c, 1.4, 1.5 jove.h, 1.7, 1.8 move.c, 1.3, 1.4 screen.c, 1.4, 1.5

Keith Packard commit at keithp.com
Wed Aug 11 21:29:59 PDT 2004


Committed by: keithp

Update of /local/src/CVS/jove
In directory home.keithp.com:/tmp/cvs-serv32733

Modified Files:
	Makefile c.c disp.c fp.c jove.h move.c screen.c 
Log Message:
local patches

Index: Makefile
===================================================================
RCS file: /local/src/CVS/jove/Makefile,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- Makefile	22 May 2003 20:22:09 -0000	1.8
+++ Makefile	12 Aug 2004 04:29:56 -0000	1.9
@@ -84,17 +84,18 @@
 	jove.o macros.o malloc.o marks.o misc.o move.o paragraph.o\
 	proc.o re.o re1.o rec.o scandir.o screen.o table.o term.o\
 	tune.o util.o vars.o version.o wind.o getservent.o getlav.o\
-	man.o daemon.o stdio.o
+	man.o daemon.o stdio.o wcwidth.o
 
 JOVESRC = funcdefs.c abbrev.c argcount.c ask.c buf.c c.c case.c ctype.c \
 	delete.c disp.c error.c extend.c fp.c fmt.c insert.c io.c \
 	jove.c macros.c malloc.c marks.c misc.c move.c paragraph.c \
 	proc.c re.c re1.c rec.c scandir.c screen.c table.c term.c util.c \
-	vars.c version.c getservent.c getlav.c wind.c man.c daemon.c stdio.c
+	vars.c version.c getservent.c getlav.c wind.c man.c daemon.c stdio.c \
+	wcwidth.c
 
 JOVEINC = iproc.c nproc.c iproc-ptys.c iproc-pipes.c
 
-HEADERS = ctype.h io.h jove.h re.h rec.h table.h temp.h termcap.h tune.h
+HEADERS = ctype.h io.h jove.h re.h rec.h table.h temp.h termcap.h tune.h wcwidth.h
 
 UTILSRC = teachjove.c recover.c setmaps.c portsrv.c jovedaemon.c
 

Index: c.c
===================================================================
RCS file: /local/src/CVS/jove/c.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- c.c	16 Aug 2003 00:25:41 -0000	1.5
+++ c.c	12 Aug 2004 04:29:56 -0000	1.6
@@ -426,6 +426,8 @@
 					curpos = calc_pos (linebuf, tempchar);
 				else if (isctrl (c))
 					curpos += step;
+				else if (mk_wcwidth (c) == 2)
+					curpos += step;
 			}
 			if (dir == BACKWARD || !COMPAREPOS) {
 				
@@ -473,7 +475,7 @@
 	Eol ();
 	while (cur_char () != ')')
 	{
-		if (bolp() <= 0)
+		if (bolp())
 			return NO;
 		left_char ();
 	}
@@ -612,6 +614,14 @@
 			indent = calc_pos (linebuf, curchar);
 			if (indent == 0)
 			    break;
+			if ((bp = in_comment ()) && bp->p_line != curline)
+			{
+			    SetDot (bp);
+			    ToIndent ();
+			    indent = calc_pos (linebuf, curchar);
+			    if (indent == 0)
+				break;
+			}
 		    }
 		}
 		else

Index: disp.c
===================================================================
RCS file: /local/src/CVS/jove/disp.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- disp.c	10 Jun 2003 17:32:07 -0000	1.4
+++ disp.c	12 Aug 2004 04:29:56 -0000	1.5
@@ -165,7 +165,7 @@
 		else if (isctrl(c))
 			pos += 2;
 		else
-			pos++;
+			pos += mk_wcwidth (c);
  	}
 	return pos;
 }
@@ -599,6 +599,9 @@
 		} else if (isctrl(c)) {
 			OkayOut('^');
 			OkayOut(c == 0177 ? '?' : c + '@');
+		} else if (mk_wcwidth (c) == 2) {
+			OkayOut (c);
+			OkayOut (DOUBLE_CHAR);
 		} else {
 			if (visspace && c == ' ')
 				c = '_';

Index: fp.c
===================================================================
RCS file: /local/src/CVS/jove/fp.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- fp.c	15 May 2003 00:01:06 -0000	1.4
+++ fp.c	12 Aug 2004 04:29:56 -0000	1.5
@@ -39,6 +39,8 @@
     char	d;
     int	bits;
 
+    if (c == DOUBLE_CHAR)
+	return;
     if (!Utf8Out)
     {
 	bits = -6;

Index: jove.h
===================================================================
RCS file: /local/src/CVS/jove/jove.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- jove.h	10 Jun 2003 17:32:07 -0000	1.7
+++ jove.h	12 Aug 2004 04:29:56 -0000	1.8
@@ -23,6 +23,7 @@
 #else
 #include <termcap.h>
 #endif
+#include "wcwidth.h"
 
 #define private	static
 
@@ -135,8 +136,6 @@
 #define CharUpcase(c)	(CaseEquiv(c))
 #define WinText(w)	(((w)->w_flags & W_NUMLINES ? 8 : 0) + ((w)->w_flags & W_HIGHCUR ? 1 : 0))
 
-typedef unsigned int	ucs4;
-
 ucs4 parse_ucs4 (char *buf);
 ucs4 next_ucs4 (char **bufp);
 char *unparse_ucs4 (ucs4 c, char *buf);
@@ -592,6 +591,7 @@
 typedef ucs4	    screenchar;
 #define INVERSE_BIT 0x80000000
 #define CHAR_MASK   0x7FFFFFFF
+#define DOUBLE_CHAR 0x0000FFFF
 
 struct screenline {
 	screenchar	*s_line,

Index: move.c
===================================================================
RCS file: /local/src/CVS/jove/move.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- move.c	10 Jun 2003 17:32:07 -0000	1.3
+++ move.c	12 Aug 2004 04:29:56 -0000	1.4
@@ -347,7 +347,7 @@
 		else if (isctrl(c))
 			pos += 2;
 		else
-			pos++;
+			pos += mk_wcwidth (c);
 		lp++;
 	}
 

Index: screen.c
===================================================================
RCS file: /local/src/CVS/jove/screen.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- screen.c	6 Dec 2003 20:15:29 -0000	1.4
+++ screen.c	12 Aug 2004 04:29:56 -0000	1.5
@@ -146,8 +146,12 @@
 
 /* Output one character (if necessary) at the current position */
 
+#include <assert.h>
+
 dosputc(screenchar c)
 {
+	if (c == DOUBLE_CHAR)
+		assert (mk_wcwidth (cursor[-1] & CHAR_MASK) == 2);
 	if (*cursor != c) {
 #ifdef ID_CHAR
 		if (IN_INSmode)
@@ -231,6 +235,12 @@
 			thebyte = (((c == '\177') ? '?' : c + '@') | or_byte);
 			soutputc(thebyte);
 			col += 2;
+		} else if (mk_wcwidth (c) == 2) {
+			thebyte = (c | or_byte);
+			soutputc (thebyte);
+			thebyte = (DOUBLE_CHAR | or_byte);
+			soutputc (thebyte);
+			col += 2;
 		} else {
 			thebyte = (c | or_byte);
 			soutputc(thebyte);
@@ -277,7 +287,7 @@
 		else if (isctrl(c))
 			col += 2;
 		else
-			col++;
+			col += mk_wcwidth (c);
 	}
 
 	OkayAbort = 0;
@@ -305,6 +315,10 @@
 			soutputc('^');
 			soutputc((c == '\177') ? '?' : c + '@');
 			col += 2;
+		} else if (mk_wcwidth (c) == 2) {
+			soutputc (c);
+			soutputc (DOUBLE_CHAR);
+			col += 2;
 		} else {
 			if (c == ' ' && visspace)
 				c = '_';




More information about the Commit mailing list