aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2022-08-14 20:26:38 +0200
committerPřemysl Eric Janouch <p@janouch.name>2022-08-14 20:27:30 +0200
commit0750096827713a090fe8099aaca469c408bf36b9 (patch)
tree4c7612a96fac4ba7502d4b1362c6e2e0fcd06569
parent49d9980662b123824dea607db0e764220ba5f7a5 (diff)
downloadxK-0750096827713a090fe8099aaca469c408bf36b9.tar.gz
xK-0750096827713a090fe8099aaca469c408bf36b9.tar.xz
xK-0750096827713a090fe8099aaca469c408bf36b9.zip
xC: expand behaviour.editor_command examples
-rw-r--r--xC.c10
1 files changed, 9 insertions, 1 deletions
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;