Skip to content

Commit 9c349a5

Browse files
aslushnikovmarijnh
authored andcommitted
show-hint addon to emit "hintShowed" and "hintClosed" events
1 parent 5a0e4ee commit 9c349a5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

addon/hint/show-hint.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ CodeMirror.showHint = function(cm, getHints, options) {
5050
hints.style.left = left + "px";
5151
hints.style.top = top + "px";
5252
document.body.appendChild(hints);
53+
CodeMirror.signal(cm, "hintShowed");
5354

5455
// If we're at the edge of the screen, then we want the menu to appear on the left of the cursor.
5556
var winW = window.innerWidth || Math.max(document.body.offsetWidth, document.documentElement.offsetWidth);
@@ -154,6 +155,7 @@ CodeMirror.showHint = function(cm, getHints, options) {
154155
cm.off("focus", onFocus);
155156
cm.off("scroll", onScroll);
156157
if (willContinue !== true && data.onClose) data.onClose();
158+
CodeMirror.signal(cm, "hintClosed");
157159
}
158160
function pick() {
159161
pickCompletion(cm, data, completions[selectedHint]);

0 commit comments

Comments
 (0)