Skip to content

Commit

Permalink
Remove redundant comments
Browse files Browse the repository at this point in the history
  • Loading branch information
pierredup committed Mar 26, 2020
1 parent 4c441b0 commit b7b8b4f
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/Symfony/Component/Console/Helper/QuestionHelper.php
Expand Up @@ -236,7 +236,7 @@ protected function writeError(OutputInterface $output, \Exception $error)
*/
private function autocomplete(OutputInterface $output, Question $question, $inputStream, callable $autocomplete): string
{
$cursor = new Cursor($output);
$cursor = new Cursor($output, $inputStream);

$fullChoice = '';
$ret = '';
Expand Down Expand Up @@ -265,7 +265,6 @@ private function autocomplete(OutputInterface $output, Question $question, $inpu
} elseif ("\177" === $c) { // Backspace Character
if (0 === $numMatches && 0 !== $i) {
--$i;
// Move cursor backwards
$cursor->moveLeft();

$fullChoice = self::substr($fullChoice, 0, $i);
Expand Down Expand Up @@ -354,16 +353,13 @@ function ($match) use ($ret) {
}
}

// Erase characters from cursor to end of line
$cursor->clearLine(true);

if ($numMatches > 0 && -1 !== $ofs) {
// Save cursor position
$cursor->savePosition();
// Write highlighted text, complete the partially entered response
$charactersEntered = \strlen(trim($this->mostRecentlyEnteredValue($fullChoice)));
$output->write('<hl>'.OutputFormatter::escapeTrailingBackslash(substr($matches[$ofs], $charactersEntered)).'</hl>');
// Restore cursor position
$cursor->restorePosition();
}
}
Expand Down

0 comments on commit b7b8b4f

Please sign in to comment.