diff --git a/libs/arg.c b/libs/arg.c index 97dc254..46532c5 100644 --- a/libs/arg.c +++ b/libs/arg.c @@ -102,7 +102,6 @@ void movenext(Arg *arg) { return; sel = curr = next; - calcoffsets(); drawmenu(); } @@ -115,6 +114,17 @@ void moveprev(Arg *arg) { drawmenu(); } +void moveitem(Arg *arg) { + for (int i = 0; i < arg->i; i++) { + if (sel && sel->right && (sel = sel->right) == next) { + curr = next; + calcoffsets(); + } + } + + drawmenu(); +} + void movestart(Arg *arg) { if (sel == matches) { cursor = 0; diff --git a/libs/arg.h b/libs/arg.h index e6ab450..0848870 100644 --- a/libs/arg.h +++ b/libs/arg.h @@ -16,6 +16,7 @@ static void moveend(Arg *arg); static void movestart(Arg *arg); static void movenext(Arg *arg); static void moveprev(Arg *arg); +static void moveitem(Arg *arg); static void paste(Arg *arg); static void restoresel(Arg *arg); static void clear(Arg *arg); diff --git a/libs/conf/config.h b/libs/conf/config.h index c511042..3f19cb6 100644 --- a/libs/conf/config.h +++ b/libs/conf/config.h @@ -335,8 +335,9 @@ static FuncList fl[] = { { "moveright", moveright }, { "moveend", moveend }, { "movestart", movestart }, - { "move", movenext }, - { "move", moveprev }, + { "movenext", movenext }, + { "moveprev", moveprev }, + { "moveitem", moveitem }, { "paste", paste }, { "pastesel", paste }, { "restoresel", restoresel }, diff --git a/libs/match.c b/libs/match.c index 292b04a..9ad6d19 100644 --- a/libs/match.c +++ b/libs/match.c @@ -157,7 +157,6 @@ void match(void) { for (i = 0; i < preselected; i++) { if (sel && sel->right && (sel = sel->right) == next) { curr = next; - calcoffsets(); } }