Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Check if exact same text as snippet #1571

@ilan-schemoul

Description

@ilan-schemoul

I want to emulate ultisnips behaviour where only if exact snippet is typed out and you press tab it expands.
(if I have foo => blabla if I type fo it should open ultisnips, if I have foo => blabla).
I need to do

        ['<Tab>'] = {
  function(cmp)
      local exact_snippet = cmp.get_selected_item().label == cmp.get_current_input() -- get_current_input does not exist
      if cmp.snippet_active() then return cmp.accept()
      elseif exact_snippet then return cmp.select_and_accept() end
      return false
[...]

or something like that ? But I need a way to be sure the "current input" of the user is exactly the snippet.
How to do such thing

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions