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

Fix surround cursor position calculation #1183

Merged
merged 1 commit into from
Nov 29, 2021

Conversation

sudormrfbin
Copy link
Member

Fixes #1077. This was caused by the assumption that a block cursor is represented as zero width internally and simply rendered to be a single width selection, where as in reality a block cursor is an actual single width selection in form and function.

Behavioural changes:

  1. Surround selection no longer works when cursor is on a surround character that has matching pairs (like ' or "). This was the intended behaviour from the start but worked till now because of the cursor position calculation mismatch.

Fixes helix-editor#1077. This was caused by the assumption that a block
cursor is represented as zero width internally and simply
rendered to be a single width selection, where as in reality
a block cursor is an actual single width selection in form and
function.

Behavioural changes:

1. Surround selection no longer works when cursor is _on_ a
    surround character that has matching pairs (like `'`
    or `"`). This was the intended behaviour from the start
    but worked till now because of the cursor position
    calculation mismatch.
Copy link
Member

@dead10ck dead10ck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For what little my opinion is worth, this looks right to me. Thanks!

@archseer archseer merged commit dc53e65 into helix-editor:master Nov 29, 2021
@sudormrfbin sudormrfbin deleted the fix-surround-closing branch November 29, 2021 01:45
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

Successfully merging this pull request may close these issues.

Select object not work when cursor at the close pair
3 participants