aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/interface-gtk/interface.c10
-rw-r--r--src/view.c9
2 files changed, 16 insertions, 3 deletions
diff --git a/src/interface-gtk/interface.c b/src/interface-gtk/interface.c
index 6098666..438e6cc 100644
--- a/src/interface-gtk/interface.c
+++ b/src/interface-gtk/interface.c
@@ -286,8 +286,6 @@ teco_interface_init(void)
teco_interface.cmdline_view = teco_view_new();
teco_view_setup(teco_interface.cmdline_view);
- /* single line mode - EOL characters won't break the line */
- teco_view_ssm(teco_interface.cmdline_view, SCI_SETLINEENDTYPESALLOWED, SC_LINE_END_TYPE_HIDDEN, 0);
teco_view_ssm(teco_interface.cmdline_view, SCI_SETUNDOCOLLECTION, FALSE, 0);
teco_view_ssm(teco_interface.cmdline_view, SCI_SETVSCROLLBAR, FALSE, 0);
teco_view_ssm(teco_interface.cmdline_view, SCI_SETMARGINTYPEN, 1, SC_MARGIN_TEXT);
@@ -299,6 +297,14 @@ teco_interface_init(void)
/* we will forward key events, so the view should only react to text insertion */
teco_view_ssm(teco_interface.cmdline_view, SCI_CLEARALLCMDKEYS, 0, 0);
+ /* single line mode - EOL characters won't break the line */
+ teco_view_ssm(teco_interface.cmdline_view, SCI_SETLINEENDTYPESALLOWED, SC_LINE_END_TYPE_HIDDEN, 0);
+ /* render tabs as "TAB" */
+ teco_view_ssm(teco_interface.cmdline_view, SCI_SETTABDRAWMODE, SCTD_CONTROLCHAR, 0);
+ teco_view_ssm(teco_interface.cmdline_view, SCI_SETTABWIDTH, 1, 0);
+ teco_view_ssm(teco_interface.cmdline_view, SCI_SETTABMINIMUMWIDTH,
+ teco_view_ssm(teco_interface.cmdline_view, SCI_TEXTWIDTH, STYLE_DEFAULT, (sptr_t)"TAB"), 0);
+
GtkWidget *cmdline_widget = GTK_WIDGET(teco_interface.cmdline_view);
gtk_widget_set_name(cmdline_widget, "sciteco-cmdline");
g_signal_connect(cmdline_widget, "size-allocate",
diff --git a/src/view.c b/src/view.c
index 790f832..702c5b6 100644
--- a/src/view.c
+++ b/src/view.c
@@ -145,7 +145,14 @@ teco_view_setup(teco_view_t *ctx)
TECO_DEFINE_UNDO_CALL(teco_view_ssm, teco_view_t *, unsigned int, uptr_t, sptr_t);
-/** @memberof teco_view_t */
+/**
+ * Configure typical TECO representations for control characters.
+ *
+ * You may have to SCI_SETVIEWEOL(TRUE) to see the CR and LF characters.
+ * In order to see the TAB character use SCI_SETTABDRAWMODE(SCTD_CONTROLCHAR).
+ *
+ * @memberof teco_view_t
+ */
void
teco_view_set_representations(teco_view_t *ctx)
{