AckslD / nvim-neoclip.lua

Clipboard manager neovim plugin with telescope integration
994 stars 20 forks source link

Error after select something in telescope window #112

Closed Martinits closed 9 months ago

Martinits commented 9 months ago

Run :Telescope neoclip and select one:

Error executing lua callback: Vim:E315: ml_get: invalid lnum: 1
stack traceback:
        [C]: in function 'bufload'
        vim/_editor.lua: in function 'region'
        /usr/share/nvim/runtime/lua/vim/highlight.lua:35: in function 'range'
        ...share/nvim/lazy/nvim-ts-rainbow/lua/rainbow/internal.lua:82: in function 'update_range'
        ...share/nvim/lazy/nvim-ts-rainbow/lua/rainbow/internal.lua:186: in function 'cb'
        /usr/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:746: in function '_do_callback'
        /usr/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:180: in function 'invalidate'
        /usr/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:898: in function '_on_detach'
        /usr/share/nvim/runtime/lua/vim/treesitter.lua:73: in function </usr/share/nvim/runtime/lua/vim/treesitter.lua:69>
        [C]: in function 'nvim_buf_delete'
        ...l/share/nvim/lazy/telescope.nvim/lua/telescope/utils.lua:346: in function 'buf_delete'
        ...scope.nvim/lua/telescope/previewers/buffer_previewer.lua:351: in function '_teardown_func'
        ...zy/telescope.nvim/lua/telescope/previewers/previewer.lua:78: in function 'teardown'
        ...share/nvim/lazy/telescope.nvim/lua/telescope/pickers.lua:1486: in function 'on_close_prompt'
        .../nvim/lazy/telescope.nvim/lua/telescope/actions/init.lua:338: in function 'run_replace_or_original'
        ...re/nvim/lazy/telescope.nvim/lua/telescope/actions/mt.lua:65: in function 'close'
        ...are/nvim/lazy/nvim-neoclip.lua/lua/neoclip/telescope.lua:70: in function 'key_func'
        ...hare/nvim/lazy/telescope.nvim/lua/telescope/mappings.lua:253: in function <...hare/nvim/lazy/telescope.nvim/lua/telescope/mappings.lua:252>
Press ENTER or type command to continue

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 = {},
            },
        },
    },
}

vim.keymap.set('n', '<LEADER>y', ':Telescope neoclip<CR>', {desc = 'yank history'})
AckslD commented 9 months ago

Are your plugins up to date and what's your neovim version?

Martinits commented 9 months ago

Plugins are up to date, telescope.nvim is 0.1.5, and nvim is 0.9.4

AckslD commented 9 months ago

The error seems to come from nvim-ts-rainbow?

Martinits commented 9 months ago

Thanks, I misunderstood. That nvim-ts-rainbow is outdated.

AckslD commented 9 months ago

Glad you found the issue!