diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9be5a7ffe..f17f97fa6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,7 +4,7 @@ include: - https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/reuse-lint.yml - https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/android.yml -# - https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/android-qt6.yml + - https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/android-qt6.yml - https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/linux.yml - https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/linux-qt6.yml - https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/windows.yml diff --git a/src/chatdocumenthandler.cpp b/src/chatdocumenthandler.cpp index 0c81f0ad3..7c02cbd22 100644 --- a/src/chatdocumenthandler.cpp +++ b/src/chatdocumenthandler.cpp @@ -138,12 +138,13 @@ int ChatDocumentHandler::completionStartIndex() const return 0; } -#if QT_VERSION > QT_VERSION_CHECK(6, 0, 0) +#if !defined(Q_OS_ANDROID) && QT_VERSION > QT_VERSION_CHECK(6, 0, 0) const long long cursor = cursorPosition(); #else const auto cursor = cursorPosition(); #endif const auto &text = getText(); + auto start = std::min(cursor, text.size()) - 1; while (start > -1) { if (text.at(start) == QLatin1Char(' ')) { @@ -355,4 +356,4 @@ void ChatDocumentHandler::setErrorColor(const QColor &color) m_highlighter->errorFormat.setForeground(m_errorColor); m_highlighter->rehighlight(); Q_EMIT errorColorChanged(); -} \ No newline at end of file +}