Skip to content

Commit

Permalink
feat: make cursor jump to the end of the link upon insertion
Browse files Browse the repository at this point in the history
  • Loading branch information
vhyrro committed Jul 30, 2021
1 parent fd5016b commit 8d52d0f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lua/telescope/_extensions/neorg/insert_link.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ return function(opts)
actions_set.select:replace(function()
local entry = actions.get_selected_entry()
actions.close(prompt_bufnr)
vim.api.nvim_put({ "[" .. entry.ordinal:gsub(":$", "") .. "]" .. "(" .. entry.display:gsub("^(%W+)%s+", "%1") .. ")" }, "c", true, true)
vim.api.nvim_put({ "[" .. entry.ordinal:gsub(":$", "") .. "]" .. "(" .. entry.display:gsub("^(%W+)%s+", "%1") .. ")" }, "c", false, true)
vim.api.nvim_feedkeys("ea", "t", false)
end)
return true
end,
Expand Down

0 comments on commit 8d52d0f

Please sign in to comment.