summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/assets/javascripts/gfm_auto_complete.js3
1 files changed, 1 insertions, 2 deletions
diff --git a/app/assets/javascripts/gfm_auto_complete.js b/app/assets/javascripts/gfm_auto_complete.js
index e92cb7c7f27..b308cd9c236 100644
--- a/app/assets/javascripts/gfm_auto_complete.js
+++ b/app/assets/javascripts/gfm_auto_complete.js
@@ -375,8 +375,7 @@ class GfmAutoComplete {
// Do not match if there is no `~` before the cursor
return null;
}
- const candidateMatches = subtext.split(flag);
- const lastCandidate = candidateMatches[candidateMatches.length - 1];
+ const lastCandidate = subtext.split(flag).pop();
if (labels.find(label => label.title.startsWith(lastCandidate))) {
return lastCandidate;
}