Remove EditSession.getScreenFirstRowColumn() func and clean up a little bit

This commit is contained in:
Julian Viereck 2011-04-25 00:10:38 +02:00
commit 145030972c
3 changed files with 2 additions and 22 deletions

View file

@ -1092,26 +1092,10 @@ var EditSession = function(text, mode) {
};
this.getDocumentLastRowColumn = function(docRow, docColumn) {
if (!this.$useWrapMode) {
return this.getLine(docRow).length;
}
var screenRow = this.documentToScreenRow(docRow, docColumn);
return this.getScreenLastRowColumn(screenRow, true);
}
this.getScreenFirstRowColumn = function(screenRow) {
if (!this.$useWrapMode) {
return 0;
}
var rowData = this.$screenToDocumentRow(screenRow);
var docRow = rowData[0],
row = rowData[1];
return this.$wrapData[docRow][row - 1] || 0;
};
this.getRowSplitData = function(row) {
if (!this.$useWrapMode) {
return undefined;
@ -1213,10 +1197,6 @@ var EditSession = function(text, mode) {
}
this.screenToDocumentRow = function(screenRow, screenColumn) {
if (screenColumn == null) {
screenColumn = 0;
// throw "Need to pass in screenColumn";
}
return this.screenToDocumentPosition(screenRow, screenColumn).row;
};

View file

@ -306,7 +306,7 @@ var Selection = function(session) {
var row = this.selectionLead.row;
var column = this.selectionLead.column;
var screenRow = this.session.documentToScreenRow(row, column);
var firstRowColumn = this.session.getScreenFirstRowColumn(screenRow);
var firstRowColumn = this.session.screenToDocumentColumn(screenRow, 0)
var beforeCursor = this.doc.getLine(row).slice(firstRowColumn, column);
var leadingSpace = beforeCursor.match(/^\s*/);
if (leadingSpace[0].length == 0) {

View file

@ -481,7 +481,7 @@ var VirtualRenderer = function(container, theme) {
firstRowScreen = session.documentToScreenRow(firstRow);
firstRowHeight = session.getRowHeight(lineHeight, firstRow);
lastRow = Math.min(session.screenToDocumentRow(lastRow), session.getLength() - 1);
lastRow = Math.min(session.screenToDocumentRow(lastRow, 0), session.getLength() - 1);
minHeight = this.$size.scrollerHeight + session.getRowHeight(lineHeight, lastRow)+
firstRowHeight;