refactor(#2826): singleton View class, WIP
This commit is contained in:
@@ -41,7 +41,7 @@ function M.fn(opts)
|
||||
return
|
||||
end
|
||||
|
||||
if view.is_visible() then
|
||||
if view.View:is_visible() then
|
||||
-- focus
|
||||
if opts.focus then
|
||||
lib.set_target_win()
|
||||
|
||||
@@ -23,7 +23,7 @@ function M.fn(opts)
|
||||
opts.path = nil
|
||||
end
|
||||
|
||||
if view.is_visible() then
|
||||
if view.View:is_visible() then
|
||||
-- focus
|
||||
lib.set_target_win()
|
||||
view.focus()
|
||||
|
||||
@@ -8,7 +8,7 @@ function M.fn(opts)
|
||||
if opts == nil then
|
||||
-- reset to config values
|
||||
view.View:configure_width()
|
||||
view.resize()
|
||||
view.View:resize()
|
||||
return
|
||||
end
|
||||
|
||||
@@ -17,7 +17,7 @@ function M.fn(opts)
|
||||
|
||||
if width_cfg ~= nil then
|
||||
view.View:configure_width(width_cfg)
|
||||
view.resize()
|
||||
view.View:resize()
|
||||
return
|
||||
end
|
||||
|
||||
@@ -28,7 +28,7 @@ function M.fn(opts)
|
||||
|
||||
local absolute = options.absolute
|
||||
if type(absolute) == "number" then
|
||||
view.resize(absolute)
|
||||
view.View:resize(absolute)
|
||||
return
|
||||
end
|
||||
|
||||
@@ -39,7 +39,7 @@ function M.fn(opts)
|
||||
relative_size = "+" .. relative_size
|
||||
end
|
||||
|
||||
view.resize(relative_size)
|
||||
view.View:resize(relative_size)
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
@@ -40,7 +40,7 @@ function M.fn(opts, no_focus, cwd, bang)
|
||||
opts.path = nil
|
||||
end
|
||||
|
||||
if view.is_visible() then
|
||||
if view.View:is_visible() then
|
||||
-- close
|
||||
view.View:close()
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user