Remove EditSession.getScreenFirstRowColumn() func and clean up a little bit
This commit is contained in:
parent
8c63cd7ff5
commit
145030972c
3 changed files with 2 additions and 22 deletions
|
|
@ -1092,26 +1092,10 @@ var EditSession = function(text, mode) {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.getDocumentLastRowColumn = function(docRow, docColumn) {
|
this.getDocumentLastRowColumn = function(docRow, docColumn) {
|
||||||
if (!this.$useWrapMode) {
|
|
||||||
return this.getLine(docRow).length;
|
|
||||||
}
|
|
||||||
|
|
||||||
var screenRow = this.documentToScreenRow(docRow, docColumn);
|
var screenRow = this.documentToScreenRow(docRow, docColumn);
|
||||||
return this.getScreenLastRowColumn(screenRow, true);
|
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) {
|
this.getRowSplitData = function(row) {
|
||||||
if (!this.$useWrapMode) {
|
if (!this.$useWrapMode) {
|
||||||
return undefined;
|
return undefined;
|
||||||
|
|
@ -1213,10 +1197,6 @@ var EditSession = function(text, mode) {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.screenToDocumentRow = function(screenRow, screenColumn) {
|
this.screenToDocumentRow = function(screenRow, screenColumn) {
|
||||||
if (screenColumn == null) {
|
|
||||||
screenColumn = 0;
|
|
||||||
// throw "Need to pass in screenColumn";
|
|
||||||
}
|
|
||||||
return this.screenToDocumentPosition(screenRow, screenColumn).row;
|
return this.screenToDocumentPosition(screenRow, screenColumn).row;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -306,7 +306,7 @@ var Selection = function(session) {
|
||||||
var row = this.selectionLead.row;
|
var row = this.selectionLead.row;
|
||||||
var column = this.selectionLead.column;
|
var column = this.selectionLead.column;
|
||||||
var screenRow = this.session.documentToScreenRow(row, 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 beforeCursor = this.doc.getLine(row).slice(firstRowColumn, column);
|
||||||
var leadingSpace = beforeCursor.match(/^\s*/);
|
var leadingSpace = beforeCursor.match(/^\s*/);
|
||||||
if (leadingSpace[0].length == 0) {
|
if (leadingSpace[0].length == 0) {
|
||||||
|
|
|
||||||
|
|
@ -481,7 +481,7 @@ var VirtualRenderer = function(container, theme) {
|
||||||
firstRowScreen = session.documentToScreenRow(firstRow);
|
firstRowScreen = session.documentToScreenRow(firstRow);
|
||||||
firstRowHeight = session.getRowHeight(lineHeight, 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)+
|
minHeight = this.$size.scrollerHeight + session.getRowHeight(lineHeight, lastRow)+
|
||||||
firstRowHeight;
|
firstRowHeight;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue