diff options
author | Phil Hughes <me@iamphill.com> | 2017-01-20 15:16:31 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-01-21 20:05:02 +0000 |
commit | 4a797620e8dd92519bf43dfb36e7e09de0c9e739 (patch) | |
tree | e669ab001fd9236aceb6b8d74afd229df1fd8e44 /app/assets | |
parent | eb993dc5963fdec39ebbec813df0b3afb6e6fde2 (diff) | |
download | gitlab-ce-4a797620e8dd92519bf43dfb36e7e09de0c9e739.tar.gz |
Added comments to regex
Diffstat (limited to 'app/assets')
-rw-r--r-- | app/assets/javascripts/filtered_search/dropdown_utils.js.es6 | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/assets/javascripts/filtered_search/dropdown_utils.js.es6 b/app/assets/javascripts/filtered_search/dropdown_utils.js.es6 index df4103b0e7f..f5d2eb9ae76 100644 --- a/app/assets/javascripts/filtered_search/dropdown_utils.js.es6 +++ b/app/assets/javascripts/filtered_search/dropdown_utils.js.es6 @@ -91,6 +91,7 @@ inputValue = inputValue.replace(/"(.*?)"/g, str => str.replace(/\s/g, '_') ); // Get the right position for the word selected + // Regex matches first space let right = inputValue.slice(selectionStart).search(/\s/); if (right >= 0) { @@ -100,6 +101,7 @@ } // Get the left position for the word selected + // Regex matches last non-whitespace character let left = inputValue.slice(0, right).search(/\S+$/); if (selectionStart === 0) { |