Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to rename buffer #34

Closed
Stephan14 opened this issue Jan 14, 2023 · 3 comments · Fixed by #37
Closed

Failed to rename buffer #34

Stephan14 opened this issue Jan 14, 2023 · 3 comments · Fixed by #37

Comments

@Stephan14
Copy link

Stephan14 commented Jan 14, 2023

Error executing vim.schedule lua callback: ...m/site/pack/packer/start/glance.nvim/lua/glance/list.lua:219: Failed to rename buffer
stack traceback:
        [C]: in function 'nvim_buf_set_name'
        ...m/site/pack/packer/start/glance.nvim/lua/glance/list.lua:219: in function 'setup'
        ...m/site/pack/packer/start/glance.nvim/lua/glance/list.lua:41: in function 'create'
        ...m/site/pack/packer/start/glance.nvim/lua/glance/init.lua:252: in function 'create'
        ...m/site/pack/packer/start/glance.nvim/lua/glance/init.lua:88: in function 'create'
        ...m/site/pack/packer/start/glance.nvim/lua/glance/init.lua:154: in function '_open'
        ...m/site/pack/packer/start/glance.nvim/lua/glance/init.lua:168: in function 'handler'
        ...l/Cellar/neovim/0.8.2/share/nvim/runtime/lua/vim/lsp.lua:1383: in function ''
        vim/_editor.lua: in function <vim/_editor.lua:0>

I have look at #23 and updated to the latest version for glance.nvim, but it still report an error as above. Here is my configuration

local glance = require('glance')
    local actions = glance.actions

    glance.setup({
        height = 18, -- Height of the window
        zindex = 45,
        preview_win_opts = { -- Configure preview window options
            cursorline = true,
            number = true,
            wrap = true,
        },
        border = {
            enable = false, -- Show window borders. Only horizontal borders allowed
            top_char = '―',
            bottom_char = '―',
        },
        list = {
            position = 'right', -- Position of the list window 'left'|'right'
            width = 0.33, -- 33% width relative to the active window, min 0.1, max 0.5
        },
        theme = { -- This feature might not work properly in nvim-0.7.2
            enable = true, -- Will generate colors for the plugin based on your current colorscheme
            mode = 'auto', -- 'brighten'|'darken'|'auto', 'auto' will set mode based on the brightness of your colorscheme
        },
        mappings = {
            list = {
                ['j'] = actions.next, -- Bring the cursor to the next item in the list
                ['k'] = actions.previous, -- Bring the cursor to the previous item in the list
                ['<Down>'] = actions.next,
                ['<Up>'] = actions.previous,
                ['<Tab>'] = actions.next_location, -- Bring the cursor to the next location skipping groups in the list
                ['<S-Tab>'] = actions.previous_location, -- Bring the cursor to the previous location skipping groups in the list
                ['<C-u>'] = actions.preview_scroll_win(5),
                ['<C-d>'] = actions.preview_scroll_win(-5),
                ['v'] = actions.jump_vsplit,
                ['s'] = actions.jump_split,
                ['t'] = actions.jump_tab,
                ['<CR>'] = actions.jump,
                ['o'] = actions.jump,
                ['<leader>l'] = actions.enter_win('preview'), -- Focus preview window
                ['q'] = actions.close,
                ['Q'] = actions.close,
                ['<Esc>'] = actions.close,
                -- ['<Esc>'] = false -- disable a mapping
            },
            preview = {
                ['Q'] = actions.close,
                ['<Tab>'] = actions.next_location,
                ['<S-Tab>'] = actions.previous_location,
                ['<leader>l'] = actions.enter_win('list'), -- Focus list window
            },
        },
        hooks = {},
        folds = {
            fold_closed = '',
            fold_open = '',
            folded = true, -- Automatically fold list on startup
        },
        indent_lines = {
            enable = true,
            icon = '│',
        },
        winbar = {
            enable = true, -- Available strating from nvim-0.8+
        },
    })

nvim versoin

NVIM v0.8.2
Build type: Release
LuaJIT 2.1.0-beta3



@DNLHC
Copy link
Owner

DNLHC commented Jan 14, 2023

Hi,
It doesn't reproduce with my setup, what LSP did you use when that error occurred? And how often does that happen?

@Stephan14
Copy link
Author

That LSP server is clangd. And it does not often happen.

@williamboman
Copy link
Contributor

I'm running into this as well (with vtsls). I believe the best course of action would be to simply not set a name for the buffer. This is because the "buffer name" represents the file name of the buffer - seeing as these are just ephemeral nofile buffers they don't represent a file on the file system.

williamboman added a commit to williamboman/glance.nvim that referenced this issue Jan 28, 2023
This is because the "buffer name" represents the file name of the buffer
- seeing as these are just ephemeral nofile buffers they don't represent
a file on the file system.

Closes DNLHC#34.
@DNLHC DNLHC closed this as completed in #37 Jan 29, 2023
DNLHC pushed a commit that referenced this issue Jan 29, 2023
This is because the "buffer name" represents the file name of the buffer
- seeing as these are just ephemeral nofile buffers they don't represent
a file on the file system.

Closes #34.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants