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 minHeight = this.$size.scrollerHeight + this.lineHeight;
|
||||
|
||||
// Add some space for the cursor itself plus some cursor padding
|
||||
var longestLine = this.$getLongestLine() + this.$cursorPadding + 3;
|
||||
var longestLine = this.$getLongestLine();
|
||||
var widthChanged = !this.layerConfig ? true : (this.layerConfig.width != longestLine);
|
||||
|
||||
var lineCount = Math.ceil(minHeight / this.lineHeight) - 1;
|
||||
|
|
@ -491,7 +490,7 @@ var VirtualRenderer = function(container, theme) {
|
|||
};
|
||||
|
||||
this.$getLongestLine = function() {
|
||||
var charCount = this.session.getScreenWidth();
|
||||
var charCount = this.session.getScreenWidth() + 1;
|
||||
if (this.$textLayer.showInvisibles)
|
||||
charCount += 1;
|
||||
|
||||
|
|
@ -561,14 +560,12 @@ var VirtualRenderer = function(container, theme) {
|
|||
this.scrollToX(left);
|
||||
}
|
||||
|
||||
if (this.scroller.scrollLeft + this.$size.scrollerWidth < left
|
||||
+ this.characterWidth + this.$cursorPadding) {
|
||||
if (this.scroller.scrollLeft + this.$size.scrollerWidth < left + this.characterWidth) {
|
||||
|
||||
if (left + this.characterWidth + this.$cursorPadding > this.scroller.scrollWidth)
|
||||
if (left + this.characterWidth > this.scroller.scrollWidth)
|
||||
this.$renderChanges(this.CHANGE_SIZE);
|
||||
|
||||
this.scrollToX(Math.round(left + this.characterWidth + this.$cursorPadding
|
||||
- this.$size.scrollerWidth));
|
||||
this.scrollToX(Math.round(left + this.characterWidth - this.$size.scrollerWidth));
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue