add alignCursor to virtual_renderer
This commit is contained in:
parent
f9c8f7c11b
commit
0c7b310ecc
1 changed files with 10 additions and 0 deletions
|
|
@ -1011,6 +1011,16 @@ var VirtualRenderer = function(container, theme) {
|
||||||
this.session.setScrollTop(row * this.lineHeight);
|
this.session.setScrollTop(row * this.lineHeight);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.alignCursor = function(cursor, alignment) {
|
||||||
|
if (typeof cursor == "number")
|
||||||
|
cursor = {row: cursor, column: 0};
|
||||||
|
|
||||||
|
var pos = this.$cursorLayer.getPixelPosition(cursor);
|
||||||
|
var offset = pos.top - this.$size.scrollerHeight * (alignment || 0);
|
||||||
|
|
||||||
|
this.session.setScrollTop(offset);
|
||||||
|
};
|
||||||
|
|
||||||
this.STEPS = 8;
|
this.STEPS = 8;
|
||||||
this.$calcSteps = function(fromValue, toValue){
|
this.$calcSteps = function(fromValue, toValue){
|
||||||
var i = 0;
|
var i = 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue