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