From aafc6a9b0eb2af64e51943fff89019a937ba137d Mon Sep 17 00:00:00 2001
From: Kevin Smith <git@kismith.co.uk>
Date: Sat, 24 Jul 2010 21:00:41 +0100
Subject: Don't tab-complete empty words.

Resolves: #468

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;
-- 
cgit v0.10.2-6-g49f6