From 4e6ddd6c329d56055a732c6344df019f0d997aaf Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Fri, 7 Nov 2025 21:39:12 +0100 Subject: the command line macro is now managed by a Scintilla view * Instead of rendering a teco_string_t into a Scintilla view (GTK) and an ncurses window (Curses), it is now a Scintilla view and document that is modified directly. * Reduces redundancies between GTK and Curses UIs. * It will be more efficient on very large command lines, especially on GTK. * We can now redirect Scintilla messages to the command line view in order to configure syntax highlighting, the margin, rubout indicator style and scroll behavior (TODO). * This will also simplify the configuration of multi-line command lines (TODO). * Since INDIC_PLAIN is not supported by Scinterm, rubbed out command lines are now styled with INDIC_STRAIGHTBOX (background color). --- src/doc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/doc.c') diff --git a/src/doc.c b/src/doc.c index 4ac96c8..1ec4d80 100644 --- a/src/doc.c +++ b/src/doc.c @@ -205,7 +205,8 @@ teco_doc_get_string(teco_doc_t *ctx, gchar **str, gsize *outlen, guint *codepage gsize len = teco_view_ssm(teco_qreg_view, SCI_GETLENGTH, 0, 0); if (str) { *str = g_malloc(len + 1); - teco_view_ssm(teco_qreg_view, SCI_GETTEXT, len + 1, (sptr_t)*str); + /* null-terminates the string */ + teco_view_ssm(teco_qreg_view, SCI_GETTEXT, len, (sptr_t)*str); } if (outlen) *outlen = len; -- cgit v1.2.3