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

fix(char): highlight only the current line when multi_line=false, closes #179 #283

Open myypo opened 10 months ago

myypo commented 10 months ago

Fixes #179

I think, pcall might be removed by adding an explicit line len check.

gerazov commented 8 months ago

I tried your branch and it still highlights multiple lines.

I might be missing something. Here's my config:

  "MyyPo/flash.nvim",
  branch = "bugfix/highlight-only-current-line-when-multi-false",
  keys = {
  {
      "<leader>l",
      mode = { "n", "x", "o" },
      function()
        require("flash").jump({
          search = {
            mode = "search",
            max_length = 0,
            forward = true,
            wrap = false,
            multi_line = false,
          },
          label = { after = { 0, 0 } },
          pattern = [[\<]],
        })
      end,
      desc = "Flash jump word forward"
    },
  }

image

myypo commented 8 months ago

I tried your branch and it still highlights multiple lines.

I might be missing something. Here's my config:

  "MyyPo/flash.nvim",
  branch = "bugfix/highlight-only-current-line-when-multi-false",
  keys = {
  {
      "<leader>l",
      mode = { "n", "x", "o" },
      function()
        require("flash").jump({
          search = {
            mode = "search",
            max_length = 0,
            forward = true,
            wrap = false,
            multi_line = false,
          },
          label = { after = { 0, 0 } },
          pattern = [[\<]],
        })
      end,
      desc = "Flash jump word forward"
    },
  }

image

The PR affects only the char mode triggered by pressing f/F/t/T by default. And multi_line option is only applicable to the char mode.

gerazov commented 8 months ago

Oh - didn't catch that, I'll raise another issue for multi_line in jumping mode. :pray:

github-actions[bot] commented 2 months ago

This PR is stale because it has been open 60 days with no activity.