From 0750096827713a090fe8099aaca469c408bf36b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=99emysl=20Eric=20Janouch?= Date: Sun, 14 Aug 2022 20:26:38 +0200 Subject: [PATCH] xC: expand behaviour.editor_command examples --- xC.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/xC.c b/xC.c index 2b81e79..c610199 100644 --- a/xC.c +++ b/xC.c @@ -2443,7 +2443,8 @@ static struct config_schema g_config_behaviour[] = .default_ = "on", .on_change = on_config_word_wrapping_change }, { .name = "editor_command", - .comment = "VIM: \"vim +%Bgo %F\", Emacs: \"emacs -nw +%L:%C %F\"", + .comment = "VIM: \"vim +%Bgo %F\", Emacs: \"emacs -nw +%L:%C %F\", " + "nano/micro/kakoune: \"nano/micro/kak +%L:%C %F\"", .type = CONFIG_ITEM_STRING }, { .name = "process_pasted_text", .comment = "Normalize newlines and quote the command prefix in pastes", @@ -13214,6 +13215,13 @@ build_editor_command (struct app_context *ctx, const char *filename) && !(command = getenv ("EDITOR"))) command = "vi"; + // Although most visual editors support a "+LINE" argument (every + // editor mentioned in the default value of behaviour.editor_command, + // plus vi, mcedit, vis, ...), it isn't particularly useful by itself. + // We need to be able to specify the column number. + // + // Seeing as less popular software may try to process this as a filename + // and fail, do not bother with this "undocumented standard feature". strv_append (&argv, command); strv_append (&argv, filename); return argv;