Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions plugin/resurrect/tab_state.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
local wezterm = require("wezterm") --[[@as Wezterm]] --- this type cast invokes the LSP module for Wezterm
local pane_tree_mod = require("resurrect.pane_tree")
local state_manager_mod = require("resurrect.state_manager")
local pub = {}

---Function used to split panes when mapping over the pane_tree
Expand Down Expand Up @@ -121,7 +122,6 @@ end

function pub.save_tab_action()
return wezterm.action_callback(function(win, pane)
local resurrect = require("resurrect")
local tab = pane:tab()
if tab:get_title() == "" then
win:perform_action(
Expand All @@ -131,15 +131,15 @@ function pub.save_tab_action()
if title then
callback_pane:tab():set_title(title)
local state = pub.get_tab_state(tab)
resurrect.save_state(state)
state_manager_mod.save_state(state)
end
end),
}),
pane
)
elseif tab:get_title() then
local state = pub.get_tab_state(tab)
resurrect.state_manager.save_state(state)
state_manager_mod.save_state(state)
end
end)
end
Expand Down
6 changes: 4 additions & 2 deletions plugin/resurrect/window_state.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
local wezterm = require("wezterm") --[[@as Wezterm]] --- this type cast invokes the LSP module for Wezterm
local tab_state_mod = require("resurrect.tab_state")
local state_manager_mod = require("resurrect.state_manager")
local pub = {}


---Returns the state of the window
---@param window MuxWindow
---@return window_state
Expand Down Expand Up @@ -95,15 +97,15 @@ function pub.save_window_action()
if title then
window:mux_window():set_title(title)
local state = pub.get_window_state(mux_win)
resurrect.save_state(state)
state_manager_mod.save_state(state)
end
end),
}),
pane
)
elseif mux_win:get_title() then
local state = pub.get_window_state(mux_win)
resurrect.save_state(state)
state_manager_mod.save_state(state)
end
end)
end
Expand Down