aewl

diff tag.c @ 262:d659a2dce2b5

implemented viewextend and added M-S-C-n shortcuts for extending the current view... updated man page (works great!) nice feature
author Anselm R.Garbe <arg@10ksloc.org>
date Fri, 11 Aug 2006 19:26:12 +0200
parents d6fd632d861c
children 118d3e010e5e
line diff
     1.1 --- a/tag.c	Fri Aug 11 18:37:41 2006 +0200
     1.2 +++ b/tag.c	Fri Aug 11 19:26:12 2006 +0200
     1.3 @@ -181,7 +181,7 @@
     1.4  	unsigned int i;
     1.5  
     1.6  	for(i = 0; i < ntags; i++)
     1.7 -		if(c->tags[i] && tsel[i])
     1.8 +		if(c->tags[i] && seltag[i])
     1.9  			return True;
    1.10  	return False;
    1.11  }
    1.12 @@ -229,7 +229,7 @@
    1.13  	}
    1.14  	if(!matched)
    1.15  		for(i = 0; i < ntags; i++)
    1.16 -			c->tags[i] = tsel[i];
    1.17 +			c->tags[i] = seltag[i];
    1.18  }
    1.19  
    1.20  void
    1.21 @@ -245,8 +245,21 @@
    1.22  	unsigned int i;
    1.23  
    1.24  	for(i = 0; i < ntags; i++)
    1.25 -		tsel[i] = False;
    1.26 -	tsel[arg->i] = True;
    1.27 +		seltag[i] = False;
    1.28 +	seltag[arg->i] = True;
    1.29 +	arrange(NULL);
    1.30 +	drawall();
    1.31 +}
    1.32 +
    1.33 +void
    1.34 +viewextend(Arg *arg)
    1.35 +{
    1.36 +	unsigned int i;
    1.37 +
    1.38 +	seltag[arg->i] = !seltag[arg->i];
    1.39 +	for(i = 0; !seltag[i] && i < ntags; i++);
    1.40 +	if(i == ntags)
    1.41 +		seltag[arg->i] = True; /* cannot toggle last view */
    1.42  	arrange(NULL);
    1.43  	drawall();
    1.44  }
    1.45 @@ -256,7 +269,7 @@
    1.46  {
    1.47  	unsigned int i;
    1.48  
    1.49 -	for(i = 0; !tsel[i]; i++);
    1.50 +	for(i = 0; !seltag[i]; i++);
    1.51  	arg->i = (i < ntags-1) ? i+1 : 0;
    1.52  	view(arg);
    1.53  }
    1.54 @@ -266,7 +279,7 @@
    1.55  {
    1.56  	unsigned int i;
    1.57  
    1.58 -	for(i = 0; !tsel[i]; i++);
    1.59 +	for(i = 0; !seltag[i]; i++);
    1.60  	arg->i = (i > 0) ? i-1 : ntags-1;
    1.61  	view(arg);
    1.62  }