Add an option to open file in new tab
This commit is contained in:
parent
972a1d35fb
commit
9b7b4e2214
|
|
@ -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)
|
||||||
|
if _config.open_in_new_tab then
|
||||||
vim.cmd("e " .. filename)
|
vim.cmd("e " .. filename)
|
||||||
|
else
|
||||||
|
vim.cmd("tabe " .. filename)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function M.Switch()
|
function M.Switch()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user