-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Suraj N. Kurapati wrote:
>   Make column selection wrap around. So if I am at the right most
> column and I input "select the column at right", then wmii should
> select the left-most column. Same thing applies for the reverse
> case: selecting column to the left of left-most column will put
> focus on right-most column.

Attached is a patch which implements the above feature. I was a
surprised to find that negative integers don't wrap around in C as
they do in Ruby:

C:
 -4 % 4 => 0
 -3 % 4 => -3
 -2 % 4 => -2
 -1 % 4 => -1
  0 % 4 => 0
  1 % 4 => 1
  2 % 4 => 2
  3 % 4 => 3
  4 % 4 => 0


Ruby:
 -4 % 4 => 0
 -3 % 4 => 1
 -2 % 4 => 2
 -1 % 4 => 3
  0 % 4 => 0
  1 % 4 => 1
  2 % 4 => 2
  3 % 4 => 3
  4 % 4 => 0
- --
BASIC is to computer programming as QWERTY is to typing.
                -- Seymour Papert
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)

iD8DBQFEqwFGmV9O7RYnKMcRAmyoAJ9snqyBRsniL/AzP8NSWhKsAcJbvgCcC4IK
W20hYARnrGZ4mfMmkTAsKCc=
=+EQ5
-----END PGP SIGNATURE-----
diff -ur wmii-3.1/cmd/wm/area.c wmii-3.1-new/cmd/wm/area.c
--- wmii-3.1/cmd/wm/area.c	2006-06-17 04:44:30.000000000 -0700
+++ wmii-3.1-new/cmd/wm/area.c	2006-07-04 16:31:15.000000000 -0700
@@ -113,14 +113,11 @@
 			i = 1;
 	} else if(!strncmp(arg, "prev", 5)) {
 		if(i <= 1)
-			return;
+			i = v->area.size - 1;
 		else
 			i--;
 	} else if(!strncmp(arg, "next", 5)) {
-		if(i > 0 && (i + 1 < v->area.size))
-			i++;
-		else
-			return;
+		i = (i % (v->area.size - 1)) + 1;
 	}
 	else {
 		const char *errstr;

_______________________________________________
[email protected] mailing list
http://wmii.de/cgi-bin/mailman/listinfo/wmii

Reply via email to