LuaSnip icon indicating copy to clipboard operation
LuaSnip copied to clipboard

Autosnippet Error Cmp Buffer

Open gordonwinship opened this issue 2 years ago • 2 comments

I have recently come across an issue at the interface between LuaSnip and Cmp

Plugins:

    use "hrsh7th/nvim-cmp" 
    use "hrsh7th/cmp-buffer" 
    use "saadparwaiz1/cmp_luasnip" 
    use({"L3MON4D3/LuaSnip"}) 

Snippet:

s({trig="bf", dscr="\textbf{}"},
  {
    t("\\textbf{"), 
    i(1),
    t("}"),
  }
),

cmp setting:

cmp.setup {
    [...]
    sources = {
        [...]
        {name = "buffer" }
    },
}

If buffer is enabled the above snippet first expands to \textbf{} and from then onwards to bf}{}. If buffer is disabled the snippet always expands to \textbf{}.

Maybe this issue should be raised with cmp instead. Any ideas on what the problem might be?

gordonwinship avatar Jan 10 '23 02:01 gordonwinship

Oh yikes, that sounds horrible. I think it would be best to first get some idea why there even is a second change, seems like your best bet for that is indeed opening an issue in cmp. We had similar issues when extmarks were moved around, but those mostly materialized when a functionNode is in the snippet, which isn't the case here.. So no, I don't have a good idea on what is going wrong :/

L3MON4D3 avatar Jan 10 '23 17:01 L3MON4D3

I think I'm running in the same issue

JuanVqz avatar Jan 15 '23 04:01 JuanVqz