Giter Site home page Giter Site logo

Comments (5)

quangnguyen30192 avatar quangnguyen30192 commented on August 16, 2024 2

Thanks for reporting.

from cmp-nvim-ultisnips.

smjonas avatar smjonas commented on August 16, 2024 1

We would need to change the keyword pattern for this. As I understood it, this is a Vim regex that the line needs to match in order to trigger completion of a completion item.

function source:get_keyword_pattern()
return "\\%([^[:alnum:][:blank:]]\\|\\w\\+\\)"
end

However changing it to something like "\\.\\*" which should match any characters does not work for whatever reason (the snippet won't even show up then). PR / suggestions welcome.

from cmp-nvim-ultisnips.

fecet avatar fecet commented on August 16, 2024 1

Any workaround or solution?

from cmp-nvim-ultisnips.

anstadnik avatar anstadnik commented on August 16, 2024

Aha, I just understood that it might be wrong handling of the i parameter (in-word expansion), and not the context thing.

from cmp-nvim-ultisnips.

smjonas avatar smjonas commented on August 16, 2024

I thought about this a but more and came to the conclusion that the keyword_pattern is not the issue. The problem is that cmp will not invoke completion when typing directly after an existing word.

Let's say that you have a snippet with mrm as the trigger. Also assume that this is the buffer content and | is the cursor position:

end|

Currently, nvim-cmp will only show words that contain all of the characters in end. This is why the mrm snippet will not be suggested.

So what nvim-cmp needs to support is the following:
After endm| was typed, besides the words e, en, end and endm cmp needs to also match ndm, dm and m. This way, if you have a snippet mdm, it will be suggested because it starts with m.

So I think you should open an issue on nvim-cmp and include this as usecase.

from cmp-nvim-ultisnips.

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.