Can you add a source in IModelContentChangedEvent? #3640
Replies: 3 comments
-
There is no end-to-end source, however it is tracked if the change was caused by an undo or redo operation. |
Beta Was this translation helpful? Give feedback.
-
Could you give me some examples to show me how to add a flag to an event? |
Beta Was this translation helpful? Give feedback.
-
Don't attach the flag to event, but rather store it in a global/instance variable: public doUpdate() {
this.updating = true;
try {
model.setValue(...);
} finally {
this.updating = false;
}
}
public handleModelContentChange(e) {
if (this.updating) {
return;
}
// ...
} Events are handled synchronously. |
Beta Was this translation helpful? Give feedback.
-
like ICursorSelectionChangedEvent
I want to filter event and do code sync via websocket
Now the change event will trigger a edit event dead loop
Beta Was this translation helpful? Give feedback.
All reactions