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

Put cursor at _start_ of blank pattern when removing elements, not end #4455

Merged

Conversation

StachuDotNet
Copy link
Member

Given the Dark code let x = (___,|2,3), hitting backspace changes it to let x = (|___,3), with the cursor at the start of the blank.

The equivalent, for the tuple match pattern, was different. It turned:

match (1,2)
  (___,|2,3) -> ___

into

match (1,2)
  (|___,3) -> ___

This was done by updating caretTargetForEndOfPattern to offset the cursor position by 0 rather than by 3.
There was a relevant note in place, and this seemed an appropriate time to follow the note.

Copy link
Member

@pbiggar pbiggar left a comment

Choose a reason for hiding this comment

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

Yeah, seems nicer

@StachuDotNet StachuDotNet merged commit 1b711cc into darklang:main Sep 6, 2022
@StachuDotNet StachuDotNet deleted the favor-end-of-blank-pattern branch June 9, 2023 15:16
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.

2 participants