From e9fb092085e47ed6f4da8592a5f38aebec4e8885 Mon Sep 17 00:00:00 2001
From: Tobias Markmann <tm@ayena.de>
Date: Mon, 3 Sep 2012 23:55:18 +0200
Subject: Enable completion of nicknames not starting with a letter.

Resolves: #813

License: This patch is BSD-licensed, see http://www.opensource.org/licenses/bsd-license.php

diff --git a/Swift/QtUI/QtChatWindow.cpp b/Swift/QtUI/QtChatWindow.cpp
index ddfe158..2bb9ae0 100644
--- a/Swift/QtUI/QtChatWindow.cpp
+++ b/Swift/QtUI/QtChatWindow.cpp
@@ -311,7 +311,7 @@ void QtChatWindow::tabComplete() {
 		cursor = tabCompleteCursor_;
 	} else {
 		cursor = input_->textCursor();
-		cursor.select(QTextCursor::WordUnderCursor);
+		while(cursor.movePosition(QTextCursor::Left, QTextCursor::KeepAnchor) && cursor.document()->characterAt(cursor.position() - 1) != ' ') { }
 	}
 	QString root = cursor.selectedText();
 	if (root.isEmpty()) {
-- 
cgit v0.10.2-6-g49f6