aboutsummaryrefslogtreecommitdiffstats
path: root/copy.js
diff options
context:
space:
mode:
Diffstat (limited to 'copy.js')
-rw-r--r--copy.js6
1 files changed, 1 insertions, 5 deletions
diff --git a/copy.js b/copy.js
index 0934b38..e8b642e 100644
--- a/copy.js
+++ b/copy.js
@@ -94,11 +94,7 @@ commands.addUserCommand(['copy'],'Copy to clipboard',
if (!context.filter){ context.completions = templates; return; }
var candidates = [];
var filter = context.filter.toLowerCase();
- templates.forEach(function(template){
- if (template[0].toLowerCase().indexOf(filter) == 0)
- candidates.push(template);
- });
- context.completions = candidates;
+ context.completions = templates.filter(function(template) template[0].toLowerCase().indexOf(filter) == 0);
},
bang: true
}