From fe423ed2794273445ad51332d08b19155bcbc3e8 Mon Sep 17 00:00:00 2001 From: verdant Date: Tue, 28 Jul 2026 14:46:43 +0800 Subject: Implement open with editor Fork a child process to run the text editor. If the "EDITOR" envrionment variable is not set, fallback to "vi". --- fm.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'fm.h') diff --git a/fm.h b/fm.h index 4acf2d6..e515d5a 100644 --- a/fm.h +++ b/fm.h @@ -35,6 +35,17 @@ typedef struct { int top, bottom; } fm_info; +extern bool need_redraw; + +#define UTIL_VI 0 +#define UTIL_XDG_OPEN 1 + +#define ENV_SHELL 0 +#define ENV_EDITOR 1 +#define ENV_SF 2 + +static char *enveditor; + file_list *fm_getdir(file_list *list, const char *path); fm_info *fm_init(terminal *t); void fm_getcwd(fm_info *info); @@ -47,6 +58,7 @@ void fm_draw_file_stream(window *w, FILE *fp); void fm_cd_up(fm_info *i); void fm_cd_down(fm_info *i); bool fm_preview_file(window *w, const char *path); +int open_with_editor(char **argv); void magic_init(void); void magic_cleanup(void); #endif /* SF_FM_H */ -- cgit v1.2.3