From b7b8b4f9ded277fa53e81489bd9b5acef797cb1e Mon Sep 17 00:00:00 2001 From: Pierre du Plessis Date: Mon, 3 Feb 2020 21:45:43 +0200 Subject: [PATCH] Remove redundant comments --- src/Symfony/Component/Console/Helper/QuestionHelper.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Symfony/Component/Console/Helper/QuestionHelper.php b/src/Symfony/Component/Console/Helper/QuestionHelper.php index 84349cf3b608d..3f047e7202391 100644 --- a/src/Symfony/Component/Console/Helper/QuestionHelper.php +++ b/src/Symfony/Component/Console/Helper/QuestionHelper.php @@ -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 = ''; @@ -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); @@ -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(''.OutputFormatter::escapeTrailingBackslash(substr($matches[$ofs], $charactersEntered)).''); - // Restore cursor position $cursor->restorePosition(); } }