fix scrollToLine for sessions containing folds
This commit is contained in:
parent
57bb9f767c
commit
35aecf42af
3 changed files with 9 additions and 13 deletions
|
|
@ -93,7 +93,7 @@ var Cursor = function(parentEl) {
|
|||
}, 1000);
|
||||
};
|
||||
|
||||
this.getPixelPosition = function(onScreen) {
|
||||
this.getPixelPosition = function(position, onScreen) {
|
||||
if (!this.config || !this.session) {
|
||||
return {
|
||||
left : 0,
|
||||
|
|
@ -101,7 +101,8 @@ var Cursor = function(parentEl) {
|
|||
};
|
||||
}
|
||||
|
||||
var position = this.session.selection.getCursor();
|
||||
if (!position)
|
||||
position = this.session.selection.getCursor();
|
||||
var pos = this.session.documentToScreenPosition(position);
|
||||
var cursorLeft = Math.round(this.$padding +
|
||||
pos.column * this.config.characterWidth);
|
||||
|
|
@ -117,7 +118,7 @@ var Cursor = function(parentEl) {
|
|||
this.update = function(config) {
|
||||
this.config = config;
|
||||
|
||||
this.pixelPos = this.getPixelPosition(true);
|
||||
this.pixelPos = this.getPixelPosition(null, true);
|
||||
|
||||
this.cursor.style.left = this.pixelPos.left + "px";
|
||||
this.cursor.style.top = this.pixelPos.top + "px";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue