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

Adds command listeners for undo #256

Merged
merged 2 commits into from
Nov 21, 2024
Merged

Adds command listeners for undo #256

merged 2 commits into from
Nov 21, 2024

Conversation

dingfeli
Copy link
Contributor

Issue #, if available:
Auto trigger is done via a document listener.
Inline preview makes some assumptions about the editor state, such as caret offset. Changes made to the document via undo breaks these assumptions and will sometimes cause exceptions.
It is also not a natural expectation to expect suggestions based on changes made from undo.
Therefore we should exempt changes made via undo from making queries.

Description of changes:

  • Adds command listener to listen for undo command in autotrigger document listener.

Test:
Shown below:

  • Insertion done via undo does not trigger queries
  • Insertion done via normal input remains functional
    ezgif-3-5090d5729f

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@dingfeli dingfeli merged commit 53f14d9 into main Nov 21, 2024
1 check passed
@dingfeli dingfeli deleted the prevent-undo-from-querying branch November 21, 2024 20:43
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