Skip to content
Snippets Groups Projects
Commit 9c349a57 authored by Andrey Lushnikov's avatar Andrey Lushnikov Committed by Marijn Haverbeke
Browse files

show-hint addon to emit "hintShowed" and "hintClosed" events

parent 5a0e4eea
No related branches found
No related tags found
No related merge requests found
......@@ -50,6 +50,7 @@ CodeMirror.showHint = function(cm, getHints, options) {
hints.style.left = left + "px";
hints.style.top = top + "px";
document.body.appendChild(hints);
CodeMirror.signal(cm, "hintShowed");
// If we're at the edge of the screen, then we want the menu to appear on the left of the cursor.
var winW = window.innerWidth || Math.max(document.body.offsetWidth, document.documentElement.offsetWidth);
......@@ -154,6 +155,7 @@ CodeMirror.showHint = function(cm, getHints, options) {
cm.off("focus", onFocus);
cm.off("scroll", onScroll);
if (willContinue !== true && data.onClose) data.onClose();
CodeMirror.signal(cm, "hintClosed");
}
function pick() {
pickCompletion(cm, data, completions[selectedHint]);
......
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