Avoid getitng null token at end of line

This commit is contained in:
Lennart Kats 2012-10-25 13:28:42 +02:00 committed by nightwing
commit b2ce75f95b

View file

@ -48,8 +48,8 @@ var CstyleBehaviour = function () {
// Don't insert in the middle of a keyword/identifier/lexical
if (!this.$matchTokenType(iterator.getCurrentToken() || "text", ["text", "paren.rparen"])) {
// Look ahead in case we're at the end of a token
iterator = new TokenIterator(session, cursor.row, cursor.column + 1);
if (!this.$matchTokenType(iterator.getCurrentToken() || "text", ["text", "paren.rparen"]))
var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1);
if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", ["text", "paren.rparen"]))
return false;
}