mirror of
https://github.com/Ascyii/telekasten.nvim.git
synced 2026-01-01 14:14:24 -05:00
Merge pull request #19 from lambtho12/main
fix: paste link after cursor
This commit is contained in:
@@ -121,9 +121,9 @@ local function imgFromClipboard()
|
|||||||
os.execute("xclip -selection clipboard -t image/png -o > " .. pngpath)
|
os.execute("xclip -selection clipboard -t image/png -o > " .. pngpath)
|
||||||
if file_exists(pngpath) then
|
if file_exists(pngpath) then
|
||||||
if M.Cfg.image_link_style == "markdown" then
|
if M.Cfg.image_link_style == "markdown" then
|
||||||
vim.api.nvim_put({ "" }, "", false, true)
|
vim.api.nvim_put({ "" }, "", true, true)
|
||||||
else
|
else
|
||||||
vim.api.nvim_put({ "![[" .. pngname .. "]]" }, "", false, true)
|
vim.api.nvim_put({ "![[" .. pngname .. "]]" }, "", true, true)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -479,7 +479,7 @@ local function InsertLink(opts)
|
|||||||
actions.close(prompt_bufnr)
|
actions.close(prompt_bufnr)
|
||||||
local selection = action_state.get_selected_entry()
|
local selection = action_state.get_selected_entry()
|
||||||
local fn = path_to_linkname(selection.value)
|
local fn = path_to_linkname(selection.value)
|
||||||
vim.api.nvim_put({ "[[" .. fn .. "]]" }, "", false, true)
|
vim.api.nvim_put({ "[[" .. fn .. "]]" }, "", true, true)
|
||||||
if opts.i then
|
if opts.i then
|
||||||
vim.api.nvim_feedkeys("A", "m", false)
|
vim.api.nvim_feedkeys("A", "m", false)
|
||||||
end
|
end
|
||||||
@@ -789,7 +789,7 @@ local function InsertImgLink(opts)
|
|||||||
local selection = action_state.get_selected_entry()
|
local selection = action_state.get_selected_entry()
|
||||||
local fn = selection.value
|
local fn = selection.value
|
||||||
fn = fn:gsub(M.Cfg.home .. "/", "")
|
fn = fn:gsub(M.Cfg.home .. "/", "")
|
||||||
vim.api.nvim_put({ "" }, "", false, true)
|
vim.api.nvim_put({ "" }, "", true, true)
|
||||||
if opts.i then
|
if opts.i then
|
||||||
vim.api.nvim_feedkeys("A", "m", false)
|
vim.api.nvim_feedkeys("A", "m", false)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user