Feature: add the possibility to not focus tree on TabEnter when (#545)
This commit is contained in:
@@ -46,7 +46,7 @@ function M.tab_change()
|
|||||||
if bufname:match("Neogit") ~= nil or bufname:match("--graph") ~= nil then
|
if bufname:match("Neogit") ~= nil or bufname:match("--graph") ~= nil then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
view.open()
|
view.open({ focus_tree = false })
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -264,7 +264,8 @@ local function set_local(opt, value)
|
|||||||
vim.cmd(cmd)
|
vim.cmd(cmd)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M.open()
|
function M.open(options)
|
||||||
|
options = options or { focus_tree = true }
|
||||||
if not is_buf_valid() then
|
if not is_buf_valid() then
|
||||||
M.setup()
|
M.setup()
|
||||||
end
|
end
|
||||||
@@ -282,6 +283,9 @@ function M.open()
|
|||||||
set_local(k, v)
|
set_local(k, v)
|
||||||
end
|
end
|
||||||
vim.cmd ":wincmd ="
|
vim.cmd ":wincmd ="
|
||||||
|
if not options.focus_tree then
|
||||||
|
vim.cmd("wincmd p")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function M.close()
|
function M.close()
|
||||||
|
|||||||
Reference in New Issue
Block a user