committed by
GitHub
parent
d54fc28045
commit
543c07aa7a
@@ -48,7 +48,6 @@ local tabinitial = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
local BUFNR_PER_TAB = {}
|
local BUFNR_PER_TAB = {}
|
||||||
local LAST_FOCUSED_WIN = nil
|
|
||||||
local BUFFER_OPTIONS = {
|
local BUFFER_OPTIONS = {
|
||||||
swapfile = false,
|
swapfile = false,
|
||||||
buftype = "nofile",
|
buftype = "nofile",
|
||||||
@@ -174,8 +173,9 @@ function M.close()
|
|||||||
for _, win in pairs(a.nvim_list_wins()) do
|
for _, win in pairs(a.nvim_list_wins()) do
|
||||||
if tree_win ~= win and a.nvim_win_get_config(win).relative == "" then
|
if tree_win ~= win and a.nvim_win_get_config(win).relative == "" then
|
||||||
a.nvim_win_close(tree_win, true)
|
a.nvim_win_close(tree_win, true)
|
||||||
if tree_win == current_win and LAST_FOCUSED_WIN then
|
local prev_win = vim.fn.winnr "#" -- this tab only
|
||||||
a.nvim_set_current_win(LAST_FOCUSED_WIN)
|
if tree_win == current_win and prev_win > 0 then
|
||||||
|
a.nvim_set_current_win(vim.fn.win_getid(prev_win))
|
||||||
end
|
end
|
||||||
events._dispatch_on_tree_close()
|
events._dispatch_on_tree_close()
|
||||||
return
|
return
|
||||||
@@ -188,7 +188,6 @@ function M.open(options)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
LAST_FOCUSED_WIN = a.nvim_get_current_win()
|
|
||||||
create_buffer()
|
create_buffer()
|
||||||
open_window()
|
open_window()
|
||||||
set_window_options_and_buffer()
|
set_window_options_and_buffer()
|
||||||
|
|||||||
Reference in New Issue
Block a user