File tree Expand file tree Collapse file tree 2 files changed +8
-13
lines changed Expand file tree Collapse file tree 2 files changed +8
-13
lines changed Original file line number Diff line number Diff line change 19
19
20
20
max-height : 20em ;
21
21
overflow-y : auto;
22
+ box-sizing : border-box;
22
23
}
23
24
24
25
.CodeMirror-hint {
Original file line number Diff line number Diff line change 286
286
setTimeout ( function ( ) { startScroll = cm . getScrollInfo ( ) ; } ) ;
287
287
288
288
var overlapY = box . bottom - winH ;
289
- if ( overlapY > 0 ) {
290
- var height = box . bottom - box . top , curTop = pos . top - ( pos . bottom - box . top ) ;
291
- if ( curTop - height > 0 ) { // Fits above cursor
292
- hints . style . top = ( top = pos . top - height - offsetTop ) + "px" ;
289
+ if ( overlapY > 0 ) { // Does not fit below
290
+ var height = box . bottom - box . top , spaceAbove = box . top - ( pos . bottom - pos . top ) - 2
291
+ if ( winH - box . top < spaceAbove ) { // More room at the top
292
+ if ( height > spaceAbove ) hints . style . height = ( height = spaceAbove ) + "px" ;
293
+ hints . style . top = ( ( top = pos . top - height ) + offsetTop ) + "px" ;
293
294
below = false ;
294
- } else if ( height > winH ) {
295
- hints . style . height = ( winH - 5 ) + "px" ;
296
- hints . style . top = ( top = pos . bottom - box . top - offsetTop ) + "px" ;
297
- var cursor = cm . getCursor ( ) ;
298
- if ( data . from . ch != cursor . ch ) {
299
- pos = cm . cursorCoords ( cursor ) ;
300
- hints . style . left = ( left = pos . left - offsetLeft ) + "px" ;
301
- box = hints . getBoundingClientRect ( ) ;
302
- }
295
+ } else {
296
+ hints . style . height = ( winH - box . top - 2 ) + "px" ;
303
297
}
304
298
}
305
299
var overlapX = box . right - winW ;
You can’t perform that action at this time.
0 commit comments