Autocompletion forgets counting extra spaces
1e1 opened this issue · 7 comments
The autocompletion is OK while I'm typing a word. My word is completed, then I continue at the end.
I always add a space if my command has some words.
But if I typed a first word and the following space (or more) then I type "tab": my extra space is remove.
If I type again on "tab" the first letter of the previous word will be duplicate.
I guess LineLength is not updated when the autocompleter remove the ending space chars.
Moreover I would like one extra space after the autocompleted word ;)
Hello,
Can you please give us a detailed scenario, line by line, please? Something like:
$ hello<space>
$ hello<space><tab>
$ helloo
Thanks!
$rl = new Hoa\Console\Readline\Readline();
$rl->setAutocompleter(new Hoa\Console\Readline\Autocompleter\Word([
'help',
'clear',
'quit',
]));
do {
$line = $rl->readLine('> ');
// ---
echo '< ', $line;
// ---
echo PHP_EOL, PHP_EOL;
} while (false !== $line && 'quit' !== $line);
The shortest way:
$ quit<space><tab>[cursor][EOL]
$ qquit[cursor][EOL]
Indeeed, this is a bug. I will try to fix it.
Thx, it works!
@vonglasow seems to have some issue with #68. Let's wait on him.
It was due to run all tests with xdebug but without this library everything is good.