aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/parser.c')
-rw-r--r--src/parser.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/parser.c b/src/parser.c
index 9477b9a..729fe42 100644
--- a/src/parser.c
+++ b/src/parser.c
@@ -461,6 +461,15 @@ teco_state_stringbuilding_ctl_input(teco_machine_stringbuilding_t *ctx, gunichar
case 'W': return &teco_state_stringbuilding_upper;
case 'E': return &teco_state_stringbuilding_ctle;
default:
+ if (chr < '@' || chr > '_') {
+ /*
+ * If ^c wouldn't result in a control character,
+ * insert these characters verbatim.
+ */
+ if (ctx->result)
+ teco_string_append_c(ctx->result, '^');
+ break;
+ }
chr = TECO_CTL_KEY(chr);
}