From 24c3bfc4f18f06a465b70afa45783d568402abdf Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Fri, 25 Jul 2025 14:12:32 +0300 Subject: implemented <:Gq> for printing the Q-Register string as a message instead of inserting it --- src/qreg-commands.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/qreg-commands.c') 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 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 yields an error. */ TECO_DEFINE_STATE_EXPECTQREG(teco_state_getqregstring); -- cgit v1.2.3