diff options
author | Wu Cheng-Han | 2016-01-17 14:28:04 -0600 |
---|---|---|
committer | Wu Cheng-Han | 2016-01-17 14:28:04 -0600 |
commit | eaa8ccaccb1091820d0a8d1223996a6dd057347d (patch) | |
tree | 6b4aaa3b3d1a2fed68147510142663222533775a /public/vendor/codemirror/addon/tern | |
parent | ce65e58096d57ace02723d11a125673f9d48c293 (diff) |
Upgrade CodeMirror to 5.10.1 and now support fullscreen, jump-to-line in editor
Diffstat (limited to 'public/vendor/codemirror/addon/tern')
-rw-r--r--[-rwxr-xr-x] | public/vendor/codemirror/addon/tern/tern.css | 1 | ||||
-rw-r--r--[-rwxr-xr-x] | public/vendor/codemirror/addon/tern/tern.js | 14 | ||||
-rw-r--r--[-rwxr-xr-x] | public/vendor/codemirror/addon/tern/worker.js | 0 |
3 files changed, 9 insertions, 6 deletions
diff --git a/public/vendor/codemirror/addon/tern/tern.css b/public/vendor/codemirror/addon/tern/tern.css index 76fba33d..c4b8a2f7 100755..100644 --- a/public/vendor/codemirror/addon/tern/tern.css +++ b/public/vendor/codemirror/addon/tern/tern.css @@ -1,6 +1,7 @@ .CodeMirror-Tern-completion { padding-left: 22px; position: relative; + line-height: 1.5; } .CodeMirror-Tern-completion:before { position: absolute; diff --git a/public/vendor/codemirror/addon/tern/tern.js b/public/vendor/codemirror/addon/tern/tern.js index dfb19b84..c345c497 100755..100644 --- a/public/vendor/codemirror/addon/tern/tern.js +++ b/public/vendor/codemirror/addon/tern/tern.js @@ -135,6 +135,7 @@ }, destroy: function () { + closeArgHints(this) if (this.worker) { this.worker.terminate(); this.worker = null; @@ -216,7 +217,7 @@ var completion = data.completions[i], className = typeToIcon(completion.type); if (data.guess) className += " " + cls + "guess"; completions.push({text: completion.name + after, - displayText: completion.name, + displayText: completion.displayName || completion.name, className: className, data: completion}); } @@ -266,7 +267,7 @@ child.target = "_blank"; } } - tempTooltip(cm, tip); + tempTooltip(cm, tip, ts); if (c) c(); }, pos); } @@ -466,11 +467,12 @@ ts.request(cm, {type: "refs"}, function(error, data) { if (error) return showError(ts, cm, error); var ranges = [], cur = 0; + var curPos = cm.getCursor(); for (var i = 0; i < data.refs.length; i++) { var ref = data.refs[i]; if (ref.file == name) { ranges.push({anchor: ref.start, head: ref.end}); - if (cmpPos(cur, ref.start) >= 0 && cmpPos(cur, ref.end) <= 0) + if (cmpPos(curPos, ref.start) >= 0 && cmpPos(curPos, ref.end) <= 0) cur = ranges.length - 1; } } @@ -592,7 +594,7 @@ // Tooltips - function tempTooltip(cm, content) { + function tempTooltip(cm, content, ts) { if (cm.state.ternTooltip) remove(cm.state.ternTooltip); var where = cm.cursorCoords(); var tip = cm.state.ternTooltip = makeTooltip(where.right + 1, where.bottom, content); @@ -616,7 +618,7 @@ else mouseOnTip = false; } }); - setTimeout(maybeClear, 1700); + setTimeout(maybeClear, ts.options.hintDelay ? ts.options.hintDelay : 1700); cm.on("cursorActivity", clear); cm.on('blur', clear); cm.on('scroll', clear); @@ -644,7 +646,7 @@ if (ts.options.showError) ts.options.showError(cm, msg); else - tempTooltip(cm, String(msg)); + tempTooltip(cm, String(msg), ts); } function closeArgHints(ts) { diff --git a/public/vendor/codemirror/addon/tern/worker.js b/public/vendor/codemirror/addon/tern/worker.js index 887f906a..887f906a 100755..100644 --- a/public/vendor/codemirror/addon/tern/worker.js +++ b/public/vendor/codemirror/addon/tern/worker.js |