From 3666303c7b26c6c966b3f136dbb954686d334cc3 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Sun, 26 Mar 2023 11:19:34 -0700 Subject: [PATCH] docs: show the return values of the new pane:move_to_xxx methods --- docs/config/lua/pane/move_to_new_tab.md | 15 +++++++++++++++ docs/config/lua/pane/move_to_new_window.md | 15 +++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/docs/config/lua/pane/move_to_new_tab.md b/docs/config/lua/pane/move_to_new_tab.md index d614160bbb1..2cabcf25522 100644 --- a/docs/config/lua/pane/move_to_new_tab.md +++ b/docs/config/lua/pane/move_to_new_tab.md @@ -4,5 +4,20 @@ Creates a new tab in the window that contains `pane`, and moves `pane` into that tab. +Returns the newly created [MuxTab](../MuxTab/index.md) object, and the +[MuxWindow](../mux-window/index.md) object that contains it: + +```lua +config.keys = { + { + key = '!', + mods = 'LEADER | SHIFT', + action = callback(function(win, pane) + local tab, window = pane:move_to_new_tab() + end), + }, +} +``` + See also [pane:move_to_new_window()](move_to_new_window.md), [wezterm cli move-pane-to-new-tab](../../../cli/cli/move-pane-to-new-tab.md). diff --git a/docs/config/lua/pane/move_to_new_window.md b/docs/config/lua/pane/move_to_new_window.md index 84ffa9eb14b..e3d604fdf7f 100644 --- a/docs/config/lua/pane/move_to_new_window.md +++ b/docs/config/lua/pane/move_to_new_window.md @@ -8,6 +8,21 @@ The *WORKSPACE* parameter is optional; if specified, it will be used as the name of the workspace that should be associated with the new window. Otherwise, the current active workspace will be used. +Returns the newly created [MuxTab](../MuxTab/index.md) object, and the +newly created [MuxWindow](../mux-window/index.md) object. + +```lua +config.keys = { + { + key = '!', + mods = 'LEADER | SHIFT', + action = callback(function(win, pane) + local tab, window = pane:move_to_new_window() + end), + }, +} +``` + See also [pane:move_to_new_window()](move_to_new_window.md), [wezterm cli move-pane-to-new-tab](../../../cli/cli/move-pane-to-new-tab.md).