some fixes for SplitInput

This commit is contained in:
fourtf 2020-08-22 12:34:19 +02:00
parent 758fdc28ee
commit f584503673

View file

@ -485,7 +485,10 @@ void SplitInput::updateColonMenu()
} }
else if (text[i] == ':') else if (text[i] == ':')
{ {
if (i == 0 || text[i - 1].isSpace())
this->showColonMenu(text.mid(i, position - i).mid(1)); this->showColonMenu(text.mid(i, position - i).mid(1));
else
this->hideColonMenu();
return; return;
} }
} }
@ -526,9 +529,10 @@ void SplitInput::hideColonMenu()
popup->hide(); popup->hide();
} }
void SplitInput::insertColonText(const QString &input) void SplitInput::insertColonText(const QString &input_)
{ {
auto &edit = *this->ui_.textEdit; auto &edit = *this->ui_.textEdit;
auto input = input_ + ' ';
auto text = edit.toPlainText(); auto text = edit.toPlainText();
auto position = edit.textCursor().position(); auto position = edit.textCursor().position();