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

BugFix: Handling multiple changes in a singular transaction #10

Merged
merged 1 commit into from
Jan 9, 2024

Conversation

KsanStone
Copy link
Contributor

When utilizing codemirror shortcuts such as alt+upArrow to move entire lines or editing via multiple cursors at once, a singular codemirror transaction may contain multiple changes in its change set, causing multiple am.splice calls.

This causes 2 issues:

  1. am.splice modifies the provided path variable, causing it to be corrupted on subsequent iterations
  2. The indices of the text document may have been altered by prior changes. Therefore, any subsequent modifications should utilize fromB instead of fromA, as it, unlike fromA, accounts for these index changes. Otherwise a RangeError may be thrown.

@alexjg alexjg merged commit c54592e into automerge:main Jan 9, 2024
2 checks passed
@alexjg
Copy link
Contributor

alexjg commented Jan 9, 2024

Great spot, thanks for the PR! I'll also try and fix splice so that it doesn't mutate the path.

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