Allow tab completion of nicks after various chars
authorSebastian Goth <seezer@roath.org>
Mon, 21 Sep 2009 11:35:02 +0000 (13:35 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Mon, 21 Sep 2009 11:38:42 +0000 (13:38 +0200)
This allows nick completion after @ or ( and some more.
Completion doesn't work after -_[]{}|`^.\ or any number or text
as those might belong to the nick and we still want support
for easy completion of ^A`w3s0m3_N1x}

Fixes #812

src/uisupport/tabcompleter.cpp

index b9b6eb1..88c2f0c 100644 (file)
@@ -61,8 +61,8 @@ void TabCompleter::buildCompletionList() {
   if(!_currentNetwork)
     return;
 
-  QString tabAbbrev = _lineEdit->text().left(_lineEdit->cursorPosition()).section(' ',-1,-1);
-  QRegExp regex(QString("^[^a-zA-Z]*").append(QRegExp::escape(tabAbbrev)), Qt::CaseInsensitive);
+  QString tabAbbrev = _lineEdit->text().left(_lineEdit->cursorPosition()).section(QRegExp("[^\\w\\d-_\\[\\]{}|`^.\\\\]"),-1,-1);
+  QRegExp regex(QString("^[-_\\[\\]{}|`^.\\\\]*").append(QRegExp::escape(tabAbbrev)), Qt::CaseInsensitive);
 
   switch(static_cast<BufferInfo::Type>(currentIndex.data(NetworkModel::BufferTypeRole).toInt())) {
   case BufferInfo::ChannelBuffer: