added blackmagic (funcptr/string modifiers on actions)
This commit is contained in:
@ -41,6 +41,8 @@ extern char *terminal_width_empty_line;
|
||||
int read_string(WINDOW *win, int y, int x, char *str);
|
||||
int strcmp_offset(char *in0, char *in1, char offset);
|
||||
extern void render_pass();
|
||||
extern int (*order_func)();
|
||||
|
||||
|
||||
|
||||
void user_interactions() {
|
||||
@ -74,7 +76,7 @@ void user_interactions() {
|
||||
|
||||
|
||||
|
||||
void (*func_ptr)(int);
|
||||
void (*func_ptr)(int, int);
|
||||
int number_length = 0;
|
||||
if (!binding_pass) {
|
||||
parsed_input_number = 0;
|
||||
@ -95,7 +97,7 @@ void user_interactions() {
|
||||
if (strcmp(input + number_length, key_binding[i].key) == 0) {
|
||||
|
||||
func_ptr = key_binding[i].func;
|
||||
func_ptr(parsed_input_number);
|
||||
func_ptr(parsed_input_number, i);
|
||||
|
||||
memset(input, 0, 255);
|
||||
input_pass = 0;
|
||||
@ -464,3 +466,17 @@ void not_implemented(){
|
||||
mvaddstr(terminal_height-1, strlen(input), "\t");
|
||||
mvaddstr(terminal_height-1, strlen(input) + strlen("\t"), "is not yet implemented");
|
||||
}
|
||||
void jump_to_dir(int passes, int index){
|
||||
if (strcmp((char*)key_binding[index].black_magic, "~/") || strcmp((char*)key_binding[index].black_magic, "$HOME")) {
|
||||
chdir(getenv("HOME"));
|
||||
}
|
||||
/* for some reason putting this in a else does not work */
|
||||
chdir((char*)key_binding[index].black_magic);
|
||||
|
||||
status |= (STATUS_RUN_BACKEND | STATUS_UPDATE_SCREEN_MASK | STATUS_RELOAD_DIRECTORY | STATUS_UPDATE_SCREEN_RELOAD_FULL);
|
||||
}
|
||||
void order_by(int passes, int index){
|
||||
|
||||
order_func = key_binding[index].black_magic;
|
||||
status |= (STATUS_RUN_BACKEND | STATUS_UPDATE_SCREEN_MASK | STATUS_RELOAD_DIRECTORY);
|
||||
}
|
||||
|
Reference in New Issue
Block a user