aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/parser.c
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2024-09-25 13:56:20 +0200
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2024-09-25 13:56:20 +0200
commitdcaeb77ef2c5fad1810d242d7a96669e33c4b082 (patch)
tree0b0119ea5f420777f077ffe285d8dcccc5425da9 /src/parser.c
parentc2887621a37f429e2e05b561631fff01da8bd462 (diff)
downloadsciteco-dcaeb77ef2c5fad1810d242d7a96669e33c4b082.tar.gz
inhibit some immediate editing commands after ^Q/^R string building constructs
* This allows you to type ^Q^U (which would otherwise rub out the entire argument) and ^Q^W (which would otherwise rub out the ^Q). * ^Q^U coincidentally worked previously since the teco_state_stringbuilding_escaped state would default to teco_state_process_edit_cmd(). But it's better to make this feauture explicit. * This finally makes it possible to insert the ^W (23) char into a buffer. In interactive mode, you can still only type Caret+W as a string building construct. * ^G could also be inhibited after ^Q, but the control char is not used anywhere yet, so there is no point in doing that.
Diffstat (limited to 'src/parser.c')
-rw-r--r--src/parser.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/parser.c b/src/parser.c
index 15d9f5e..7ba9876 100644
--- a/src/parser.c
+++ b/src/parser.c
@@ -499,7 +499,14 @@ teco_state_stringbuilding_escaped_input(teco_machine_stringbuilding_t *ctx, guni
return &teco_state_stringbuilding_start;
}
-TECO_DEFINE_STATE(teco_state_stringbuilding_escaped);
+/* in cmdline.c */
+gboolean teco_state_stringbuilding_escaped_process_edit_cmd(teco_machine_stringbuilding_t *ctx, teco_machine_t *parent_ctx,
+ gunichar key, GError **error);
+
+TECO_DEFINE_STATE(teco_state_stringbuilding_escaped,
+ .process_edit_cmd_cb = (teco_state_process_edit_cmd_cb_t)
+ teco_state_stringbuilding_escaped_process_edit_cmd
+);
static teco_state_t *
teco_state_stringbuilding_lower_ctl_input(teco_machine_stringbuilding_t *ctx, gunichar chr, GError **error)