Skip to content

Invalid 'col': out of range #2557

Description

@software-artificer

Make sure you have done the following

  • Updated to the latest version of blink.cmp
  • Searched for existing issues and documentation (try <C-k> on https://cmp.saghen.dev)

Bug Description

👋🏻 Getting issues using the ghost text in neovim 0.12.2, was previously working just fine in 0.11.

Reproducible in the project using rust-analyzer LSP configured via rustaceanvim.

Typing something like:

self.rea|d()

where self.rea is the words I typed, | represents the current cursor position and d() is a virtual text, then rapidly deleting rea to get the text down to just self. throws the following error:

vim.schedule callback: ...cmp/lua/blink/cmp/completion/windows/ghost_text/init.lua:110: Invalid 'col': out of range
stack traceback:
        [C]: in function 'nvim_buf_set_extmark'
        ...cmp/lua/blink/cmp/completion/windows/ghost_text/init.lua:110: in function <...cmp/lua/blink/cmp/completion/windows/ghost_text/init.lua:67>

My assumption here is this is because the LSP response is a bit slow.
I noticed similar problems were fixed in the past, so wonder if I just hit yet another edge case here.

Sorry, the screen recording is broken for me right now, otherwise I would include a video as well.

Let me know if you need any additional information.

P.S. Love the project ❤️

Relevant configuration

I was able to reproduce the problem with the following minimal configuration using lazy.nvim:

require('lazy').setup({
  spec = {
    {
      'Saghen/blink.cmp',
      version = '^1.10',
      opts = { completion = { ghost_text = { enabled = true } } },
    },
    {
      'mrcjkb/rustaceanvim',
      version = '^9.0.4',
      lazy = false,
    },
  },
})

neovim version

NVIM v0.12.2 Build type: Release LuaJIT 2.1.1774638290

blink.cmp version

v1.10.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    LSPRelated to a specific LSPbugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions