Skip to content

Commit

Permalink
Don't save empty tab history
Browse files Browse the repository at this point in the history
  • Loading branch information
aidanholm committed Jul 5, 2020
1 parent 313238a commit b5245c5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/undoclose.lua
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,18 @@ local on_tab_close = function (w, view)
local index = w.tabs:indexof(view)
local hist = view.history
local hist_item = hist.items[hist.index]
local title = lousy.util.escape(hist_item.title) or ""

-- Don't save tabs with no history
if not index or not hist_item then
return
end
-- Don't save the "New Tab" page in undoclose history
if _M.emit_signal("save", view) == false then
return
end

local title = lousy.util.escape(hist_item.title) or ""

tab = {
session_state = view.session_state,
uri = view.uri,
Expand Down

0 comments on commit b5245c5

Please sign in to comment.