Coder Social home page Coder Social logo

Comments (4)

saadparwaiz1 avatar saadparwaiz1 commented on June 12, 2024

Hi - what do you mean by automatically load?

from cmp_luasnip.

9mm avatar 9mm commented on June 12, 2024

When pressing <C-n> with nvim-cmp, the item thats currently highlighted actually gets expanded underneath the cursor each press of <C-n>, there's no need to actually "confirm" the item with tab/enter/whatever (at least according to my configuration of cmp)

The only one that doesnt follow this convention is cmp_luasnip, which requires a full confirmation.

It would be awesome if there was a setting that would expand the snippet with <C-n> (or the default next snippet key), and if you press <C-n> again and go PAST the snippet in the list it would simply disappear again and expand the NEXT selection in the cmp list.

from cmp_luasnip.

saadparwaiz1 avatar saadparwaiz1 commented on June 12, 2024

That's a bit out of the scope for this plugin. What we'd need is a way to undo a snippet expansion not sure if this is supported (tagging @L3MON4D3 incase he knows). Even if this was supported cmp will need to trigger the undo.

from cmp_luasnip.

L3MON4D3 avatar L3MON4D3 commented on June 12, 2024

So for now there's no "undo expansion" in luasnip, but it would be a nice addition.
I think the idea is pretty cool, but I don't think cmp has an un-execute-hook. There's resolve (traditionally for displaying documentation, but we could use it for this), but there is no callback that is called when the item is "undisplayed" (except resolve on the next item, but that's not always us :/)
So, this would need some changes to cmp-core, which I think are rather unlikely :/

from cmp_luasnip.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.