summaryrefslogtreecommitdiff
path: root/xC.c
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2022-09-07 12:59:50 +0200
committerPřemysl Eric Janouch <p@janouch.name>2022-09-07 13:01:29 +0200
commit80089a4d65f32ef5be31d895c59515a7e21ce84b (patch)
treeba03672b1520150be9376d9509051ef29e413d59 /xC.c
parent93b66b6a2693ebbd8eb234a9436b457b0bdaba12 (diff)
downloadxK-80089a4d65f32ef5be31d895c59515a7e21ce84b.tar.gz
xK-80089a4d65f32ef5be31d895c59515a7e21ce84b.tar.xz
xK-80089a4d65f32ef5be31d895c59515a7e21ce84b.zip
xC: describe general.editor parse errors
Diffstat (limited to 'xC.c')
-rw-r--r--xC.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/xC.c b/xC.c
index 75e5ea8..d65e85a 100644
--- a/xC.c
+++ b/xC.c
@@ -13887,22 +13887,27 @@ build_editor_command (struct app_context *ctx, const char *filename)
{
case 'F':
str_append (&argument, filename);
- break;
+ continue;
case 'L':
str_append_printf (&argument, "%zu", line_one_based);
- break;
+ continue;
case 'C':
str_append_printf (&argument, "%zu", column + 1);
- break;
+ continue;
case 'B':
str_append_printf (&argument, "%d", cursor + 1);
- break;
+ continue;
case '%':
case ' ':
str_append_c (&argument, *editor);
- break;
- default:
- print_warning ("unknown substitution variable");
+ continue;
+ }
+
+ const char *p = editor;
+ if (soft_assert (utf8_decode (&p, strlen (p)) > 0))
+ {
+ log_global_error (ctx, "Unknown substitution variable: %#&s",
+ xstrndup (editor, p - editor));
}
}
if (argument.len)