ghostbuster91 / nvim-next

Apache License 2.0
29 stars 6 forks source link

df and dt are one character short #7

Closed Hubro closed 1 year ago

Hubro commented 1 year ago

With the following configuration:

      require("nvim-next").setup({
        default_mappings = {
          -- repeat_style = "directional", -- Overrides ; and ,
          repeat_style = "original", -- Overrides ; and ,
        },
        items = {
          builtins.f,
          builtins.t,
        },
      })

The regular f and t motions work, as does selection with vf and vt. However, for some reason, df and dt delete one character too little compared to the actual built-in motions.

For example, assuming ^ is the cursor position:

foobar
^

Pressing dfb results in:

bar
^

Which is wrong, because the "b" should also have been deleted. Similarly, pressing dtb instead results in:

obar
^

But it should have deleted every character up until the "b".

Basically when using d*, both motions are deleting 1 character too little.

Hubro commented 1 year ago

Works :tada: Thanks for the quick fix!