cursor on the right side of the screen should be visible
This commit is contained in:
parent
d776e30935
commit
6be525c3f8
1 changed files with 5 additions and 8 deletions
|
|
@ -425,8 +425,7 @@ var VirtualRenderer = function(container, theme) {
|
||||||
var offset = this.scrollTop % this.lineHeight;
|
var offset = this.scrollTop % this.lineHeight;
|
||||||
var minHeight = this.$size.scrollerHeight + this.lineHeight;
|
var minHeight = this.$size.scrollerHeight + this.lineHeight;
|
||||||
|
|
||||||
// Add some space for the cursor itself plus some cursor padding
|
var longestLine = this.$getLongestLine();
|
||||||
var longestLine = this.$getLongestLine() + this.$cursorPadding + 3;
|
|
||||||
var widthChanged = !this.layerConfig ? true : (this.layerConfig.width != longestLine);
|
var widthChanged = !this.layerConfig ? true : (this.layerConfig.width != longestLine);
|
||||||
|
|
||||||
var lineCount = Math.ceil(minHeight / this.lineHeight) - 1;
|
var lineCount = Math.ceil(minHeight / this.lineHeight) - 1;
|
||||||
|
|
@ -491,7 +490,7 @@ var VirtualRenderer = function(container, theme) {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.$getLongestLine = function() {
|
this.$getLongestLine = function() {
|
||||||
var charCount = this.session.getScreenWidth();
|
var charCount = this.session.getScreenWidth() + 1;
|
||||||
if (this.$textLayer.showInvisibles)
|
if (this.$textLayer.showInvisibles)
|
||||||
charCount += 1;
|
charCount += 1;
|
||||||
|
|
||||||
|
|
@ -561,14 +560,12 @@ var VirtualRenderer = function(container, theme) {
|
||||||
this.scrollToX(left);
|
this.scrollToX(left);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.scroller.scrollLeft + this.$size.scrollerWidth < left
|
if (this.scroller.scrollLeft + this.$size.scrollerWidth < left + this.characterWidth) {
|
||||||
+ this.characterWidth + this.$cursorPadding) {
|
|
||||||
|
|
||||||
if (left + this.characterWidth + this.$cursorPadding > this.scroller.scrollWidth)
|
if (left + this.characterWidth > this.scroller.scrollWidth)
|
||||||
this.$renderChanges(this.CHANGE_SIZE);
|
this.$renderChanges(this.CHANGE_SIZE);
|
||||||
|
|
||||||
this.scrollToX(Math.round(left + this.characterWidth + this.$cursorPadding
|
this.scrollToX(Math.round(left + this.characterWidth - this.$size.scrollerWidth));
|
||||||
- this.$size.scrollerWidth));
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue