aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/symbols.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/symbols.c')
-rw-r--r--src/symbols.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/symbols.c b/src/symbols.c
index b5600e8..9cf1c35 100644
--- a/src/symbols.c
+++ b/src/symbols.c
@@ -38,6 +38,7 @@
#include "undo.h"
#include "expressions.h"
#include "interface.h"
+#include "cmdline.h"
#include "symbols.h"
teco_symbol_list_t teco_symbol_list_scintilla = {NULL, 0};
@@ -166,6 +167,13 @@ teco_symbol_list_auto_complete(teco_symbol_list_t *ctx, const gchar *symbol, tec
* Command states
*/
+static inline sptr_t
+teco_scintilla_ssm(unsigned int iMessage, uptr_t wParam, sptr_t lParam)
+{
+ return teco_view_ssm(teco_ed & TECO_ED_MINIBUF_SSM ? teco_cmdline.view : teco_interface_current_view,
+ iMessage, wParam, lParam);
+}
+
/*
* FIXME: This state could be static.
*/
@@ -316,6 +324,13 @@ gboolean teco_state_scintilla_symbols_insert_completion(teco_machine_main_t *ctx
* second string argument of \fBES\fP, i.e. it allows you
* to look up style ids by name.
*
+ * By default Scintilla messages are sent to the current buffer's
+ * view or the Q-register view \(em there is only one view for
+ * all Q-registers.
+ * If bit 11 is set in the \fBED\fP flags, the messages will be
+ * sent to the command-line view instead, which allows you to
+ * set up \*(ST syntax highlighting and other styles.
+ *
* .BR Warning :
* Almost all Scintilla messages may be dispatched using
* this command.
@@ -442,10 +457,10 @@ teco_state_scintilla_lparam_done(teco_machine_main_t *ctx, const teco_string_t *
/*
* FIXME: Should we cache the name to style id?
*/
- guint count = teco_interface_ssm(SCI_GETNAMEDSTYLES, 0, 0);
+ guint count = teco_scintilla_ssm(SCI_GETNAMEDSTYLES, 0, 0);
for (guint id = 0; id < count; id++) {
gchar style[128] = "";
- teco_interface_ssm(SCI_NAMEOFSTYLE, id, (sptr_t)style);
+ teco_scintilla_ssm(SCI_NAMEOFSTYLE, id, (sptr_t)style);
if (!teco_string_cmp(str, style, strlen(style))) {
teco_expressions_push(id);
return &teco_state_start;
@@ -491,7 +506,7 @@ teco_state_scintilla_lparam_done(teco_machine_main_t *ctx, const teco_string_t *
lParam = v;
}
- teco_expressions_push(teco_interface_ssm(ctx->scintilla.iMessage,
+ teco_expressions_push(teco_scintilla_ssm(ctx->scintilla.iMessage,
ctx->scintilla.wParam, lParam));
return &teco_state_start;