diff options
author | Wu Cheng-Han | 2016-10-10 21:15:29 +0800 |
---|---|---|
committer | Wu Cheng-Han | 2016-10-10 21:15:29 +0800 |
commit | 795ea21191486a80437d7c535defc503962c5968 (patch) | |
tree | 434a65ec986264b2abdec29b8f6a837ca536d2dd /public/vendor/codemirror/mode/erlang | |
parent | fb5d7e43592c1a14831067e28def9c4b9e2a97ca (diff) |
Update CodeMirror to 5.19.0 and rename jade to pug
Diffstat (limited to 'public/vendor/codemirror/mode/erlang')
-rw-r--r-- | public/vendor/codemirror/mode/erlang/erlang.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/public/vendor/codemirror/mode/erlang/erlang.js b/public/vendor/codemirror/mode/erlang/erlang.js index 5aed76a5..9528e19f 100644 --- a/public/vendor/codemirror/mode/erlang/erlang.js +++ b/public/vendor/codemirror/mode/erlang/erlang.js @@ -433,15 +433,16 @@ CodeMirror.defineMode("erlang", function(cmCfg) { } function maybe_drop_post(s) { + if (!s.length) return s var last = s.length-1; if (s[last].type === "dot") { return []; } - if (s[last].type === "fun" && s[last-1].token === "fun") { + if (last > 1 && s[last].type === "fun" && s[last-1].token === "fun") { return s.slice(0,last-1); } - switch (s[s.length-1].token) { + switch (s[last].token) { case "}": return d(s,{g:["{"]}); case "]": return d(s,{i:["["]}); case ")": return d(s,{i:["("]}); |