Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: make curses module not need wideness



On Mon, Oct 15, 2007 at 10:11:52AM +0100, Peter Stephenson wrote:
> I'm also wondering if it wouldn't be better for the window number/name
> to be the first regular argument in all cases.

First:

Index: Doc/Zsh/mod_curses.yo
===================================================================
RCS file: /cvsroot/zsh/zsh/Doc/Zsh/mod_curses.yo,v
retrieving revision 1.2
diff -u -r1.2 mod_curses.yo
--- Doc/Zsh/mod_curses.yo	15 Oct 2007 13:30:08 -0000	1.2
+++ Doc/Zsh/mod_curses.yo	15 Oct 2007 13:33:53 -0000
@@ -6,7 +6,7 @@
 startitem()
 findex(zcurses)
 cindex(windows, curses)
-xitem(tt(zcurses) tt(-a) var(nlines) var(ncols) var(begin_y) var(begin_x) var(targetwin) )
+xitem(tt(zcurses) tt(-a) var(targetwin) var(nlines) var(ncols) var(begin_y) var(begin_x) )
 xitem(tt(zcurses) tt(-d) var(targetwin) )
 xitem(tt(zcurses) tt(-r) var(targetwin) )
 xitem(tt(zcurses) tt(-m) var(targetwin) var(new_y) var(new_x) )
Index: Src/Modules/curses.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Modules/curses.c,v
retrieving revision 1.5
diff -u -r1.5 curses.c
--- Src/Modules/curses.c	15 Oct 2007 13:30:10 -0000	1.5
+++ Src/Modules/curses.c	15 Oct 2007 13:33:53 -0000
@@ -105,14 +105,14 @@
     if (OPT_ISSET(ops,'a')) {
 	int nlines, ncols, begin_y, begin_x;
 
-	nlines = atoi(args[0]);
-	ncols = atoi(args[1]);
-	begin_y = atoi(args[2]);
-	begin_x = atoi(args[3]);
-	targetwin = zcurses_validate_window(args[4], ZCURSES_UNUSED);
+	targetwin = zcurses_validate_window(args[0], ZCURSES_UNUSED);
+	nlines = atoi(args[1]);
+	ncols = atoi(args[2]);
+	begin_y = atoi(args[3]);
+	begin_x = atoi(args[4]);
 
 	if (targetwin == -1) {
-	    zerrnam(nam, "%s: %s", zcurses_strerror(zc_errno), args[4], 0);
+	    zerrnam(nam, "%s: %s", zcurses_strerror(zc_errno), args[0], 0);
 	    return 1;
 	}
 



Messages sorted by: Reverse Date, Date, Thread, Author