Refactoring shift functions ref. #270

This commit is contained in:
bakkeby
2022-07-05 13:51:27 +02:00
parent 274602fa7a
commit 20692bea01
10 changed files with 59 additions and 143 deletions

View File

@ -1,19 +1,6 @@
void
shiftview(const Arg *arg)
{
Arg shifted;
#if SCRATCHPADS_PATCH && !RENAMED_SCRATCHPADS_PATCH
unsigned int seltagset = selmon->tagset[selmon->seltags] & ~SPTAGMASK;
#else
unsigned int seltagset = selmon->tagset[selmon->seltags];
#endif // SCRATCHPADS_PATCH
if (arg->i > 0) // left circular shift
shifted.ui = (seltagset << arg->i) | (seltagset >> (NUMTAGS - arg->i));
else // right circular shift
shifted.ui = (seltagset >> -arg->i) | (seltagset << (NUMTAGS + arg->i));
#if SCRATCHPADS_PATCH && !RENAMED_SCRATCHPADS_PATCH
shifted.ui &= ~SPTAGMASK;
#endif // SCRATCHPADS_PATCH
Arg shifted = shift(arg, 0);
view(&shifted);
}