| File src/menus/filetypes_menu.c changed (mode: 100644) (index 9e98bdf5c..ff286b394) |
| ... |
... |
form_filetype_data_entry(assoc_record_t prog) |
| 158 |
158 |
static int |
static int |
| 159 |
159 |
execute_filetype_cb(view_t *view, menu_data_t *m) |
execute_filetype_cb(view_t *view, menu_data_t *m) |
| 160 |
160 |
{ |
{ |
| 161 |
|
if(get_current_entry(view)->type == FT_DIR && m->pos == 0) |
|
|
161 |
|
const char *const prog_str = strchr(m->data[m->pos], '|') + 1; |
|
162 |
|
if(prog_str[0] != '\0') |
| 162 |
163 |
{ |
{ |
| 163 |
|
rn_enter(view); |
|
| 164 |
|
} |
|
| 165 |
|
else |
|
| 166 |
|
{ |
|
| 167 |
|
const char *const prog_str = strchr(m->data[m->pos], '|') + 1; |
|
| 168 |
|
if(prog_str[0] != '\0') |
|
| 169 |
|
{ |
|
| 170 |
|
int background = m->extra_data & 1; |
|
| 171 |
|
rn_open_with(view, prog_str, 0, background); |
|
| 172 |
|
} |
|
|
164 |
|
int background = m->extra_data & 1; |
|
165 |
|
rn_open_with(view, prog_str, 0, background); |
| 173 |
166 |
} |
} |
| 174 |
167 |
|
|
| 175 |
168 |
flist_sel_stash(view); |
flist_sel_stash(view); |
| File src/running.c changed (mode: 100644) (index b14236eb9..24cb55fcd) |
| ... |
... |
static void run_implicit_prog(view_t *view, const char prog_spec[], int pause, |
| 105 |
105 |
int force_bg); |
int force_bg); |
| 106 |
106 |
static void view_current_file(const view_t *view); |
static void view_current_file(const view_t *view); |
| 107 |
107 |
static void follow_link(view_t *view, int follow_dirs); |
static void follow_link(view_t *view, int follow_dirs); |
|
108 |
|
static void enter_dir(struct view_t *view); |
| 108 |
109 |
static int cd_to_parent_dir(view_t *view); |
static int cd_to_parent_dir(view_t *view); |
| 109 |
110 |
static void extract_last_path_component(const char path[], char buf[]); |
static void extract_last_path_component(const char path[], char buf[]); |
| 110 |
111 |
static void setup_shellout_env(void); |
static void setup_shellout_env(void); |
| |
| ... |
... |
handle_file(view_t *view, FileHandleExec exec, FileHandleLink follow) |
| 177 |
178 |
{ |
{ |
| 178 |
179 |
if(!curr->selected && (curr->type != FT_LINK || follow == FHL_NO_FOLLOW)) |
if(!curr->selected && (curr->type != FT_LINK || follow == FHL_NO_FOLLOW)) |
| 179 |
180 |
{ |
{ |
| 180 |
|
rn_enter(view); |
|
|
181 |
|
enter_dir(view); |
| 181 |
182 |
return; |
return; |
| 182 |
183 |
} |
} |
| 183 |
184 |
} |
} |
| |
| ... |
... |
run_with_defaults(view_t *view) |
| 455 |
456 |
{ |
{ |
| 456 |
457 |
if(get_current_entry(view)->type == FT_DIR) |
if(get_current_entry(view)->type == FT_DIR) |
| 457 |
458 |
{ |
{ |
| 458 |
|
rn_enter(view); |
|
|
459 |
|
enter_dir(view); |
| 459 |
460 |
} |
} |
| 460 |
461 |
else if(view->selected_files <= 1) |
else if(view->selected_files <= 1) |
| 461 |
462 |
{ |
{ |
| |
| ... |
... |
rn_open_with(view_t *view, const char prog_spec[], int dont_execute, |
| 541 |
542 |
} |
} |
| 542 |
543 |
else if(strcmp(prog_spec, VIFM_PSEUDO_CMD) == 0) |
else if(strcmp(prog_spec, VIFM_PSEUDO_CMD) == 0) |
| 543 |
544 |
{ |
{ |
| 544 |
|
rn_enter(view); |
|
|
545 |
|
enter_dir(view); |
| 545 |
546 |
} |
} |
| 546 |
547 |
else if(strchr(prog_spec, '%') != NULL) |
else if(strchr(prog_spec, '%') != NULL) |
| 547 |
548 |
{ |
{ |
| |
| ... |
... |
follow_link(view_t *view, int follow_dirs) |
| 705 |
706 |
free(dir); |
free(dir); |
| 706 |
707 |
} |
} |
| 707 |
708 |
|
|
| 708 |
|
void |
|
| 709 |
|
rn_enter(view_t *view) |
|
|
709 |
|
/* Handles opening of current entry of the view as a directory. */ |
|
710 |
|
static void |
|
711 |
|
enter_dir(view_t *view) |
| 710 |
712 |
{ |
{ |
| 711 |
713 |
char full_path[PATH_MAX + 1]; |
char full_path[PATH_MAX + 1]; |
| 712 |
714 |
|
|
| File src/running.h changed (mode: 100644) (index 4bcb2a703..2dc632e5c) |
| ... |
... |
void rn_follow(struct view_t *view); |
| 55 |
55 |
void rn_open_with(struct view_t *view, const char prog_spec[], int dont_execute, |
void rn_open_with(struct view_t *view, const char prog_spec[], int dont_execute, |
| 56 |
56 |
int force_bg); |
int force_bg); |
| 57 |
57 |
|
|
| 58 |
|
/* Handles opening of current entry of the view as directory. */ |
|
| 59 |
|
void rn_enter(struct view_t *view); |
|
| 60 |
|
|
|
| 61 |
58 |
/* Moves the view to levels-th parent directory taking care of special cases |
/* Moves the view to levels-th parent directory taking care of special cases |
| 62 |
59 |
* like root of FUSE mount. */ |
* like root of FUSE mount. */ |
| 63 |
60 |
void rn_leave(struct view_t *view, int levels); |
void rn_leave(struct view_t *view, int levels); |