aboutsummaryrefslogtreecommitdiffstats
path: root/refe.js
diff options
context:
space:
mode:
Diffstat (limited to 'refe.js')
-rw-r--r--refe.js49
1 files changed, 26 insertions, 23 deletions
diff --git a/refe.js b/refe.js
index 43be175..4a289ad 100644
--- a/refe.js
+++ b/refe.js
@@ -110,29 +110,32 @@ let INFO = xml`
},
{
literal: 0,
- completer: let (getter) function (context, args) {
- function setCompletions (context, word) {
- getList(
- word,
- function (list) {
- context.incomplete = false;
- context.completions = list;
- }
- );
- }
-
- let word = args.literalArg;
-
- if (word.length <= 2)
- return;
-
- context.incomplete = true;
- context.filters = [CompletionContext.Filter.textDescription];
-
- if (getter)
- clearTimeout(getter);
- getter = setTimeout(setCompletions.bind(null, context, word), 1000);
- }
+ completer: (function (){
+ let getter;
+ return function (context, args) {
+ function setCompletions (context, word) {
+ getList(
+ word,
+ function (list) {
+ context.incomplete = false;
+ context.completions = list;
+ }
+ );
+ }
+
+ let word = args.literalArg;
+
+ if (word.length <= 2)
+ return;
+
+ context.incomplete = true;
+ context.filters = [CompletionContext.Filter.textDescription];
+
+ if (getter)
+ clearTimeout(getter);
+ getter = setTimeout(setCompletions.bind(null, context, word), 1000);
+ };
+ })()
},
true
);