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: jump configs not applying #316

Closed steveshi7 closed 7 months ago

steveshi7 commented 7 months ago

Did you check docs and existing issues?

Neovim version (nvim -v)

0.9.5

Operating system/version

OSX 14.3.1

Describe the bug

I thought I set up my jump keys to be identical to those in the forward/backwards section of the README, but my jump keys are still both wrapping forwards/backwards as well as searching multiwindow. Is this a bug or am I doing something wrong with my config?

For reference, all other configs are applying successfully (disabling backdrop, enabling rainbow labels, etc).

Config:

{
    "folke/flash.nvim",
    event = "VeryLazy",
    ---@type Flash.Config
    opts = {
        highlight = {
            backdrop = false,
        },
        label = {
            rainbow = {
                enabled = true,
                shade = 2,
            }
        },
        modes = {
            char = {
                enabled = false,
            },
        },
    },
    -- stylua: ignore
    keys = {
        { "s",         mode = { "n", "x", "o" }, function() require("flash").jump({ forward = true, wrap = false, multi_window = false }) end,  desc = "Flash Forwards" },
        { "S",         mode = { "n", "x", "o" }, function() require("flash").jump({ forward = false, wrap = false, multi_window = false }) end, desc = "Flash Backwards" },
        { "<leader>t", mode = { "n", "x", "o" }, function() require("flash").jump({ multi_window = true }) end,                                 desc = "Flash Teleport" },
        { "<c-s>",     mode = { "c" },           function() require("flash").toggle() end,                                                      desc = "Toggle Flash Search" },
        { "R",         mode = { "n", "x", "o" }, function() require("flash").treesitter() end,                                                  desc = "Flash Treesitter" },
    },
},

Steps To Reproduce

  1. Setup flash, configs and keys
  2. Try jumping using 's' and 'S'

Expected Behavior

Jumping follows configuration to only go forwards and backwards.

steveshi7 commented 7 months ago

Fixed by resolving an oopsie: config needs to be { search = { forward = true, wrap = false, multi_window = false } } rather than { forward = true, wrap = false, multi_window = false }