diff options
| author | Robin Haberkorn <rhaberkorn@fmsbw.de> | 2025-11-09 19:26:37 +0100 |
|---|---|---|
| committer | Robin Haberkorn <rhaberkorn@fmsbw.de> | 2025-11-09 19:26:37 +0100 |
| commit | 5d7e8df952b2e51c28fad3443d7c9973659fc2ed (patch) | |
| tree | 65db863c7cc409159532ea22cceb4fec34df1db8 /src/core-commands.c | |
| parent | 6e9e09b7d23fcc300dc469c1f410e53d0a111bfa (diff) | |
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.
Diffstat (limited to 'src/core-commands.c')
| -rw-r--r-- | src/core-commands.c | 25 |
1 files changed, 22 insertions, 3 deletions
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 <EJ>", 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 " " |
