From f22ee7c9ac27fe05649219535a05c21281709607 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Fri, 30 Oct 2020 14:43:35 +0200 Subject: Cleanup --- src/ui/documentwidget.c | 12 ------------ src/ui/keys.c | 5 ++--- 2 files changed, 2 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c index a2bea17b..11568c70 100644 --- a/src/ui/documentwidget.c +++ b/src/ui/documentwidget.c @@ -1569,18 +1569,6 @@ static iBool handleCommand_DocumentWidget_(iDocumentWidget *d, const char *cmd) smoothDuration_DocumentWidget_); return iTrue; } -#if 0 - case SDLK_PAGEUP: - case SDLK_PAGEDOWN: - case SDLK_SPACE: - postCommand_Widget( - w, - "scroll.page arg:%d repeat:%d", - (key == SDLK_SPACE && mods & KMOD_SHIFT) || key == SDLK_PAGEUP ? -1 : +1, - ev->key.repeat != 0); - return iTrue; - } -#endif else if (equal_Command(cmd, "document.goto") && document_App() == d) { const iRangecc heading = range_Command(cmd, "heading"); if (heading.start) { diff --git a/src/ui/keys.c b/src/ui/keys.c index d46d20bf..4d52b0a4 100644 --- a/src/ui/keys.c +++ b/src/ui/keys.c @@ -65,15 +65,14 @@ static void bindDefaults_(void) { bind_Keys("scroll.step arg:-1", SDLK_UP, 0); bind_Keys("scroll.step arg:1", SDLK_DOWN, 0); bind_Keys("scroll.page arg:-1", SDLK_PAGEUP, 0); - bind_Keys("scroll.page arg:-1", SDLK_SPACE, KMOD_SHIFT); bind_Keys("scroll.page arg:1", SDLK_PAGEDOWN, 0); + bind_Keys("scroll.page arg:-1", SDLK_SPACE, KMOD_SHIFT); bind_Keys("scroll.page arg:1", SDLK_SPACE, 0); } static iBinding *find_Keys_(iKeys *d, int key, int mods) { - const iBinding bind = { .key = key, .mods = mods }; size_t pos; - if (locate_SortedArray(&d->bindings, &bind, &pos)) { + if (locate_SortedArray(&d->bindings, &(iBinding){ .key = key, .mods = mods }, &pos)) { return at_SortedArray(&d->bindings, pos); } return NULL; -- cgit v1.2.3