folke / flash.nvim

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

bug: Using require('flash').jump while deleting backwards in inclusive mode produces different behaviour than dF motion #376

Open DanWlker opened 1 month ago

DanWlker commented 1 month ago

Did you check docs and existing issues?

Neovim version (nvim -v)

0.10.1

Operating system/version

MacOS 14.6.1

Describe the bug

'x', 'o'
      ^

using motion dsxa

''
 ^

'x', 'o'
      ^

using motion dFx

'o'
 ^

Steps To Reproduce

Here's my config:

{
  'folke/flash.nvim',
  event = 'VeryLazy',
  opts = {},
  keys = {
    {
      's',
      mode = { 'n', 'x', 'o' },
      function()
        require('flash').jump {
          search = {
            multi_window = false,
          },
        }
      end,
      desc = 'Flash (On the character)',
    },
  },
}

Expected Behavior

dsxa and dFx should match

Repro

vim.env.LAZY_STDPATH = '.repro'
load(vim.fn.system 'curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua')()

require('lazy.minit').repro {
  spec = {
    {
      'folke/flash.nvim',
      event = 'VeryLazy',
      opts = {},
      keys = {
        {
          's',
          mode = { 'n', 'x', 'o' },
          function()
            require('flash').jump {
              search = {
                multi_window = false,
              },
            }
          end,
          desc = 'Flash (On the character)',
        },
      },
    },
  },
}
github-actions[bot] commented 1 day ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.