fix(#1675): open-file sanity check mode
This commit is contained in:
parent
2b970635d1
commit
e94f517798
@ -175,6 +175,10 @@ local function set_current_win_no_autocmd(winid, autocmd)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function open_in_new_window(filename, mode, win_ids)
|
local function open_in_new_window(filename, mode, win_ids)
|
||||||
|
if type(mode) ~= "string" then
|
||||||
|
mode = ""
|
||||||
|
end
|
||||||
|
|
||||||
local target_winid = get_target_winid(mode)
|
local target_winid = get_target_winid(mode)
|
||||||
if not target_winid then
|
if not target_winid then
|
||||||
return
|
return
|
||||||
@ -239,6 +243,10 @@ local function edit_in_current_buf(filename)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function M.fn(mode, filename)
|
function M.fn(mode, filename)
|
||||||
|
if type(mode) ~= "string" then
|
||||||
|
mode = ""
|
||||||
|
end
|
||||||
|
|
||||||
if mode == "tabnew" then
|
if mode == "tabnew" then
|
||||||
return open_file_in_tab(filename)
|
return open_file_in_tab(filename)
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user