fix: invalid explorer on open (#2927)
* fix: use of possibly stale value The return value of `core.get_explorer()` could be changed by `core.init(..)`. * fix style --------- Co-authored-by: Alexander Courtis <alex@courtis.org>
This commit is contained in:
@@ -263,8 +263,6 @@ end
|
|||||||
function M.open(opts)
|
function M.open(opts)
|
||||||
opts = opts or {}
|
opts = opts or {}
|
||||||
|
|
||||||
local explorer = core.get_explorer()
|
|
||||||
|
|
||||||
M.set_target_win()
|
M.set_target_win()
|
||||||
if not core.get_explorer() or opts.path then
|
if not core.get_explorer() or opts.path then
|
||||||
if opts.path then
|
if opts.path then
|
||||||
@@ -278,6 +276,9 @@ function M.open(opts)
|
|||||||
core.init(cwd)
|
core.init(cwd)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local explorer = core.get_explorer()
|
||||||
|
|
||||||
if should_hijack_current_buf() then
|
if should_hijack_current_buf() then
|
||||||
view.close_this_tab_only()
|
view.close_this_tab_only()
|
||||||
view.open_in_win()
|
view.open_in_win()
|
||||||
|
|||||||
Reference in New Issue
Block a user