summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/tagwidget.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/qt-ui/tagwidget.cpp b/qt-ui/tagwidget.cpp
index fbebe3f35..dfeeac537 100644
--- a/qt-ui/tagwidget.cpp
+++ b/qt-ui/tagwidget.cpp
@@ -146,13 +146,8 @@ void TagWidget::completionSelected(const QString& completion)
void TagWidget::completionHighlighted(const QString& completion)
{
QPair<int, int> pos = getCursorTagPosition();
- if (pos.first >= 0 && pos.second > 0) {
- setText(text().remove(pos.first, pos.second - pos.first).insert(pos.first, completion));
- setCursorPosition(pos.first + completion.length());
- } else {
- setText(completion + QString(", "));
- setCursorPosition(text().length());
- }
+ setText(text().remove(pos.first, pos.second - pos.first).insert(pos.first, completion));
+ setCursorPosition(pos.first + completion.length());
}
void TagWidget::setCursorPosition(int position)