diff options
| author | Robin Haberkorn <rhaberkorn@fmsbw.de> | 2025-11-02 23:21:21 +0100 |
|---|---|---|
| committer | Robin Haberkorn <rhaberkorn@fmsbw.de> | 2025-11-02 23:21:21 +0100 |
| commit | 1391e9c6ea1f9bef965f96e70f4e27141abcb5cd (patch) | |
| tree | e9c6631ce6959f8522ac3cf2425dd0a522e9cc16 /src | |
| parent | d9f10a31103d95b5b464207418f2a0498a03a7ae (diff) | |
render tabs as "TAB" in the command-line and in SciTECO macros
* This requires the new SCI_SETTABDRAWMODE(SCTD_CONTROLCHAR).
* It makes no sense to let TAB indent in TECO code as it can be
the insert-with-tab command (^I).
On the other hand large `I`-blocks could include TABs which are
actually meant as indentations.
Diffstat (limited to 'src')
| -rw-r--r-- | src/interface-gtk/interface.c | 10 | ||||
| -rw-r--r-- | src/view.c | 9 |
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", @@ -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) { |
