diff options
author | Michael Vetter <jubalh@iodoru.org> | 2021-05-31 09:10:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-31 09:10:15 +0200 |
commit | 9f174c53cf7d52a7b684ed1e0d6ed00463eb498b (patch) | |
tree | b1ec0684d776abb798f644eb04b2c5a1797ad107 /src | |
parent | 69e3cebf26dc5c6a9c13fe3269bcd659060d7c4e (diff) | |
parent | a5a0dd6c919a2b4f12ef2b4f57a0d9a2a9cabf34 (diff) | |
download | profani-tty-9f174c53cf7d52a7b684ed1e0d6ed00463eb498b.tar.gz |
Merge pull request #1546 from Mic92/editor
external editor: don't use absolute paths and allow path search
Diffstat (limited to 'src')
-rw-r--r-- | src/command/cmd_funcs.c | 6 | ||||
-rw-r--r-- | src/config/preferences.c | 2 |
2 files changed, 2 insertions, 6 deletions
diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c index b2262c5f..a56f0cfc 100644 --- a/src/command/cmd_funcs.c +++ b/src/command/cmd_funcs.c @@ -9418,15 +9418,11 @@ cmd_editor(ProfWin* window, const char* const command, gchar** args) g_object_unref(fos); char* editor = prefs_get_string(PREF_COMPOSE_EDITOR); - if (!g_file_test(editor, G_FILE_TEST_EXISTS)) { - cons_show_error("Editor: binary %s not exist", editor); - return TRUE; - } // Fork / exec pid_t pid = fork(); if (pid == 0) { - int x = execl(editor, editor, g_file_get_path(file), (char*)NULL); + int x = execlp(editor, editor, g_file_get_path(file), (char*)NULL); if (x == -1) { cons_show_error("Editor:Failed to exec %s", editor); } diff --git a/src/config/preferences.c b/src/config/preferences.c index 4ff51092..c930fccd 100644 --- a/src/config/preferences.c +++ b/src/config/preferences.c @@ -2340,7 +2340,7 @@ _get_default_string(preference_t pref) case PREF_URL_OPEN_CMD: return "xdg-open %u"; case PREF_COMPOSE_EDITOR: - return "/usr/bin/vim"; + return "vim"; case PREF_URL_SAVE_CMD: return NULL; // Default to built-in method. default: |