diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2025-07-25 14:12:32 +0300 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2025-07-26 00:42:15 +0300 |
commit | 24c3bfc4f18f06a465b70afa45783d568402abdf (patch) | |
tree | e3833d4299aa91a9dae430ef2d745a5103b59bf5 /src/qreg-commands.c | |
parent | a0121b5e4b2b1d7a8f697ef5ee1e9db2bd427bc2 (diff) | |
download | sciteco-24c3bfc4f18f06a465b70afa45783d568402abdf.tar.gz |
implemented <:Gq> for printing the Q-Register string as a message instead of inserting it
Diffstat (limited to 'src/qreg-commands.c')
-rw-r--r-- | src/qreg-commands.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/qreg-commands.c b/src/qreg-commands.c index a1da5f9..e9f80fb 100644 --- a/src/qreg-commands.c +++ b/src/qreg-commands.c @@ -545,6 +545,11 @@ teco_state_getqregstring_got_register(teco_machine_main_t *ctx, teco_qreg_t *qre if (!qreg->vtable->get_string(qreg, &str.data, &str.len, NULL, error)) return NULL; + if (teco_machine_main_eval_colon(ctx)) { + teco_interface_msg_literal(TECO_MSG_USER, str.data, str.len); + return &teco_state_start; + } + sptr_t pos = teco_interface_ssm(SCI_GETCURRENTPOS, 0, 0); if (str.len > 0) { @@ -565,10 +570,15 @@ teco_state_getqregstring_got_register(teco_machine_main_t *ctx, teco_qreg_t *qre } /*$ G Gq get paste - * Gq -- Insert Q-Register string + * Gq -- Insert or print Q-Register string + * :Gq * * Inserts the string of Q-Register <q> into the buffer * at its current position. + * If colon-modified prints the string as a message + * (i.e. to the terminal and/or in the message area) instead + * of modifying the current buffer. + * * Specifying an undefined <q> yields an error. */ TECO_DEFINE_STATE_EXPECTQREG(teco_state_getqregstring); |