From 56e1ee9a136a6f6f64e13430b5f0acfcecca1ada Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Sun, 25 Feb 2007 00:07:59 -0500 Subject: [PATCH] Fix selection of areas by index. --- area.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/area.c b/area.c index d1b20ee0..f8fa27f7 100644 --- a/area.c +++ b/area.c @@ -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) + else if(!strncmp(arg, "~", 2)) { + new = v->area; + }else { + if(sscanf(arg, "%u", &i) != 1 || i == 0) return Ebadvalue; - for(new=view->area; new->next; new=new->next) - if(!--i) break;; + for(new=view->area->next; new->next && i; new=new->next) + if(!--i) break; } focus_area(new); return nil;