b59f851fdc
It seemed like a good thing at first to combine all the movement stuff in a single function, however as soon as you want to move multiple lines at once it becomes very difficult to do that, especially if you aren't familiar with C. This commit splits it into 4 separate functions, where the argument (arg->i) is how many times we move. This means it is now possible to choose how many lines to move without even editing the function itself, just through keybinds. This also makes the "fastmove" keybindings redundant. Note that calcoffsets() and drawmenu() after that must be called AFTER the for loop added with this commit, otherwise you can see the selection moving from each line to the next which is rather ugly.
39 lines
1.2 KiB
C
39 lines
1.2 KiB
C
typedef union {
|
|
int i;
|
|
unsigned int ui;
|
|
float f;
|
|
const void *v;
|
|
} Arg;
|
|
|
|
// declare keybind functions
|
|
static void moveup(const Arg *arg);
|
|
static void movedown(const Arg *arg);
|
|
static void moveleft(const Arg *arg);
|
|
static void moveright(const Arg *arg);
|
|
static void moveend(const Arg *arg);
|
|
static void movestart(const Arg *arg);
|
|
static void movenext(const Arg *arg);
|
|
static void moveprev(const Arg *arg);
|
|
static void paste(const Arg *arg);
|
|
static void restoresel(const Arg *arg);
|
|
static void clear(const Arg *arg);
|
|
static void viewhist(const Arg *arg);
|
|
static void moveword(const Arg *arg);
|
|
static void deleteword(const Arg *arg);
|
|
static void movecursor(const Arg *arg);
|
|
static void navhistory(const Arg *arg);
|
|
static void backspace(const Arg *arg);
|
|
static void selectitem(const Arg *arg);
|
|
static void quit(const Arg *arg);
|
|
static void complete(const Arg *arg);
|
|
static void savehistory(char *input);
|
|
static void setimgsize(const Arg *arg);
|
|
static void toggleimg(const Arg *arg);
|
|
static void defaultimg(const Arg *arg);
|
|
static void rotateimg(const Arg *arg);
|
|
static void flipimg(const Arg *arg);
|
|
static void setimgpos(const Arg *arg);
|
|
static void setimggaps(const Arg *arg);
|
|
static void setlines(const Arg *arg);
|
|
static void setcolumns(const Arg *arg);
|