diff options
-rw-r--r-- | commands.c | 10 | ||||
-rw-r--r-- | commands.h | 1 | ||||
-rw-r--r-- | config.def.h | 1 | ||||
-rw-r--r-- | main.c | 2 |
4 files changed, 14 insertions, 0 deletions
@@ -46,6 +46,7 @@ extern win_t win; extern fileinfo_t *files; extern int filecnt, fileidx; +extern int alternate; extern int prefix; @@ -155,6 +156,15 @@ bool i_navigate(arg_t a) { return false; } +bool i_alternate(arg_t a) { + if (mode == MODE_IMAGE) { + load_image(alternate); + return true; + } else { + return false; + } +} + bool it_first(arg_t a) { if (mode == MODE_IMAGE && fileidx != 0) { load_image(0); @@ -49,6 +49,7 @@ bool t_reload_all(arg_t); bool it_reload_image(arg_t); bool it_remove_image(arg_t); bool i_navigate(arg_t); +bool i_alternate(arg_t); bool it_first(arg_t); bool it_n_or_last(arg_t); bool i_navigate_frame(arg_t); diff --git a/config.def.h b/config.def.h index 49dac49..42e1774 100644 --- a/config.def.h +++ b/config.def.h @@ -73,6 +73,7 @@ static const keymap_t keys[] = { { false, XK_BackSpace, i_navigate, (arg_t) -1 }, { false, XK_bracketright, i_navigate, (arg_t) +10 }, { false, XK_bracketleft, i_navigate, (arg_t) -10 }, + { true, XK_6, i_alternate, (arg_t) None }, { false, XK_g, it_first, (arg_t) None }, { false, XK_G, it_n_or_last, (arg_t) None }, @@ -62,6 +62,7 @@ win_t win; fileinfo_t *files; int filecnt, fileidx; +int alternate; size_t filesize; int prefix; @@ -217,6 +218,7 @@ void load_image(int new) { } files[new].loaded = true; + alternate = fileidx; fileidx = new; if (stat(files[new].path, &fstats) == 0) filesize = fstats.st_size; |