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

Delete sqrt with 'delete' before it, and add 'delete' tests #278

Merged
merged 2 commits into from
Mar 12, 2024

Conversation

jared-hughes
Copy link

@jared-hughes jared-hughes commented Mar 8, 2024

Behavior change

Setup: cursor immediately before a square root, e.g. at the start of a field with latex \sqrt{x}

Before: pressing "delete" (delete-to-the-right) would move the cursor to the right.

After: pressing "delete" (delete-to-the-right) deletes the square root and keeps the content within.

This matches the behavior of pressing "delete" when the cursor is at the far-right of the radix/index/degree of an nthroot.

Implementation notes

It just does the same as typing "Right" then "Backspace" (delete-to-the-left).

I also put some tests for "Delete" since there were previously only tests for "Backspace," added in mathquill@4a8779f.

@jared-hughes jared-hughes requested review from a team and mikehaverstock and removed request for a team March 8, 2024 02:26
Copy link
Member

@mikehaverstock mikehaverstock left a comment

Choose a reason for hiding this comment

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

Code looks good. Behavior seems to be as described. I think someone else should confirm this is the most intuitive/consistent behavior.

@jared-hughes
Copy link
Author

jared-hughes commented Mar 8, 2024

Merge blocker (now fixed): Negative behavior change when pressing "delete" before the index of an nthroot: <cursor>\sqrt[3]{5}. PR leaves "35" behind. Old behavior is moving the cursor to the start of the "3".

Silly inheritance tree.
@jared-hughes jared-hughes merged commit 437837c into main Mar 12, 2024
4 checks passed
@jared-hughes jared-hughes deleted the delete-across-sqrt branch March 12, 2024 21:42
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