From 3fd50c62c1ed2f973ce8639c1218445e4e91a962 Mon Sep 17 00:00:00 2001 From: Thomas Lambert Date: Thu, 12 Oct 2023 09:23:44 +0200 Subject: [PATCH] fix: allow insert_link to newfile (closes #286) --- lua/telekasten.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/telekasten.lua b/lua/telekasten.lua index e344501..e5409f7 100644 --- a/lua/telekasten.lua +++ b/lua/telekasten.lua @@ -1280,6 +1280,9 @@ local function InsertLink(opts) actions.select_default:replace(function() actions.close(prompt_bufnr) local selection = action_state.get_selected_entry() + if selection == nil then + selection = { filename = action_state.get_current_line() } + end local pinfo = Pinfo:new({ filepath = selection.filename or selection.value, opts,