Add an option to open file in new tab

This commit is contained in:
Folkert Kevelam 2024-10-14 22:18:53 +02:00
parent 972a1d35fb
commit 9b7b4e2214

View File

@ -5,13 +5,18 @@ local Path = require"SpecSwitcher.path"
local _config = { local _config = {
descend_dir = {}, descend_dir = {},
switch_shortcut = "<leader>n" switch_shortcut = "<leader>n",
open_in_new_tab = true
} }
local mapping = Extension_Map:new() local mapping = Extension_Map:new()
function open(filename) local function open(filename)
vim.cmd("e " .. filename) if _config.open_in_new_tab then
vim.cmd("e " .. filename)
else
vim.cmd("tabe " .. filename)
end
end end
function M.Switch() function M.Switch()