aboutsummaryrefslogtreecommitdiffstats
path: root/fm.h
diff options
context:
space:
mode:
authorverdant <im@verdant.ee>2026-07-28 14:46:43 +0800
committerverdant <im@verdant.ee>2026-07-28 14:46:43 +0800
commitfe423ed2794273445ad51332d08b19155bcbc3e8 (patch)
treecb14719d9aba6b531c253c96856e49c479258634 /fm.h
parent81f3312cc234af234d325f40362e08777a4ffe35 (diff)
downloadsf-fe423ed2794273445ad51332d08b19155bcbc3e8.tar.gz
sf-fe423ed2794273445ad51332d08b19155bcbc3e8.zip
Implement open with editor
Fork a child process to run the text editor. If the "EDITOR" envrionment variable is not set, fallback to "vi".
Diffstat (limited to 'fm.h')
-rw-r--r--fm.h12
1 files changed, 12 insertions, 0 deletions
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 */