From dacd19c9f73dc5663c241d414a382272bfc3eb05 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Wed, 5 Apr 2023 08:19:54 -0700 Subject: [PATCH] docs: ... and format the examples --- .../lua/window-events/format-tab-title.md | 37 +++++++++---------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/docs/config/lua/window-events/format-tab-title.md b/docs/config/lua/window-events/format-tab-title.md index 44ab17b27..9b9405371 100644 --- a/docs/config/lua/window-events/format-tab-title.md +++ b/docs/config/lua/window-events/format-tab-title.md @@ -25,15 +25,15 @@ shown in the tab. -- It prefers the title that was set via `tab:set_title()` -- or `wezterm cli set-tab-title`, but falls back to the -- title of the active pane in that tab. -function tab_title(tab_info) - local title = tab_info.tab_title - -- if the tab title is explicitly set, take that - if title and #title > 0 then - return title - end - -- Otherwise, use the title from the active pane - -- in that tab - return tab.active_pane.title +function tab_title(tab_info) + local title = tab_info.tab_title + -- if the tab title is explicitly set, take that + if title and #title > 0 then + return title + end + -- Otherwise, use the title from the active pane + -- in that tab + return tab.active_pane.title end wezterm.on( @@ -95,18 +95,17 @@ local SOLID_RIGHT_ARROW = wezterm.nerdfonts.pl_left_hard_divider -- It prefers the title that was set via `tab:set_title()` -- or `wezterm cli set-tab-title`, but falls back to the -- title of the active pane in that tab. -function tab_title(tab_info) - local title = tab_info.tab_title - -- if the tab title is explicitly set, take that - if title and #title > 0 then - return title - end - -- Otherwise, use the title from the active pane - -- in that tab - return tab.active_pane.title +function tab_title(tab_info) + local title = tab_info.tab_title + -- if the tab title is explicitly set, take that + if title and #title > 0 then + return title + end + -- Otherwise, use the title from the active pane + -- in that tab + return tab.active_pane.title end - wezterm.on( 'format-tab-title', function(tab, tabs, panes, config, hover, max_width)