mirror of
https://github.com/slap-editor/slap.git
synced 2024-09-17 15:57:29 +03:00
Moved -1 inside Math.min
This commit is contained in:
parent
f1d61164b9
commit
9a4cf6dbfb
@ -632,8 +632,8 @@ Editor.prototype._clipCursorToContent = function (cursor) {
|
||||
var linesCount = self.textBuf.getLastRow();
|
||||
var lineLength = self.textBuf.lineLengthForRow(cursor.y);
|
||||
|
||||
cursor.y = Math.max(Math.min(cursor.y, linesCount) - 1, 0);
|
||||
cursor.x = Math.max(Math.min(cursor.x, lineLength) - 1, 0);
|
||||
cursor.y = Math.max(Math.min(cursor.y - 1, linesCount), 0);
|
||||
cursor.x = Math.max(Math.min(cursor.x - 1, lineLength), 0);
|
||||
|
||||
return cursor;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user