remove references to session
This commit is contained in:
parent
421e19ed78
commit
3c192c970b
4 changed files with 8 additions and 23 deletions
|
|
@ -57,10 +57,6 @@ var Cursor = function(model, parentEl) {
|
|||
|
||||
(function() {
|
||||
|
||||
this.setSession = function(session) {
|
||||
this.session = session;
|
||||
};
|
||||
|
||||
this.hideCursor = function() {
|
||||
this.isVisible = false;
|
||||
dom.addCssClass(this.cursor, "ace_hidden");
|
||||
|
|
@ -97,7 +93,7 @@ var Cursor = function(model, parentEl) {
|
|||
this.cursor.style.width = config.characterWidth + "px";
|
||||
this.cursor.style.height = config.lineHeight + "px";
|
||||
|
||||
var overwrite = this.session.getOverwrite()
|
||||
var overwrite = this.model.buffer.getOverwrite()
|
||||
if (overwrite != this.overwrite) {
|
||||
this.overwrite = overwrite;
|
||||
if (overwrite)
|
||||
|
|
|
|||
|
|
@ -55,10 +55,6 @@ var Gutter = function(model, parentEl) {
|
|||
|
||||
(function() {
|
||||
|
||||
this.setSession = function(session) {
|
||||
this.session = session;
|
||||
};
|
||||
|
||||
this.addGutterDecoration = function(row, className){
|
||||
if (!this.$decorations[row])
|
||||
this.$decorations[row] = "";
|
||||
|
|
@ -105,13 +101,14 @@ var Gutter = function(model, parentEl) {
|
|||
var html = [];
|
||||
var i = config.firstRow;
|
||||
var lastRow = config.lastRow;
|
||||
var fold = this.session.getNextFold(i);
|
||||
var buffer = this.model.buffer;
|
||||
var fold = buffer.getNextFold(i);
|
||||
var foldStart = fold ? fold.start.row : Infinity;
|
||||
|
||||
while (true) {
|
||||
if(i > foldStart) {
|
||||
i = fold.end.row + 1;
|
||||
fold = this.session.getNextFold(i);
|
||||
fold = buffer.getNextFold(i);
|
||||
foldStart = fold ?fold.start.row :Infinity;
|
||||
}
|
||||
if(i > lastRow)
|
||||
|
|
@ -125,7 +122,7 @@ var Gutter = function(model, parentEl) {
|
|||
"' title='", annotation.text.join("\n"),
|
||||
"' style='height:", config.lineHeight, "px;'>", (i+1));
|
||||
|
||||
var wrappedRowLength = this.session.getRowLength(i) - 1;
|
||||
var wrappedRowLength = buffer.getRowLength(i) - 1;
|
||||
while (wrappedRowLength--) {
|
||||
html.push("</div><div class='ace_gutter-cell' style='height:", config.lineHeight, "px'>¦</div>");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,10 +51,6 @@ var Marker = function(model, parentEl) {
|
|||
};
|
||||
|
||||
(function() {
|
||||
|
||||
this.setSession = function(session) {
|
||||
this.session = session;
|
||||
};
|
||||
|
||||
this.setMarkers = function(markers) {
|
||||
this.markers = markers;
|
||||
|
|
@ -75,7 +71,7 @@ var Marker = function(model, parentEl) {
|
|||
var range = marker.range.clipRows(config.firstRow, config.lastRow);
|
||||
if (range.isEmpty()) continue;
|
||||
|
||||
range = range.toScreenRange(this.session);
|
||||
range = range.toScreenRange(this.model.buffer);
|
||||
if (marker.renderer) {
|
||||
var top = this.$getTop(range.start.row, config);
|
||||
var left = Math.round(
|
||||
|
|
@ -116,7 +112,7 @@ var Marker = function(model, parentEl) {
|
|||
|
||||
var lineRange = new Range(
|
||||
row, range.start.column,
|
||||
row, this.session.getScreenLastRowColumn(row)
|
||||
row, this.model.buffer.getScreenLastRowColumn(row)
|
||||
);
|
||||
this.drawSingleLineMarker(stringBuilder, lineRange, clazz, layerConfig, 1, "text");
|
||||
|
||||
|
|
@ -128,7 +124,7 @@ var Marker = function(model, parentEl) {
|
|||
for (row = range.start.row + 1; row < range.end.row; row++) {
|
||||
lineRange.start.row = row;
|
||||
lineRange.end.row = row;
|
||||
lineRange.end.column = this.session.getScreenLastRowColumn(row);
|
||||
lineRange.end.column = this.model.buffer.getScreenLastRowColumn(row);
|
||||
this.drawSingleLineMarker(stringBuilder, lineRange, clazz, layerConfig, 1, "text");
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -130,10 +130,6 @@ var WindowView = function(windowModel, container) {
|
|||
|
||||
this.setSession = function(session) {
|
||||
this.session = session;
|
||||
this.$cursorLayer.setSession(session);
|
||||
this.$markerBack.setSession(session);
|
||||
this.$markerFront.setSession(session);
|
||||
this.$gutterLayer.setSession(session);
|
||||
this.$textLayer.setSession(session);
|
||||
this.$loop.schedule(this.CHANGE_FULL);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue