Fix first word completion
This commit is contained in:
parent
05f2bc8392
commit
97d0cfa3d9
1 changed files with 1 additions and 0 deletions
|
@ -46,6 +46,7 @@ void LineEditCompleter::keyPressEvent(QKeyEvent * event)
|
||||||
//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 = 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 != "")
|
||||||
|
|
Loading…
Reference in a new issue