do not round mouse position since lines can have fractional screen coordinates now

This commit is contained in:
nightwing
2013-11-13 03:04:56 +04:00
parent 48a44aab5a
commit 753dbbece5
2 changed files with 7 additions and 4 deletions

View File

@@ -2187,7 +2187,7 @@ var EditSession = function(text, mode) {
while (row <= screenRow) {
rowLength = this.getRowLength(docRow);
if (row + rowLength - 1 >= screenRow || docRow >= maxRow) {
if (row + rowLength > screenRow || docRow >= maxRow) {
break;
} else {
row += rowLength;
@@ -2222,9 +2222,10 @@ var EditSession = function(text, mode) {
if (this.$useWrapMode) {
var splits = this.$wrapData[docRow];
if (splits) {
column = splits[screenRow - row];
if(screenRow > row && splits.length) {
docColumn = splits[screenRow - row - 1] || splits[splits.length - 1];
var splitIndex = Math.floor(screenRow - row);
column = splits[splitIndex];
if(splitIndex > 0 && splits.length) {
docColumn = splits[splitIndex - 1] || splits[splits.length - 1];
line = line.substring(docColumn);
}
}

View File

@@ -627,6 +627,8 @@ function Folding() {
if (depth == undefined)
depth = 100000; // JSON.stringify doesn't hanle Infinity
var foldWidgets = this.foldWidgets;
if (!foldWidgets)
return; // mode doesn't support folding
endRow = endRow || this.getLength();
startRow = startRow || 0;
for (var row = startRow; row < endRow; row++) {