Unified · Split
| @@ -26,7 +26,7 @@ return unless index >= 0 · 25 unmodified lines | |||
| 26 | lastIndex = value.lastIndexOf(query) | 26 | lastIndex = value.lastIndexOf(query) |
| 27 | 27 | ||
| 28 | if index isnt lastIndex | 28 | if index isnt lastIndex |
| 29 | return Math.max(scoreExactMatch(), (index = lastIndex) and scoreExactMatch()) | 29 | return Math.max(scoreExactMatch(), ((index = lastIndex) and scoreExactMatch()) or 0) |
| 30 | else | 30 | else |
| 31 | return scoreExactMatch() | 31 | return scoreExactMatch() |
| 32 | `}` | 32 | `}` |
| @@ -112,7 +112,7 @@ class app.Searcher · 79 unmodified lines | |||
| 112 | max_results: app.config.max_results | 112 | max_results: app.config.max_results |
| 113 | fuzzy_min_length: 3 | 113 | fuzzy_min_length: 3 |
| 114 | 114 | ||
| 115 | SEPARATORS_REGEXP = /\:?\ |#|::|->|\$(?=\w)|\-(?=\w)/g | 115 | SEPARATORS_REGEXP = /#|::|:-|->|\$(?=\w)|\-(?=\w)|\:(?=\w)|\ [\/\-&]\ |:\ |\ /g |
| 116 | INFO_PARANTHESES_REGEXP = /\ \(\w+?\)$/ | 116 | INFO_PARANTHESES_REGEXP = /\ \(\w+?\)$/ |
| 117 | EMPTY_PARANTHESES_REGEXP = /\(\)/ | 117 | EMPTY_PARANTHESES_REGEXP = /\(\)/ |
| 118 | EVENT_REGEXP = /\ event$/ | 118 | EVENT_REGEXP = /\ event$/ |
| @@ -166,7 +166,7 @@ class app.Searcher · 47 unmodified lines | |||
| 166 | return | 166 | return |
| 167 | 167 | ||
| 168 | isValid: -> | 168 | isValid: -> |
| 169 | queryLength > 0 | 169 | queryLength > 0 and query isnt SEPARATOR |
| 170 | 170 | ||
| 171 | end: -> | 171 | end: -> |
| 172 | @triggerResults [] unless @totalResults | 172 | @triggerResults [] unless @totalResults |