code cleanup, add moveitem function
This commit is contained in:
parent
06fe388033
commit
0258974bf0
12
libs/arg.c
12
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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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 },
|
||||
|
|
|
@ -157,7 +157,6 @@ void match(void) {
|
|||
for (i = 0; i < preselected; i++) {
|
||||
if (sel && sel->right && (sel = sel->right) == next) {
|
||||
curr = next;
|
||||
calcoffsets();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue