AckslD / nvim-neoclip.lua

Clipboard manager neovim plugin with telescope integration
931 stars 19 forks source link

paste to the wrong place when using telescope #96

Closed Martinits closed 1 year ago

Martinits commented 1 year ago

Hello, I think an item selected from :Telescope neoclip should be pasted where the cursor is when launching telescope, but it seems not. For exmaple, if I launch telescope with the cursor is at t of the word text: image With a word foo yanked before: image After I select to paste foo with <C-P>, it's like: image I think it should be like tfooest just like you press p with the cursor at t, but it's not like that in the picture. Same thing as the paste_behind keybinding, it should be like footest instead of tfooest . My config:

require('neoclip').setup{
    enable_persistent_history = true,
    default_register = '+',
    keys = {
        telescope = {
            i = {
                select = '<CR>',
                paste = '<C-P>',
                paste_behind = '<C-B>',
                replay = '<C-Q>',
                delete = '<C-D>',
                custom = {},
            },
            n = {
                select = '<CR>',
                paste = 'p',
                paste_behind = 'P',
                replay = 'q',
                delete = 'd',
                custom = {},
            },
        },
    },
}
AckslD commented 1 year ago

Thanks for opening the issue. Hmm strange I can see this as well, but I'm confused why it happens since the paste command basically just calls ""p, but I wonder if something happens when closing the telescope picker just before.

Martinits commented 1 year ago

You are right. From my test, Telescope will strangely move the cursor right one column when it doesn't jump to other places. I'll try report to telescope, thanks!

AckslD commented 1 year ago

@Martinits this seems to be fixed now upstream so closing

Martinits commented 1 year ago

They've just reverted the PR.........