fix: pasting multiline register content (#971)
This commit is contained in:
@@ -51,7 +51,7 @@ telescope.setup({opts}) *telescope.setup()*
|
|||||||
history: ~
|
history: ~
|
||||||
This field handles the configuration for prompt history.
|
This field handles the configuration for prompt history.
|
||||||
By default it is a table, with default values (more below).
|
By default it is a table, with default values (more below).
|
||||||
To disable history, set it to either false or nil.
|
To disable history, set it to false.
|
||||||
|
|
||||||
Currently mappings still need to be added, Example:
|
Currently mappings still need to be added, Example:
|
||||||
mappings = {
|
mappings = {
|
||||||
|
|||||||
@@ -353,12 +353,7 @@ actions.paste_register = function(prompt_bufnr)
|
|||||||
-- ensure that the buffer can be written to
|
-- ensure that the buffer can be written to
|
||||||
if vim.api.nvim_buf_get_option(vim.api.nvim_get_current_buf(), "modifiable") then
|
if vim.api.nvim_buf_get_option(vim.api.nvim_get_current_buf(), "modifiable") then
|
||||||
print("Paste!")
|
print("Paste!")
|
||||||
-- substitute "^V" for "b"
|
vim.api.nvim_paste(entry.content, true, -1)
|
||||||
local reg_type = vim.fn.getregtype(entry.value)
|
|
||||||
if reg_type:byte(1, 1) == 0x16 then
|
|
||||||
reg_type = "b" .. reg_type:sub(2, -1)
|
|
||||||
end
|
|
||||||
vim.api.nvim_put({entry.content}, reg_type, true, true)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user