editor: make editor configurable via /executable

`/executable set editor /full/path/to/edit`.

Regards https://github.com/profanity-im/profanity/issues/1521
This commit is contained in:
Michael Vetter
2021-04-16 23:18:19 +02:00
parent 1f4f912e78
commit 19c5925c37
4 changed files with 23 additions and 3 deletions

View File

@@ -9276,6 +9276,21 @@ cmd_executable_urlsave(ProfWin* window, const char* const command, gchar** args)
return TRUE;
}
gboolean
cmd_executable_editor(ProfWin* window, const char* const command, gchar** args)
{
guint num_args = g_strv_length(args);
if (g_strcmp0(args[1], "set") == 0 && num_args >= 3) {
prefs_set_string(PREF_COMPOSE_EDITOR, args[2]);
cons_show("`editor` command set to invoke '%s'", args[2]);
} else {
cons_bad_cmd_usage(command);
}
return TRUE;
}
gboolean
cmd_mam(ProfWin* window, const char* const command, gchar** args)
{