changeset: 1950:e76a0d559efe
tag: tip
user: Kris Maglione <jg_AT_suckless.org>
date: Sun Feb 25 00:07:59 2007 -0500
summary: Fix selection of areas by index.
diff -r c476fac1fa53 -r e76a0d559efe area.c
--- a/area.c Sat Feb 24 23:36:16 2007 -0500
+++ b/area.c Sun Feb 25 00:07:59 2007 -0500
@@ -412,11 +412,13 @@ select_area(Area *a, char *arg) {
p = f->anext ? f->anext : a->frame;
goto focus_frame;
}
- else {
- if(sscanf(arg, "%d", &i) != 1)
- return Ebadvalue;
- for(new=view->area; new->next; new=new->next)
- if(!--i) break;;
+ else if(!strncmp(arg, "~", 2)) {
+ new = v->area;
+ }else {
+ if(sscanf(arg, "%u", &i) != 1 || i == 0)
+ return Ebadvalue;
+ for(new=view->area->next; new->next && i; new=new->next)
+ if(!--i) break;
}
focus_area(new);
return nil;
Received on Sun Feb 25 2007 - 06:10:47 UTC
This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:55:54 UTC