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(undo): undo after pair character input #1194

Merged
merged 4 commits into from
May 20, 2021

Conversation

datokrat
Copy link
Contributor

This fixes #559.

The problem seems to be that the textarea value is set via (set! (.-value target) new-value). This corresponds to target.value = new-value in JavaScript and seems to break the undo mechanism.

In the above fix I replaced these commands by calls to execCommand, as it is already the case in surround-and-set, which is called when the user presses cmd+y etc. to surround text with ~~.

@CLAassistant
Copy link

CLAassistant commented May 18, 2021

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@arkRedM arkRedM left a comment

Choose a reason for hiding this comment

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

Since you are already editing this fn
can you change https://github.com/athensresearch/athens/pull/1194/files#R572 to 575
to
(every? #(= % key lookbehind) ["}" ....]) ?

@tangjeff0 tangjeff0 changed the title fix #559: undo after pair character input fix(undo): undo after pair character input May 20, 2021
Copy link
Collaborator

@tangjeff0 tangjeff0 left a comment

Choose a reason for hiding this comment

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

Great first PR! @datokrat we can give you bounties for this. What is your Discord handle?

@tangjeff0 tangjeff0 merged commit b635da0 into athensresearch:main May 20, 2021
korlaism pushed a commit to korlaism/athens that referenced this pull request Jul 19, 2021
* fix athensresearch#559: undo after pair character input

* add comments: execCommand is obsolete

* replace "or" clause with "some" to remove duplication

Co-authored-by: jeff <[email protected]>
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.

Undo (ctrl/cmd+z) doesn't work on special characters like [ , ] , ( , or )
4 participants