diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js index 0d5260668..4ae98080e 100644 --- a/src/static/js/ace2_inner.js +++ b/src/static/js/ace2_inner.js @@ -3742,6 +3742,7 @@ function Ace2Inner(){ if(caretOffsetTop){ // sometimes caretOffsetTop bugs out and returns 0, not sure why, possible Chrome bug? Either way if it does we don't wanna mess with it var lineNum = Math.round(caretOffsetTop / lineHeight) ; // Get the current Line Number IE 84 + newVisibleLineRange[1] = newVisibleLineRange[1]-1; var caretIsVisible = (lineNum > newVisibleLineRange[0] && lineNum < newVisibleLineRange[1]); // Is the cursor in the visible Range IE ie 84 > 14 and 84 < 90? if(!caretIsVisible){ // is the cursor no longer visible to the user? // Oh boy the caret is out of the visible area, I need to scroll the browser window to lineNum. @@ -3749,7 +3750,7 @@ function Ace2Inner(){ if(evt.which == 37 || evt.which == 38){ // If left or up var newY = lineHeight * (lineNum -1); // -1 to go to the line above }else if(evt.which == 39 || evt.which == 40){ // if down or right - var newY = caretOffsetTop + lineHeight; // the offset and one additional line + var newY = getScrollY() + (lineHeight*3); // the offset and one additional line } setScrollY(newY); // set the scroll height of the browser }