folke / flash.nvim

Navigate your code with search labels, enhanced character motions and Treesitter integration
Apache License 2.0
2.47k stars 33 forks source link

bug: In regular search mode, flash exit automatically when there is no content match pattern #274

Closed mrbeardad closed 4 months ago

mrbeardad commented 10 months ago

Did you check docs and existing issues?

Neovim version (nvim -v)

v0.10.0-dev-9af03bc

Operating system/version

Microsoft Windows 11 Home 10.0.22621 N/A Build 22621

Describe the bug

In regular search mode, I want to input the pattern '\w*'. However, when there is no '\ in buffer, flash exit directly.

Steps To Reproduce

'asdf'
  1. :lua require('flash').jump{search={mode='search'}}
  2. press '\w*'
  3. flash exit when you only press '\

Expected Behavior

Do not exit flash automatically in search mode.

Repro

No response

rennsax commented 7 months ago

Is this issue related to the behavior: when calling require("flash").jump() through the key (default to s), flash mode will automatically exit when there is no match? (I find the behavior annoying since it makes flash.nvim never tolerate my typo mistake 🥲)

mycf commented 4 months ago

me too

mycf commented 4 months ago

https://github.com/folke/flash.nvim/blob/7bb4a9c75d1e20cd24185afedeaa11681829ba23/README.md?plain=1#L365

i find it, maybe can close the issue

      vim.api.nvim_create_autocmd("CmdlineEnter", {
        pattern = "*",
        callback = function()
          require("flash").toggle(false)
        end,
      })
      vim.api.nvim_create_autocmd("CmdlineLeave", {
        pattern = "*",
        callback = function()
          require("flash").toggle(true)
        end,
      })