From 5d7e8df952b2e51c28fad3443d7c9973659fc2ed Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Sun, 9 Nov 2025 19:26:37 +0100 Subject: allow configuring the command line height using h,5EJ * This allows for several customizations. * You can simply increase the visible command line history. For that you must also set SCI_SETWRAPMODE(SC_WRAP_CHAR). An example was added to fallback.teco_ini. * You could also set SCI_SETLINEENDTYPESALLOWED(SC_LINE_END_TYPE_DEFAULT) to see the structure of inserted text. * Alternatively we could have introduced a new command like EP or FW and also overload it to replace the current ED&2048 (e.g. -EP and EP). In DEC TECO `W` comes closest to what 5EJ now does. --- src/core-commands.c | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'src/core-commands.c') diff --git a/src/core-commands.c b/src/core-commands.c index e0141c3..e0b2f89 100644 --- a/src/core-commands.c +++ b/src/core-commands.c @@ -2146,8 +2146,11 @@ teco_state_ecommand_flags(teco_machine_main_t *ctx, GError **error) * The column after the last horizontal movement. * This is only used by \fBfnkeys.tes\fP and is similar to the Scintilla-internal * setting \fBSCI_CHOOSECARETX\fP. - * Unless most other settings, this is on purpose not restored on rubout, - * so it "survives" command line replacements. + * Unlike most other settings, this is on purpose not restored on rubout, + * so it \(lqsurvives\(rq command line replacements. + * .IP 5: + * Height of the command line view in lines. + * Must not be smaller than 1. * . * .IP -1: * Type of the last mouse event (\fBread-only\fP). @@ -2200,7 +2203,8 @@ teco_state_ecommand_properties(teco_machine_main_t *ctx, GError **error) EJ_BUFFERS, EJ_MEMORY_LIMIT, EJ_INIT_COLOR, - EJ_CARETX + EJ_CARETX, + EJ_CMDLINE_HEIGHT }; static teco_int_t caret_x = 0; @@ -2237,9 +2241,20 @@ teco_state_ecommand_properties(teco_machine_main_t *ctx, GError **error) break; case EJ_CARETX: + /* DON'T undo on rubout */ caret_x = value; break; + case EJ_CMDLINE_HEIGHT: + if (value < 1 || value > G_MAXUINT) { + g_set_error(error, TECO_ERROR, TECO_ERROR_FAILED, + "Invalid command line height %" TECO_INT_FORMAT " " + "for ", value); + return; + } + teco_undo_guint(teco_cmdline.height) = value; + break; + default: g_set_error(error, TECO_ERROR, TECO_ERROR_FAILED, "Cannot set property %" TECO_INT_FORMAT " " @@ -2295,6 +2310,10 @@ teco_state_ecommand_properties(teco_machine_main_t *ctx, GError **error) teco_expressions_push(caret_x); break; + case EJ_CMDLINE_HEIGHT: + teco_expressions_push(teco_cmdline.height); + break; + default: g_set_error(error, TECO_ERROR, TECO_ERROR_FAILED, "Invalid property %" TECO_INT_FORMAT " " -- cgit v1.2.3