explicitly update cursor on enter

This commit is contained in:
Fabian Jakobs 2011-02-17 18:00:57 +01:00
commit 537209da57

View file

@ -427,16 +427,18 @@ var Editor =function(renderer, session) {
var lineIndent = this.mode.getNextLineIndent(lineState, line.slice(0, cursor.column), this.session.getTabString());
var end = this.session.insert(cursor, text);
this.moveCursorToPosition(end);
var lineState = this.bgTokenizer.getState(cursor.row);
// TODO disabled multiline auto indent
// possibly doing the indent before inserting the text
// if (cursor.row !== end.row) {
if (this.session.getDocument().isNewLine(text)) {
this.moveCursorTo(cursor.row+1, 0);
var size = this.session.getTabSize(),
minIndent = Number.MAX_VALUE;
for (var row = cursor.row + 1; row <= end.row; ++row) {
var indent = 0;