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

[NNotepad] Fix #255 call refresh() when editor changes by typing, pasting, or deleting #257

Merged
merged 2 commits into from
Jun 21, 2024

Conversation

ibelem
Copy link
Contributor

@ibelem ibelem commented Jun 21, 2024

@ibelem ibelem changed the title Fix #255 call refresh() when editor changes by typing, pasting, or deleting [NNotepad] Fix #255 call refresh() when editor changes by typing, pasting, or deleting Jun 21, 2024
Copy link
Member

@inexorabletash inexorabletash left a comment

Choose a reason for hiding this comment

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

LGTM (could just pass refresh direcrly instead of a lambda, but I find this more readable)

Do we want to remove the addEventListener call?

@ibelem
Copy link
Contributor Author

ibelem commented Jun 21, 2024

Thanks @inexorabletash, confirmed the original addEventListener call can be covered by editor.onDidChangeModelContent(). PTAL

@inexorabletash
Copy link
Member

LGTM!

@Honry Honry merged commit 6aaa22b into webmachinelearning:master Jun 21, 2024
3 checks passed
@inexorabletash
Copy link
Member

One follow up - @ibelem do you know if the content model change callbacks are throttled? In the old code I used a "debounce" function so that the processing is not done on every keystroke, but only after there have been no changes for 500ms or so.

(I'll test when I can.)

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.

[NNotepad] deleting text doesn't cause refresh
3 participants