From c9cda16a5e894f4a70e111aca251d5b7566dd6f4 Mon Sep 17 00:00:00 2001 From: Shane Kilkelly Date: Thu, 29 Jun 2017 11:13:59 +0100 Subject: [PATCH] Refactor score calculation --- .../aceEditor/auto-complete/SuggestionManager.coffee | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/SuggestionManager.coffee b/services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/SuggestionManager.coffee index bb15035b44..58d53db475 100644 --- a/services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/SuggestionManager.coffee +++ b/services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/SuggestionManager.coffee @@ -83,6 +83,7 @@ define [], () -> completions = [] for command in commands caption = "\\#{command[0]}" + score = if prefix == caption then 99 else 50 snippet = caption i = 1 _.times command[1], () -> @@ -97,7 +98,7 @@ define [], () -> caption: caption snippet: snippet meta: "cmd" - score: if prefix == caption then 99 else 50 + score: score } callback null, completions