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

Bug when closing delimiter is at line end and open delimiter is after a multi-byte character #284

Closed
agguser opened this issue Nov 24, 2019 · 3 comments

Comments

@agguser
Copy link
Contributor

agguser commented Nov 24, 2019

For example, when a line of text is

a→'bc'

, and the cursor is on b, doing ds' causes the line to be

abc→

instead of

a→bc

. Note that when set virtualedit=onemore, the bug does not occur.

@agguser agguser changed the title Bug when closing delimiter is at line end and opening delimiter is after a multi-byte character Bug when closing delimiter is at line end and open delimiter is after a multi-byte character Nov 24, 2019
@agguser
Copy link
Contributor Author

agguser commented Nov 27, 2019

A fix is to change the line (in plugin/surround.vim)

  if col("']") == col("$") && col('.') + 1 == col('$')

to

  if col("']") == col("$") && virtcol('.') + 1 == virtcol('$')

. But I'm not sure if this will cause another bug.

@tpope
Copy link
Owner

tpope commented Nov 27, 2019

I'm not sure either, but I'd be willing to merge a PR and find out.

@agguser
Copy link
Contributor Author

agguser commented Jan 8, 2020

It seems that the fix doesn't cause a bug, so I close this issue.

@agguser agguser closed this as completed Jan 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants