From 97d0cfa3d90264d6ff6531b1455f88b7560c81b3 Mon Sep 17 00:00:00 2001 From: Jeff Date: Thu, 20 Aug 2015 23:01:32 -0400 Subject: [PATCH] Fix first word completion --- cockatrice/src/lineeditcompleter.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/cockatrice/src/lineeditcompleter.cpp b/cockatrice/src/lineeditcompleter.cpp index daf0e69a..380518c8 100644 --- a/cockatrice/src/lineeditcompleter.cpp +++ b/cockatrice/src/lineeditcompleter.cpp @@ -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 != "")