diff --git a/src/TabCompletion/AutoCompleter.php b/src/TabCompletion/AutoCompleter.php index 400b797a..f1b63fe7 100644 --- a/src/TabCompletion/AutoCompleter.php +++ b/src/TabCompletion/AutoCompleter.php @@ -74,7 +74,13 @@ public function processCallback(string $input, int $index, array $info = []): ar $matches = []; foreach ($this->matchers as $matcher) { if ($matcher->hasMatched($tokens)) { - $matches = \array_merge($matcher->getMatches($tokens), $matches); + $foundMatches = $matcher->getMatches($tokens); + + if ($foundMatches && $matcher instanceof NonCombinableMatcher) { + return $foundMatches; + } + + $matches = \array_merge($foundMatches, $matches); } } diff --git a/src/TabCompletion/NonCombinableMatcher.php b/src/TabCompletion/NonCombinableMatcher.php new file mode 100644 index 00000000..af694c4a --- /dev/null +++ b/src/TabCompletion/NonCombinableMatcher.php @@ -0,0 +1,12 @@ + + */ +interface NonCombinableMatcher +{ +}