refactor(#2826): rename View to Window
This commit is contained in:
@@ -41,11 +41,11 @@ function M.fn(opts)
|
||||
end
|
||||
|
||||
local explorer = core.get_explorer()
|
||||
if explorer and explorer.view:is_visible() then
|
||||
if explorer and explorer.window:is_visible() then
|
||||
-- focus
|
||||
if opts.focus then
|
||||
lib.set_target_win()
|
||||
explorer.view:focus()
|
||||
explorer.window:focus()
|
||||
end
|
||||
elseif opts.open then
|
||||
-- open
|
||||
|
||||
@@ -25,10 +25,10 @@ function M.fn(opts)
|
||||
|
||||
local explorer = core.get_explorer()
|
||||
|
||||
if explorer and explorer.view:is_visible() then
|
||||
if explorer and explorer.window:is_visible() then
|
||||
-- focus
|
||||
lib.set_target_win()
|
||||
explorer.view:focus()
|
||||
explorer.window:focus()
|
||||
else
|
||||
-- open
|
||||
lib.open({
|
||||
|
||||
@@ -12,8 +12,8 @@ function M.fn(opts)
|
||||
|
||||
if opts == nil then
|
||||
-- reset to config values
|
||||
explorer.view:configure_width()
|
||||
explorer.view:resize()
|
||||
explorer.window:configure_width()
|
||||
explorer.window:resize()
|
||||
return
|
||||
end
|
||||
|
||||
@@ -21,19 +21,19 @@ function M.fn(opts)
|
||||
local width_cfg = options.width
|
||||
|
||||
if width_cfg ~= nil then
|
||||
explorer.view:configure_width(width_cfg)
|
||||
explorer.view:resize()
|
||||
explorer.window:configure_width(width_cfg)
|
||||
explorer.window:resize()
|
||||
return
|
||||
end
|
||||
|
||||
if not explorer.view:is_width_determined() then
|
||||
if not explorer.window:is_width_determined() then
|
||||
-- {absolute} and {relative} do nothing when {width} is a function.
|
||||
return
|
||||
end
|
||||
|
||||
local absolute = options.absolute
|
||||
if type(absolute) == "number" then
|
||||
explorer.view:resize(absolute)
|
||||
explorer.window:resize(absolute)
|
||||
return
|
||||
end
|
||||
|
||||
@@ -44,7 +44,7 @@ function M.fn(opts)
|
||||
relative_size = "+" .. relative_size
|
||||
end
|
||||
|
||||
explorer.view:resize(relative_size)
|
||||
explorer.window:resize(relative_size)
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
@@ -42,9 +42,9 @@ function M.fn(opts, no_focus, cwd, bang)
|
||||
opts.path = nil
|
||||
end
|
||||
|
||||
if explorer and explorer.view:is_visible() then
|
||||
if explorer and explorer.window:is_visible() then
|
||||
-- close
|
||||
explorer.view:close()
|
||||
explorer.window:close()
|
||||
else
|
||||
-- open
|
||||
lib.open({
|
||||
|
||||
Reference in New Issue
Block a user