aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core-commands.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core-commands.c')
-rw-r--r--src/core-commands.c40
1 files changed, 35 insertions, 5 deletions
diff --git a/src/core-commands.c b/src/core-commands.c
index 653a40f..e0b2f89 100644
--- a/src/core-commands.c
+++ b/src/core-commands.c
@@ -551,9 +551,11 @@ teco_state_start_cmdline_push(teco_machine_main_t *ctx, GError **error)
!teco_qreg_table_edit_name(&teco_qreg_table_globals, "\e", 1, error))
return;
+ const gchar *macro = (const gchar *)teco_cmdline_ssm(SCI_GETCHARACTERPOINTER, 0, 0);
+
teco_interface_ssm(SCI_BEGINUNDOACTION, 0, 0);
teco_interface_ssm(SCI_CLEARALL, 0, 0);
- teco_interface_ssm(SCI_ADDTEXT, teco_cmdline.pc, (sptr_t)teco_cmdline.str.data);
+ teco_interface_ssm(SCI_ADDTEXT, teco_cmdline.pc, (sptr_t)macro);
teco_interface_ssm(SCI_ENDUNDOACTION, 0, 0);
/*
@@ -771,8 +773,10 @@ teco_state_start_input(teco_machine_main_t *ctx, gunichar chr, GError **error)
* for beginnings of command-lines?
* It could also be used for a corresponding KEYMACRO mask.
*/
- if (teco_cmdline.effective_len == 1 && teco_cmdline.str.data[0] == '*')
+ if (teco_cmdline_ssm(SCI_GETCURRENTPOS, 0, 0) == 1 &&
+ teco_cmdline_ssm(SCI_GETCHARAT, 0, 0) == '*')
return &teco_state_save_cmdline;
+ /* treat as an operator */
break;
case '<':
@@ -2013,6 +2017,13 @@ TECO_DEFINE_STATE_COMMAND(teco_state_ctlc_control);
* by the \(lqNerd Fonts\(rq project.
* Changes to this flag in interactive mode may not become
* effective immediately.
+ * .IP 1024:
+ * If set the default clipboard register \(lq~\(rq will refer
+ * to the primary clipboard (\(lq~P\(rq) instead of the
+ * clipboard selection (\(lq~C\(rq).
+ * .IP 2048:
+ * Enable/Disable redirection of Scintilla messages (\fBES\fP)
+ * to the command line's Scintilla view.
*
* The features controlled thus are discribed in other sections
* of this manual.
@@ -2135,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).
@@ -2189,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;
@@ -2226,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 " "
@@ -2284,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 " "