From 7acd4b3307fafd986b7dd7c6f29403038b8f3604 Mon Sep 17 00:00:00 2001 From: Jussi Kuokkanen Date: Fri, 28 Aug 2020 23:59:27 +0300 Subject: lint --- src/TextInputWidget.h | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'src/TextInputWidget.h') diff --git a/src/TextInputWidget.h b/src/TextInputWidget.h index 8cd61b6a..4ae68798 100644 --- a/src/TextInputWidget.h +++ b/src/TextInputWidget.h @@ -109,7 +109,7 @@ private: { return pos == atTriggerPosition_ + anchorWidth(anchor); } - QRect completerRect(); + QRect completerRect(); QString query() { auto cursor = textCursor(); @@ -118,18 +118,18 @@ private: } QString wordUnderCursor() { - auto tc = textCursor(); - auto editor_text = toPlainText(); - // Text before cursor - auto text = editor_text.chopped(editor_text.length() - tc.position()); - // Revert to find the first space (last before cursor in the original) - std::reverse(text.begin(), text.end()); - auto space_idx = text.indexOf(" "); - if (space_idx > -1) - text.chop(text.length() - space_idx); - // Revert back - std::reverse(text.begin(), text.end()); - return text; + auto tc = textCursor(); + auto editor_text = toPlainText(); + // Text before cursor + auto text = editor_text.chopped(editor_text.length() - tc.position()); + // Revert to find the first space (last before cursor in the original) + std::reverse(text.begin(), text.end()); + auto space_idx = text.indexOf(" "); + if (space_idx > -1) + text.chop(text.length() - space_idx); + // Revert back + std::reverse(text.begin(), text.end()); + return text; } dialogs::PreviewUploadOverlay previewDialog_; @@ -137,7 +137,7 @@ private: //! Latest position of the '@' character that triggers the username completer. int atTriggerPosition_ = -1; - void insertCompletion(QString completion); + void insertCompletion(QString completion); void textChanged(); void uploadData(const QByteArray data, const QString &media, const QString &filename); void afterCompletion(int); -- cgit 1.5.1