refactor(#2826): singleton View class, WIP

This commit is contained in:
Alexander Courtis
2025-04-20 13:20:41 +10:00
parent 3c024975fd
commit a3fe0c9007
7 changed files with 57 additions and 48 deletions

View File

@@ -198,7 +198,7 @@ end
local function open_file_in_tab(filename)
if M.quit_on_open then
view.close()
view.View:close()
end
if M.relative_path then
filename = utils.path_relative(filename, vim.fn.getcwd())
@@ -208,7 +208,7 @@ end
local function drop(filename)
if M.quit_on_open then
view.close()
view.View:close()
end
if M.relative_path then
filename = utils.path_relative(filename, vim.fn.getcwd())
@@ -218,7 +218,7 @@ end
local function tab_drop(filename)
if M.quit_on_open then
view.close()
view.View:close()
end
if M.relative_path then
filename = utils.path_relative(filename, vim.fn.getcwd())
@@ -427,7 +427,7 @@ function M.fn(mode, filename)
end
if M.quit_on_open then
view.close()
view.View:close()
end
end

View File

@@ -42,7 +42,7 @@ function M.fn(opts, no_focus, cwd, bang)
if view.is_visible() then
-- close
view.close()
view.View:close()
else
-- open
lib.open({