summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2010-07-24 20:00:41 (GMT)
committerKevin Smith <git@kismith.co.uk>2010-07-24 20:00:41 (GMT)
commitaafc6a9b0eb2af64e51943fff89019a937ba137d (patch)
treeb96990277d4d330d5f5d99fc553d8805b9fdb66f
parent545f20b9051caad8d0223bd332a094c2ffbe8435 (diff)
downloadswift-contrib-aafc6a9b0eb2af64e51943fff89019a937ba137d.zip
swift-contrib-aafc6a9b0eb2af64e51943fff89019a937ba137d.tar.bz2
Don't tab-complete empty words.
Resolves: #468
-rw-r--r--Swift/QtUI/QtChatWindow.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/Swift/QtUI/QtChatWindow.cpp b/Swift/QtUI/QtChatWindow.cpp
index a294898..5e96b3e 100644
--- a/Swift/QtUI/QtChatWindow.cpp
+++ b/Swift/QtUI/QtChatWindow.cpp
@@ -120,6 +120,9 @@ void QtChatWindow::tabComplete() {
cursor.select(QTextCursor::WordUnderCursor);
QString root = cursor.selectedText();
bool firstWord = cursor.selectionStart() == 0;
+ if (root.isEmpty()) {
+ return;
+ }
QString suggestion = P2QSTRING(completer_->completeWord(Q2PSTRING(root)));
if (root == suggestion) {
return;