diff options
author | explosion-mental <explosion-mental@noreply.codeberg.org> | 2022-08-16 10:54:31 +0200 |
---|---|---|
committer | NRK <nrk@disroot.org> | 2022-08-16 10:54:31 +0200 |
commit | 0f0c49a630285af10c765e0b724896ff281e7b66 (patch) | |
tree | 96ba66a1ff64cd89c2fd75f8f0d736aa34fc3c56 /thumbs.c | |
parent | 6578e6eb6533a6651bd88ecae7720aced88c8c2f (diff) | |
download | nsxiv-0f0c49a630285af10c765e0b724896ff281e7b66.tar.zst |
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>
Diffstat (limited to 'thumbs.c')
-rw-r--r-- | thumbs.c | 28 |
1 files changed, 14 insertions, 14 deletions
@@ -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) { |