diff options
Diffstat (limited to 'qt-ui/tagwidget.cpp')
-rw-r--r-- | qt-ui/tagwidget.cpp | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/qt-ui/tagwidget.cpp b/qt-ui/tagwidget.cpp index 2733a144c..4c71c5fac 100644 --- a/qt-ui/tagwidget.cpp +++ b/qt-ui/tagwidget.cpp @@ -140,16 +140,8 @@ void TagWidget::reparse() void TagWidget::completionSelected(QString completion) { - QPair<int, int> pos; - 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.append(", ")); - setCursorPosition(text().length()); - } - emit(textChanged()); + completionHighlighted(completion); + emit textChanged(); } void TagWidget::completionHighlighted(QString completion) @@ -163,7 +155,6 @@ void TagWidget::completionHighlighted(QString completion) setText(completion.append(", ")); setCursorPosition(text().length()); } - } void TagWidget::setCursorPosition(int position) |