camspiers / snap

A fast finder system for neovim.
The Unlicense
483 stars 16 forks source link

Empty results list with repopulated grep using fzy #68

Open gegoune opened 3 years ago

gegoune commented 3 years ago

With:

local rg_args = { "--smart-case", "--hidden", "--iglob", "!.git/*" }

local params = {
  reverse = true,
  consumer = "fzy",
  preview = false,
  [ some other options removed for visibility ]
}

snap.maps {
  {
    "\\",
    vimgrep {
      args = rg_args,
      prompt = "Grep",
      producer = snap.get("producer.ripgrep.vimgrep").line {},
    },
  },
  -- FIX: empty on initial invocation
  {
    "|",
    vimgrep {
      args = rg_args,
      prompt = "Grep",
      filter_with = "cword",
      producer = snap.get("producer.ripgrep.vimgrep").line {},
    },
  },
  -- FIX: empty on initial invocation
  {
    "|",
    vimgrep {
      args = rg_args,
      prompt = "Grep",
      filter_with = "selection",
      producer = snap.get("producer.ripgrep.vimgrep").line {},
    },
    { modes = { "x" } },
  },
}

press:

result:

Let's say I either had word snap selected in visual mode or cursor over it and pressed | - Ill get empty results list - but then if I hit backspace to remove p and reinsert p again I do get results.

expected:

get results straight away without having to change search string.

This is not the case with fzf consumer.