Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

md deletes the wrong character on the right-hand side #543

Closed
Omnikar opened this issue Aug 3, 2021 · 7 comments · Fixed by #545
Closed

md deletes the wrong character on the right-hand side #543

Omnikar opened this issue Aug 3, 2021 · 7 comments · Fixed by #545
Labels
A-helix-term Area: Helix term improvements C-bug Category: This is a bug

Comments

@Omnikar
Copy link
Contributor

Omnikar commented Aug 3, 2021

Reproduction steps

  1. Position the cursor within a surround, such as between the parentheses in: This is (some) text.
  2. Type md( or md).
  3. The text becomes This is some)text.. The left parenthesis was deleted, but the space to the right of the right parenthesis was deleted instead of the parenthesis itself. Likewise, any usage of md deletes the character to the right of the character it should delete on the right-hand side.
@Omnikar Omnikar added the C-bug Category: This is a bug label Aug 3, 2021
@pickfire
Copy link
Contributor

pickfire commented Aug 3, 2021

Yes, this is a known issue on the implementation. I think kakoune might have the same issue, vim probably have a better implementation for this. cc @sudormrfbin

@pickfire pickfire added the A-helix-term Area: Helix term improvements label Aug 3, 2021
@sudormrfbin
Copy link
Member

Some of the text objects are broken too, probably a bug after the #376 cleanup. I'll see if I can fix it.

@cessen
Copy link
Contributor

cessen commented Aug 3, 2021

@sudormrfbin Sorry to (maybe?) snipe you on this. I was pretty sure I knew what was wrong. Should be fixed in #545.

What are the other text objects that are broken?

@sudormrfbin
Copy link
Member

@cessen Thanks for fixing it :) Around word is the only text object I noticed to be broken; it selects an extra white space on the side it's not supposed to:

// cursor anywhere on "text" and then `maw`

// expected:
some [text ]here

// current:
some[ text ]here

@cessen
Copy link
Contributor

cessen commented Aug 3, 2021

@sudormrfbin Okay, cool, I'll fix that too. Thanks!

@cessen
Copy link
Contributor

cessen commented Aug 3, 2021

Fix for word selection: #546

pickfire pushed a commit that referenced this issue Aug 4, 2021
@pickfire
Copy link
Contributor

pickfire commented Aug 4, 2021

I think our tests should use [] or some visual indicator rather than using numbers which is more error prone and we can't easily see stuff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-helix-term Area: Helix term improvements C-bug Category: This is a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants