X-Git-Url: https://git.xinqibao.xyz/dwm.git/blobdiff_plain/1b3903d6e989ec3933b9f855b73fece050e54155..838a1ff950eb42e4137cfd7039a0e78227b2ef70:/tag.c 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); }