b8aac3c9bc
Add secondary_cursors field to Editor with insert_char_multi, delete_back_multi, delete_forward_multi methods. Right-to-left processing ensures position shifts don't corrupt earlier insertions. 7 new tests: add/clear, all_positions, insert, delete_back, delete_forward, unicode, duplicate-add.
25 lines
612 B
C++
25 lines
612 B
C++
/*
|
|
This file is part of the KDE libraries
|
|
|
|
SPDX-FileCopyrightText: 2026 Waqar Ahmed <waqar.17a@gmail.com>
|
|
SPDX-License-Identifier: LGPL-2.0-or-later
|
|
*/
|
|
|
|
#ifndef KXMLGUI_UTILS_H
|
|
#define KXMLGUI_UTILS_H
|
|
|
|
#include <QString>
|
|
|
|
// Case insensitive equality without calling toLower which allocates a new string
|
|
[[nodiscard]] static inline bool equals(QStringView a, QStringView b)
|
|
{
|
|
return a.compare(b, Qt::CaseInsensitive) == 0;
|
|
}
|
|
|
|
[[nodiscard]] static inline bool equals(QStringView a, std::string_view b)
|
|
{
|
|
return a.compare(QLatin1String(b.data(), b.size()), Qt::CaseInsensitive) == 0;
|
|
}
|
|
|
|
#endif
|