linenoise.cpp: allow completions from empty input

Fixes #1742.
This commit is contained in:
Will Dietz 2017-12-19 12:48:34 -06:00
parent ca40fbdc50
commit 71987b18d4

View file

@ -2587,13 +2587,6 @@ int InputBuffer::getInputLine(PromptBase& pi) {
// ctrl-I/tab, command completion, needs to be before switch statement // ctrl-I/tab, command completion, needs to be before switch statement
if (c == ctrlChar('I') && completionCallback) { if (c == ctrlChar('I') && completionCallback) {
if (pos == 0) // SERVER-4967 -- in earlier versions, you could paste
// previous output
continue; // back into the shell ... this output may have leading
// tabs.
// This hack (i.e. what the old code did) prevents command completion
// on an empty line but lets users paste text with leading tabs.
killRing.lastAction = KillRing::actionOther; killRing.lastAction = KillRing::actionOther;
historyRecallMostRecent = false; historyRecallMostRecent = false;