kylechui / nvim-surround

Add/change/delete surrounding delimiter pairs with ease. Written with :heart: in Lua.
MIT License
3.16k stars 63 forks source link

`dsf` deletes an extra character #207

Closed pedro757 closed 1 year ago

pedro757 commented 1 year ago

Checklist

Neovim Version

NVIM v0.9.0-dev-869+g964ae205a Build type: RelWithDebInfo LuaJIT 2.1.0-beta3

Plugin Version

Latest

Minimal Configuration

require("nvim-surround").setup()

Sample Buffer

function myFunction(value) {
  return value
}

export default function Page() {
  const somevalue = "something";

  return (
    <div onClick={myFunction(somevalue)}>

    </div>
  );
}

Keystroke Sequence

With the cursor on value in the onClick call, use dsf

Expected behavior

function myFunction(value) {
  return value
}

export default function Page() {
  const somevalue = "something";

  return (
    <div onClick={somevalue}>

    </div>
  );
}

Actual behavior

function myFunction(value) {
  return value
}

export default function Page() {
  const somevalue = "something";

  return (
    <div onClick=somevalue}>

    </div>
  );
}

Additional context

The problem here is that it deletes an extra character ( { ) at the beginning

kylechui commented 1 year ago

Can you try the untagged version of the plugin and see if the issue persists?

pedro757 commented 1 year ago

I just checked this out, and it works fine in the stable version but not in the latest version. I corrected the description of the issue. sorry.

kylechui commented 1 year ago

Try the latest commit, it should fix the issue. If not, feel free to re-open this issue.

pedro757 commented 1 year ago

Thank you, it's working now.