code-style: don't indent switch cases (#358)
The suckless coding style [^0] and the linux coding style [^1] both recommends not indenting switch cases. And it helps out people with lower resolution monitors. [^0]: https://suckless.org/coding_style/ [^1]: https://www.kernel.org/doc/html/v5.10/process/coding-style.html#indentation Co-authored-by: explosion-mental <explosion0mental@gmail.com> Reviewed-on: https://codeberg.org/nsxiv/nsxiv/pulls/358 Reviewed-by: NRK <nrk@disroot.org> Co-authored-by: explosion-mental <explosion-mental@noreply.codeberg.org> Co-committed-by: explosion-mental <explosion-mental@noreply.codeberg.org>
This commit is contained in:
28
thumbs.c
28
thumbs.c
@ -505,20 +505,20 @@ bool tns_move_selection(tns_t *tns, direction_t dir, int cnt)
|
||||
cnt = cnt > 1 ? cnt : 1;
|
||||
|
||||
switch (dir) {
|
||||
case DIR_UP:
|
||||
*tns->sel = MAX(*tns->sel - cnt * tns->cols, *tns->sel % tns->cols);
|
||||
break;
|
||||
case DIR_DOWN:
|
||||
max = tns->cols * ((*tns->cnt - 1) / tns->cols) +
|
||||
MIN((*tns->cnt - 1) % tns->cols, *tns->sel % tns->cols);
|
||||
*tns->sel = MIN(*tns->sel + cnt * tns->cols, max);
|
||||
break;
|
||||
case DIR_LEFT:
|
||||
*tns->sel = MAX(*tns->sel - cnt, 0);
|
||||
break;
|
||||
case DIR_RIGHT:
|
||||
*tns->sel = MIN(*tns->sel + cnt, *tns->cnt - 1);
|
||||
break;
|
||||
case DIR_UP:
|
||||
*tns->sel = MAX(*tns->sel - cnt * tns->cols, *tns->sel % tns->cols);
|
||||
break;
|
||||
case DIR_DOWN:
|
||||
max = tns->cols * ((*tns->cnt - 1) / tns->cols) +
|
||||
MIN((*tns->cnt - 1) % tns->cols, *tns->sel % tns->cols);
|
||||
*tns->sel = MIN(*tns->sel + cnt * tns->cols, max);
|
||||
break;
|
||||
case DIR_LEFT:
|
||||
*tns->sel = MAX(*tns->sel - cnt, 0);
|
||||
break;
|
||||
case DIR_RIGHT:
|
||||
*tns->sel = MIN(*tns->sel + cnt, *tns->cnt - 1);
|
||||
break;
|
||||
}
|
||||
|
||||
if (*tns->sel != old) {
|
||||
|
Reference in New Issue
Block a user