diff options
| author | Maxime Coste <mawww@kakoune.org> | 2024-06-23 11:03:50 +1000 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2024-06-23 11:03:50 +1000 |
| commit | 4a00a6edead9f35ebc5f538cefc35c778e2dbe49 (patch) | |
| tree | 41433eff8374605168ddb13a88de5f12f05ed613 | |
| parent | 6493ddad421bf5376165af5c0f5ab6fe31d77035 (diff) | |
Fix trailing whitespaces
| -rw-r--r-- | src/context.cc | 2 | ||||
| -rw-r--r-- | src/hash_map.hh | 2 | ||||
| -rw-r--r-- | src/highlighters.cc | 2 | ||||
| -rw-r--r-- | src/register_manager.cc | 2 | ||||
| -rw-r--r-- | src/string.cc | 4 | ||||
| -rw-r--r-- | src/string.hh | 4 | ||||
| -rw-r--r-- | src/string_utils.cc | 2 | ||||
| -rw-r--r-- | src/string_utils.hh | 4 | ||||
| -rw-r--r-- | src/terminal_ui.cc | 2 |
9 files changed, 12 insertions, 12 deletions
diff --git a/src/context.cc b/src/context.cc index 62171674..46d9cd58 100644 --- a/src/context.cc +++ b/src/context.cc @@ -424,7 +424,7 @@ StringView Context::main_sel_register_value(StringView reg) const return RegisterManager::instance()[reg].get_main(*this, index); } -void Context::set_name(String name) { +void Context::set_name(String name) { String old_name = std::exchange(m_name, std::move(name)); hooks().run_hook(Hook::ClientRenamed, format("{}:{}", old_name, m_name), *this); } diff --git a/src/hash_map.hh b/src/hash_map.hh index dcf76d42..eef082dd 100644 --- a/src/hash_map.hh +++ b/src/hash_map.hh @@ -239,7 +239,7 @@ struct HashMap constexpr bool contains(const KeyType& key) const { return find_index(key) >= 0; } template<typename KeyType> requires IsHashCompatible<Key, std::remove_cvref_t<KeyType>> - constexpr EffectiveValue& operator[](KeyType&& key) + constexpr EffectiveValue& operator[](KeyType&& key) { const auto hash = hash_value(key); auto index = find_index(key, hash); diff --git a/src/highlighters.cc b/src/highlighters.cc index 1962f119..86985084 100644 --- a/src/highlighters.cc +++ b/src/highlighters.cc @@ -1050,7 +1050,7 @@ private: if (column % indentwidth == 0 and column != 0) { atom_it->replace(m_indent); face = indentface; - } + } else { atom_it->replace(m_spc); } diff --git a/src/register_manager.cc b/src/register_manager.cc index 16db41ba..9de4c5d0 100644 --- a/src/register_manager.cc +++ b/src/register_manager.cc @@ -40,7 +40,7 @@ void HistoryRegister::set(Context& context, ConstArrayView<String> values, bool return; } - for (auto&& entry : values | reverse()) + for (auto&& entry : values | reverse()) { m_content.erase(std::remove(m_content.begin(), m_content.end(), entry), m_content.end()); m_content.insert(m_content.begin(), entry); diff --git a/src/string.cc b/src/string.cc index a672433b..ae467075 100644 --- a/src/string.cc +++ b/src/string.cc @@ -6,7 +6,7 @@ namespace Kakoune { -namespace +namespace { // Avoid including all of <algorithm> just for this. constexpr auto max(auto lhs, auto rhs) { return lhs > rhs ? lhs : rhs;} @@ -69,7 +69,7 @@ void String::Data::reserve(size_t new_capacity) if (current_capacity != 0 and new_capacity <= current_capacity) return; - if (!is_long() and new_capacity <= Short::capacity) + if (!is_long() and new_capacity <= Short::capacity) return; kak_assert(new_capacity <= Long::max_capacity); diff --git a/src/string.hh b/src/string.hh index 01e91b62..0ed1dc75 100644 --- a/src/string.hh +++ b/src/string.hh @@ -169,9 +169,9 @@ public: using Alloc = Allocator<char, MemoryDomain::String>; Data() { set_empty(); } - Data(NoCopy, const char* data, size_t size) : u{Long{const_cast<char*>(data), + Data(NoCopy, const char* data, size_t size) : u{Long{const_cast<char*>(data), size, - /*capacity=*/0, + /*capacity=*/0, /*mode=*/Long::active_mask}} {} Data(const char* data, size_t size, size_t capacity); diff --git a/src/string_utils.cc b/src/string_utils.cc index 53d2d455..c614d485 100644 --- a/src/string_utils.cc +++ b/src/string_utils.cc @@ -202,7 +202,7 @@ InplaceString<23> to_string(Grouped val) InplaceString<23> res; for (int pos = 0, len = ungrouped.m_length; pos != len; ++pos) { - if (res.m_length and ((len - pos) % 3) == 0) + if (res.m_length and ((len - pos) % 3) == 0) res.m_data[res.m_length++] = ','; res.m_data[res.m_length++] = ungrouped.m_data[pos]; } diff --git a/src/string_utils.hh b/src/string_utils.hh index 3cd7c825..3034dfd5 100644 --- a/src/string_utils.hh +++ b/src/string_utils.hh @@ -144,10 +144,10 @@ decltype(auto) to_string(const StronglyTypedNumber<RealType, ValueType>& val) namespace detail { -template<typename T> requires std::is_convertible_v<T, StringView> +template<typename T> requires std::is_convertible_v<T, StringView> StringView format_param(const T& val) { return val; } -template<typename T> requires (not std::is_convertible_v<T, StringView>) +template<typename T> requires (not std::is_convertible_v<T, StringView>) decltype(auto) format_param(const T& val) { return to_string(val); } } diff --git a/src/terminal_ui.cc b/src/terminal_ui.cc index 52a25e26..33574e90 100644 --- a/src/terminal_ui.cc +++ b/src/terminal_ui.cc @@ -377,7 +377,7 @@ void TerminalUI::Screen::output(bool force, bool synchronized, Writer& writer) { for (int line = 0; line < (int)size.line; ++line) { - auto hash = hash_line(lines[line]); + auto hash = hash_line(lines[line]); if (hash == hashes[line]) continue; hashes[line] = hash; |
