X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=tag.c;h=9e997f9b214334a43ef86f39802e902fd495c516;hb=52a3ab10423a4133e38281e4e19769cd3c2ed931;hp=5337d254347685c78d52768a70325cb2488fc7ba;hpb=1b3903d6e989ec3933b9f855b73fece050e54155;p=dwm.git 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); }