Skip to content
Snippets Groups Projects
Commit cd6a1a72 authored by Marijn Haverbeke's avatar Marijn Haverbeke
Browse files

[lint addon] Prevent events/timeouts trying to run after addon has been disabled

Issue #3104
parent 3a408884
No related branches found
No related tags found
No related merge requests found
......@@ -163,6 +163,7 @@
function onChange(cm) {
var state = cm.state.lint;
if (!state) return;
clearTimeout(state.timeout);
state.timeout = setTimeout(function(){startLinting(cm);}, state.options.delay || 500);
}
......@@ -188,6 +189,7 @@
clearMarks(cm);
cm.off("change", onChange);
CodeMirror.off(cm.getWrapperElement(), "mouseover", cm.state.lint.onMouseOver);
clearTimeout(cm.state.lint.timeout);
delete cm.state.lint;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment