Merge lines

This commit is contained in:
Jeff 2015-08-20 23:33:06 -04:00
parent 97d0cfa3d9
commit 50e0b6dd35

View file

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