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

[show-hint addon] Fix scrollbar on hint widget overlapping text

parent 320b301b
No related branches found
No related tags found
Loading
......@@ -26,7 +26,6 @@
padding: 0 4px;
border-radius: 2px;
max-width: 19em;
overflow: hidden;
white-space: pre;
color: black;
cursor: pointer;
......
......@@ -229,6 +229,7 @@
var winH = window.innerHeight || Math.max(document.body.offsetHeight, document.documentElement.offsetHeight);
(completion.options.container || document.body).appendChild(hints);
var box = hints.getBoundingClientRect(), overlapY = box.bottom - winH;
var scrolls = hints.scrollHeight > hints.clientHeight + 1
if (overlapY > 0) {
var height = box.bottom - box.top, curTop = pos.top - (pos.bottom - box.top);
if (curTop - height > 0) { // Fits above cursor
......@@ -253,6 +254,7 @@
}
hints.style.left = (left = pos.left - overlapX) + "px";
}
if (scrolls) hints.style.paddingRight = cm.display.nativeBarWidth + "px"
cm.addKeyMap(this.keyMap = buildKeyMap(completion, {
moveFocus: function(n, avoidWrap) { widget.changeActive(widget.selectedHint + n, avoidWrap); },
......
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