diff --git a/addon/hint/show-hint.css b/addon/hint/show-hint.css index 924e638f7f..f3c4f245dd 100644 --- a/addon/hint/show-hint.css +++ b/addon/hint/show-hint.css @@ -26,7 +26,6 @@ padding: 0 4px; border-radius: 2px; max-width: 19em; - overflow: hidden; white-space: pre; color: black; cursor: pointer; diff --git a/addon/hint/show-hint.js b/addon/hint/show-hint.js index f426b5c8ca..cc47af206c 100644 --- a/addon/hint/show-hint.js +++ b/addon/hint/show-hint.js @@ -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); },