From f781001280777596c8a9877979a09660a2756489 Mon Sep 17 00:00:00 2001 From: James Allen Date: Wed, 5 Mar 2014 11:16:33 +0000 Subject: [PATCH] Don't return current prefix in auto-complete list --- .../auto-complete/SuggestionManager.coffee | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/services/web/public/coffee/auto-complete/SuggestionManager.coffee b/services/web/public/coffee/auto-complete/SuggestionManager.coffee index 675509fdf6..559a2c5981 100644 --- a/services/web/public/coffee/auto-complete/SuggestionManager.coffee +++ b/services/web/public/coffee/auto-complete/SuggestionManager.coffee @@ -1,6 +1,4 @@ -define [ - "auto-complete/commands" -], (commands) -> +define [], () -> class Parser constructor: (@doc) -> @@ -70,7 +68,7 @@ define [ doc = session.getValue() parser = new Parser(doc) commands = parser.parse() - + completions = [] for command in commands caption = "\\#{command[0]}" @@ -84,12 +82,12 @@ define [ snippet += "{${#{i}}}" caption += "{}" i++ - - completions.push { - caption: caption - snippet: snippet - meta: "cmd" - } + unless caption == prefix + completions.push { + caption: caption + snippet: snippet + meta: "cmd" + } callback null, completions