diff options
author | NRK <nrk@disroot.org> | 2023-09-30 10:53:32 +0200 |
---|---|---|
committer | NRK <nrk@disroot.org> | 2023-09-30 10:53:32 +0200 |
commit | 3659361e76c5c994bee3467787c00e89780cccbc (patch) | |
tree | 1994aa7ab2672029f91b5c859f92f026d73070e2 /commands.c | |
parent | 80a71315de2bec9924f2e06a825d4400f2b5a4f8 (diff) | |
download | nsxiv-3659361e76c5c994bee3467787c00e89780cccbc.tar.zst |
centralize script handling logic (#477)
currently the logic of when to open/close script is scattered around the
entire code-base which is both ugly and error-prone.
this patch centralizes script handling by remembering the relevant
information on each redraw and then comparing it with the previous
information to figure out whether something changed or not.
this also fixes a bug where scripts weren't being called in thumbnail
mode when mouse was used for selecting a different image.
Closes: https://codeberg.org/nsxiv/nsxiv/issues/475
Reviewed-on: https://codeberg.org/nsxiv/nsxiv/pulls/477
Reviewed-by: eylles <eylles@noreply.codeberg.org>
Diffstat (limited to 'commands.c')
-rw-r--r-- | commands.c | 10 |
1 files changed, 1 insertions, 9 deletions
@@ -83,9 +83,6 @@ bool cg_switch_mode(arg_t _) load_image(fileidx); mode = MODE_IMAGE; } - close_info(); - open_info(); - title_dirty = true; return true; } @@ -415,12 +412,7 @@ bool ci_slideshow(arg_t _) bool ct_move_sel(arg_t dir) { - bool dirty = tns_move_selection(&tns, dir, prefix); - if (dirty) { - close_info(); - open_info(); - } - return dirty; + return tns_move_selection(&tns, dir, prefix); } bool ct_reload_all(arg_t _) |