Show More
@@ -1,5 +1,5 b'' | |||
|
1 | 1 | // highly adapted for codemiror jshint |
|
2 | (function() { | |
|
2 | (function () { | |
|
3 | 3 | "use strict"; |
|
4 | 4 | |
|
5 | 5 | function forEach(arr, f) { |
@@ -19,7 +19,7 b'' | |||
|
19 | 19 | return arr.indexOf(item) != -1; |
|
20 | 20 | } |
|
21 | 21 | |
|
22 | CodeMirror.contextHint = function(editor) { | |
|
22 | CodeMirror.contextHint = function (editor) { | |
|
23 | 23 | // Find the token at the cursor |
|
24 | 24 | var cur = editor.getCursor(), |
|
25 | 25 | token = editor.getTokenAt(cur), |
@@ -46,7 +46,7 b'' | |||
|
46 | 46 | } |
|
47 | 47 | |
|
48 | 48 | // find all 'words' of current cell |
|
49 | var getAllTokens = function(editor) { | |
|
49 | var getAllTokens = function (editor) { | |
|
50 | 50 | var found = []; |
|
51 | 51 | |
|
52 | 52 | // add to found if not already in it |
@@ -85,7 +85,7 b'' | |||
|
85 | 85 | function getCompletions(token, editor) { |
|
86 | 86 | var candidates = getAllTokens(editor); |
|
87 | 87 | // filter all token that have a common start (but nox exactly) the lenght of the current token |
|
88 | var lambda = function(x) { | |
|
88 | var lambda = function (x) { | |
|
89 | 89 | return (x.indexOf(token.string) == 0 && x != token.string) |
|
90 | 90 | }; |
|
91 | 91 | var filterd = candidates.filter(lambda); |
General Comments 0
You need to be logged in to leave comments.
Login now