From 0f0c49a630285af10c765e0b724896ff281e7b66 Mon Sep 17 00:00:00 2001 From: explosion-mental Date: Tue, 16 Aug 2022 10:54:31 +0200 Subject: 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 Reviewed-on: https://codeberg.org/nsxiv/nsxiv/pulls/358 Reviewed-by: NRK Co-authored-by: explosion-mental Co-committed-by: explosion-mental --- thumbs.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'thumbs.c') diff --git a/thumbs.c b/thumbs.c index a0b1063..40a3d93 100644 --- a/thumbs.c +++ b/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) { -- cgit v1.2.3-54-g00ecf