fix infinite loop when inserting snippet with self referencing tabstop

fixes #1802
This commit is contained in:
nightwing 2014-02-06 00:13:52 +04:00
commit 4795261b94

View file

@ -329,8 +329,11 @@ var SnippetManager = function() {
continue;
var id = p.tabstopId;
var i1 = tokens.indexOf(p, i + 1);
if (expanding[id] == p) {
expanding[id] = null;
if (expanding[id]) {
// if reached closing bracket clear expanding state
if (expanding[id] === p)
expanding[id] = null;
// otherwise just ignore recursive tabstop
continue;
}