explicitly update cursor on enter
This commit is contained in:
parent
8e3c1e6096
commit
537209da57
1 changed files with 3 additions and 1 deletions
|
|
@ -427,16 +427,18 @@ var Editor =function(renderer, session) {
|
||||||
var lineIndent = this.mode.getNextLineIndent(lineState, line.slice(0, cursor.column), this.session.getTabString());
|
var lineIndent = this.mode.getNextLineIndent(lineState, line.slice(0, cursor.column), this.session.getTabString());
|
||||||
var end = this.session.insert(cursor, text);
|
var end = this.session.insert(cursor, text);
|
||||||
|
|
||||||
this.moveCursorToPosition(end);
|
|
||||||
|
|
||||||
var lineState = this.bgTokenizer.getState(cursor.row);
|
var lineState = this.bgTokenizer.getState(cursor.row);
|
||||||
// TODO disabled multiline auto indent
|
// TODO disabled multiline auto indent
|
||||||
// possibly doing the indent before inserting the text
|
// possibly doing the indent before inserting the text
|
||||||
// if (cursor.row !== end.row) {
|
// if (cursor.row !== end.row) {
|
||||||
if (this.session.getDocument().isNewLine(text)) {
|
if (this.session.getDocument().isNewLine(text)) {
|
||||||
|
this.moveCursorTo(cursor.row+1, 0);
|
||||||
|
|
||||||
var size = this.session.getTabSize(),
|
var size = this.session.getTabSize(),
|
||||||
minIndent = Number.MAX_VALUE;
|
minIndent = Number.MAX_VALUE;
|
||||||
|
|
||||||
|
|
||||||
for (var row = cursor.row + 1; row <= end.row; ++row) {
|
for (var row = cursor.row + 1; row <= end.row; ++row) {
|
||||||
var indent = 0;
|
var indent = 0;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue