fix: allow insert_link to newfile (closes #286)

This commit is contained in:
Thomas Lambert
2023-10-12 09:23:44 +02:00
parent bd5d323581
commit 3fd50c62c1

View File

@@ -1280,6 +1280,9 @@ local function InsertLink(opts)
actions.select_default:replace(function() actions.select_default:replace(function()
actions.close(prompt_bufnr) actions.close(prompt_bufnr)
local selection = action_state.get_selected_entry() local selection = action_state.get_selected_entry()
if selection == nil then
selection = { filename = action_state.get_current_line() }
end
local pinfo = Pinfo:new({ local pinfo = Pinfo:new({
filepath = selection.filename or selection.value, filepath = selection.filename or selection.value,
opts, opts,