summaryrefslogtreecommitdiffstats
path: root/commands.c
diff options
context:
space:
mode:
authorNick Hanley <nicholasjhanley@gmail.com>2022-01-15 23:51:31 +0100
committerGitHub <noreply@github.com>2022-01-15 23:51:31 +0100
commit2ac44709bd9a9ec8d3ab60a40a81ac7ca3ad1b57 (patch)
tree73221bb787569c4089930436ddc644490ccb2c18 /commands.c
parent7a75c42b37b08f44c72f9a7c98eb6076967470fb (diff)
downloadnsxiv-2ac44709bd9a9ec8d3ab60a40a81ac7ca3ad1b57.tar.zst
Add keybind to scroll to image center (#203)
There are keybinds for scrolling to the edges of an image but there's no way back to the center. This is particularly annoying while zooming.
Diffstat (limited to 'commands.c')
-rw-r--r--commands.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/commands.c b/commands.c
index aafc510..7b7be62 100644
--- a/commands.c
+++ b/commands.c
@@ -325,6 +325,11 @@ bool ci_scroll(arg_t dir)
return img_pan(&img, dir, prefix);
}
+bool ci_scroll_to_center(arg_t _)
+{
+ return img_pan_center(&img);
+}
+
bool ci_scroll_to_edge(arg_t dir)
{
return img_pan_edge(&img, dir);