mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
Fix a minor bug in the tags widget.
Using the auto-completer while the tags widget is 'empty', always picked the first choice. Write some letters and remove them in an empty tags widget, the complete list of tags will appear - now if you try to choose any tag with the keyboard arrows it will choose the first one. also if you tried choosing it by mouse it will be inserted twice. This is fixed by removing the unneeded else part. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
d461780369
commit
e088067ef1
1 changed files with 2 additions and 7 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue