diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2024-09-25 13:56:20 +0200 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2024-09-25 13:56:20 +0200 |
commit | dcaeb77ef2c5fad1810d242d7a96669e33c4b082 (patch) | |
tree | 0b0119ea5f420777f077ffe285d8dcccc5425da9 /src/cmdline.c | |
parent | c2887621a37f429e2e05b561631fff01da8bd462 (diff) | |
download | sciteco-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/cmdline.c')
-rw-r--r-- | src/cmdline.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/cmdline.c b/src/cmdline.c index 0d32513..d024142 100644 --- a/src/cmdline.c +++ b/src/cmdline.c @@ -651,6 +651,27 @@ teco_state_stringbuilding_start_process_edit_cmd(teco_machine_stringbuilding_t * } gboolean +teco_state_stringbuilding_escaped_process_edit_cmd(teco_machine_stringbuilding_t *ctx, teco_machine_t *parent_ctx, + gunichar key, GError **error) +{ + /* + * Allow insertion of characters that would otherwise be interpreted as + * immediate editing commands after ^Q/^R. + */ + switch (key) { + //case TECO_CTL_KEY('G'): + case TECO_CTL_KEY('W'): + case TECO_CTL_KEY('U'): + teco_interface_popup_clear(); + + gchar c = key; + return teco_cmdline_insert(&c, sizeof(c), error); + } + + return teco_state_process_edit_cmd(parent_ctx, NULL, key, error); +} + +gboolean teco_state_stringbuilding_qreg_process_edit_cmd(teco_machine_stringbuilding_t *ctx, teco_machine_t *parent_ctx, gunichar chr, GError **error) { |