Fix first word completion

This commit is contained in:
Jeff 2015-08-20 23:01:32 -04:00
parent 05f2bc8392
commit 97d0cfa3d9

View file

@ -46,6 +46,7 @@ void LineEditCompleter::keyPressEvent(QKeyEvent * event)
//Truncate the line to last space or whole string
QString textValue = text();
int lastIndexof = textValue.lastIndexOf(" ");
lastIndexof = qMax(0, lastIndexof);
QString finalString = textValue.left(lastIndexof);
//Add a space if there's a word
if (finalString != "")