diff --git a/lib/ace/editor.js b/lib/ace/editor.js index 3bb2c0e4..5f9d10be 100644 --- a/lib/ace/editor.js +++ b/lib/ace/editor.js @@ -545,9 +545,12 @@ var Editor = function(renderer, session) { return; } - if (token.type.indexOf("tag-open") != -1) + if (token.type.indexOf("tag-open") != -1) { token = iterator.stepForward(); - + if (!token) + return; + } + var tag = token.value; var depth = 0; var prevToken = iterator.stepBackward();