From: Anselm R. Garbe Date: Tue, 5 Sep 2006 07:37:45 +0000 (+0200) Subject: sanders toggletag patch is much more elegant X-Git-Url: https://git.danieliu.xyz/?a=commitdiff_plain;ds=sidebyside;h=eac04882b40595d724f4578b5acec5f22df570e3;p=dwm.git sanders toggletag patch is much more elegant --- diff --git a/tag.c b/tag.c index 5337d25..9e997f9 100644 --- a/tag.c +++ b/tag.c @@ -136,6 +136,6 @@ toggletag(Arg *arg) for(i = 0; i < ntags && !sel->tags[i]; i++); if(i == ntags) sel->tags[arg->i] = True; - for(sel->weight = 0; sel->weight < ntags && !sel->tags[sel->weight]; sel->weight++); + sel->weight = (i == ntags) ? arg->i : i; arrange(NULL); }