diff options
author | Phil Hughes <me@iamphill.com> | 2016-12-15 09:31:25 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2016-12-15 09:31:25 +0000 |
commit | 089dbc7db1d885a62d2022c0a696b26ad4ae0e17 (patch) | |
tree | ffd461ce8faea6e4d5c358014a70e5018b52af2f | |
parent | 48f24735a8190f72e9bfdeeccf982a38233efcd7 (diff) | |
download | gitlab-ce-089dbc7db1d885a62d2022c0a696b26ad4ae0e17.tar.gz |
Fixed bug with +1 not autocompletinggfm-autocomplete-char-in-middle
-rw-r--r-- | app/assets/javascripts/gfm_auto_complete.js.es6 | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/assets/javascripts/gfm_auto_complete.js.es6 b/app/assets/javascripts/gfm_auto_complete.js.es6 index 076475d3ed4..0e274521525 100644 --- a/app/assets/javascripts/gfm_auto_complete.js.es6 +++ b/app/assets/javascripts/gfm_auto_complete.js.es6 @@ -62,14 +62,15 @@ // The below is taken from At.js source // Tweaked to commands to start without a space only if char before is a non-word character // https://github.com/ichord/At.js - var _a, _y, regexp, match; + var _a, _y, regexp, match, atSymbols; + atSymbols = Object.keys(this.app.controllers).join('|'); subtext = subtext.split(' ').pop(); flag = flag.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); _a = decodeURI("%C3%80"); _y = decodeURI("%C3%BF"); - regexp = new RegExp("(?:\\B|\\W|\\s)" + flag + "(?!\\W)([A-Za-z" + _a + "-" + _y + "0-9_\'\.\+\-]*)$", 'gi'); + regexp = new RegExp("(?:\\B|\\W|\\s)" + flag + "(?![" + atSymbols + "])([A-Za-z" + _a + "-" + _y + "0-9_\'\.\+\-]*)$", 'gi'); match = regexp.exec(subtext); |