Fixed comma appended to username completion when not at the beginning of the message (#3060)
Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#include "singletons/Settings.hpp"
|
||||
#include "singletons/Theme.hpp"
|
||||
#include "util/Clamp.hpp"
|
||||
#include "util/Helpers.hpp"
|
||||
#include "util/LayoutCreator.hpp"
|
||||
#include "widgets/Notebook.hpp"
|
||||
#include "widgets/Scrollbar.hpp"
|
||||
@@ -568,8 +569,10 @@ void SplitInput::insertCompletionText(const QString &input_)
|
||||
}
|
||||
else if (text[i] == '@')
|
||||
{
|
||||
input = "@" + input_ +
|
||||
(getSettings()->mentionUsersWithComma ? ", " : " ");
|
||||
const auto userMention =
|
||||
formatUserMention(input_, edit.isFirstWord(),
|
||||
getSettings()->mentionUsersWithComma);
|
||||
input = "@" + userMention + " ";
|
||||
done = true;
|
||||
}
|
||||
|
||||
@@ -595,6 +598,11 @@ void SplitInput::clearSelection()
|
||||
this->ui_.textEdit->setTextCursor(c);
|
||||
}
|
||||
|
||||
bool SplitInput::isEditFirstWord() const
|
||||
{
|
||||
return this->ui_.textEdit->isFirstWord();
|
||||
}
|
||||
|
||||
QString SplitInput::getInputText() const
|
||||
{
|
||||
return this->ui_.textEdit->toPlainText();
|
||||
|
||||
Reference in New Issue
Block a user