summaryrefslogtreecommitdiff
path: root/node.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2024-02-13 09:58:16 -0500
committerpommicket <pommicket@gmail.com>2024-02-13 09:58:16 -0500
commit176f0b1f52676bbcf61e5098e5cec400d52fc306 (patch)
tree7ab4e0bd76745ed2d84050d414637e1b72d41cb5 /node.c
parent6d85a7e605011d16018fdf202e40e59e2f916b63 (diff)
auto-detect indentation
Diffstat (limited to 'node.c')
-rw-r--r--node.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/node.c b/node.c
index f4fe8fc..8f32087 100644
--- a/node.c
+++ b/node.c
@@ -418,8 +418,11 @@ void node_frame(Ted *ted, Node *node, Rect r) {
// highlight active tab
gl_geometry_rect(tab_rect, settings_color(settings, is_active ? COLOR_ACTIVE_TAB_HL : COLOR_SELECTED_TAB_HL));
// set window title to active tab's title
- strbuf_printf(ted->window_title, "ted %s | %s", tab_title,
- settings->indent_with_spaces ? "spaces" : "tabs");
+ strbuf_printf(ted->window_title, "ted %s | ", tab_title);
+ if (buffer_indent_with_spaces(buffer))
+ strbuf_catf(ted->window_title, "%u spaces", buffer_tab_width(buffer));
+ else
+ strbuf_catf(ted->window_title, "tabs");
if (*rc_str(settings->lsp, "")) {
LSP *lsp = buffer_lsp(buffer);
strbuf_catf(ted->window_title, " | LSP %s",