From ffefc9a9eb8c1c68dd4fa71dcb12b20e2cb2dd49 Mon Sep 17 00:00:00 2001 From: Thomas Lambert Date: Sun, 5 Feb 2023 14:54:09 +0100 Subject: [PATCH] fix(insert_link): issues with cursor position (closes #147) --- doc/telekasten.txt | 2 +- lua/telekasten.lua | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/telekasten.txt b/doc/telekasten.txt index 8ba57a6..79964bf 100644 --- a/doc/telekasten.txt +++ b/doc/telekasten.txt @@ -653,7 +653,7 @@ telekasten.insert_link({opts})~ Valid keys for {opts} i:~ - If `true`, it will enter input mode by pressing the key. This is useful + If `true`, it will enter input mode by pressing the key. This is useful when being used in a simple `inoremap` key mapping like shown in |telekasten.mappings|. diff --git a/lua/telekasten.lua b/lua/telekasten.lua index 4603d90..944020d 100644 --- a/lua/telekasten.lua +++ b/lua/telekasten.lua @@ -1457,9 +1457,9 @@ local function InsertLink(opts) filepath = selection.filename or selection.value, opts, }) - vim.api.nvim_put({ "[[" .. pinfo.title .. "]]" }, "", true, true) + vim.api.nvim_put({ "[[" .. pinfo.title .. "]]" }, "", false, true) if opts.i then - vim.api.nvim_feedkeys("A", "m", false) + vim.api.nvim_feedkeys("a", "m", false) end end) map("i", "", picker_actions.yank_link(opts))