mirror of
https://github.com/AdaCore/ace.git
synced 2026-02-12 13:03:02 -08:00
do not round mouse position since lines can have fractional screen coordinates now
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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++) {
|
||||
|
||||
Reference in New Issue
Block a user