Skip to content

Commit 0a88b8c

Browse files
committed
fix bug in show-hints inset
1 parent 1df33b7 commit 0a88b8c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

addon/hint/show-hint.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@
255255
}
256256

257257
var container = completion.options.container || ownerDocument.body;
258+
var marginBottom = completion.options.marginBottom || 0;
258259
var pos = cm.cursorCoords(completion.options.alignWithWord ? data.from : null);
259260
var left = pos.left, top = pos.bottom, below = true;
260261
var offsetLeft = 0, offsetTop = 0;
@@ -285,12 +286,12 @@
285286
var startScroll;
286287
setTimeout(function() { startScroll = cm.getScrollInfo(); });
287288

288-
var overlapY = box.bottom - winH;
289+
var overlapY = box.bottom + marginBottom - winH;
289290
if (overlapY > 0) { // Does not fit below
290291
var height = box.bottom - box.top, spaceAbove = box.top - (pos.bottom - pos.top) - 2
291292
if (winH - box.top < spaceAbove) { // More room at the top
292293
if (height > spaceAbove) hints.style.height = (height = spaceAbove) + "px";
293-
hints.style.top = ((top = pos.top - height) + offsetTop) + "px";
294+
hints.style.top = (top = pos.top - height) - offsetTop + "px";
294295
below = false;
295296
} else {
296297
hints.style.height = (winH - box.top - 2) + "px";

0 commit comments

Comments
 (0)