feat(api): add node.open.drop() (#2164)
Co-authored-by: Alexander Courtis <alex@courtis.org>
This commit is contained in:
@@ -160,6 +160,13 @@ local function open_file_in_tab(filename)
|
||||
vim.cmd("tabe " .. vim.fn.fnameescape(filename))
|
||||
end
|
||||
|
||||
local function drop(filename)
|
||||
if M.quit_on_open then
|
||||
view.close()
|
||||
end
|
||||
vim.cmd("drop " .. vim.fn.fnameescape(filename))
|
||||
end
|
||||
|
||||
local function tab_drop(filename)
|
||||
if M.quit_on_open then
|
||||
view.close()
|
||||
@@ -303,6 +310,10 @@ function M.fn(mode, filename)
|
||||
return open_file_in_tab(filename)
|
||||
end
|
||||
|
||||
if mode == "drop" then
|
||||
return drop(filename)
|
||||
end
|
||||
|
||||
if mode == "tab_drop" then
|
||||
return tab_drop(filename)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user