1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-12-26 21:22:00 +03:00

Fix uses of non-keyword logical operators (replace &&, || and ! with and, or and not)

This commit is contained in:
Maxime Coste 2015-12-27 23:28:34 +00:00
parent 11652ce230
commit 5217089902
4 changed files with 9 additions and 9 deletions

View File

@ -23,7 +23,7 @@ struct InsertCompleterDesc
{ return mode == other.mode and param == other.param; }
bool operator!=(const InsertCompleterDesc& other) const
{ return !(*this == other); }
{ return not (*this == other); }
Mode mode;
Optional<String> param;

View File

@ -110,7 +110,7 @@ UnitTest test_line_modifications{[]()
buffer.erase(buffer.iterator_at({1, 0}), buffer.iterator_at({2, 0}));
auto modifs = compute_line_modifications(buffer, ts);
kak_assert(modifs.size() == 1 && modifs[0] == LineModification{ 1 COMMA 1 COMMA 1 COMMA 0 });
kak_assert(modifs.size() == 1 and modifs[0] == LineModification{ 1 COMMA 1 COMMA 1 COMMA 0 });
}
{
@ -119,7 +119,7 @@ UnitTest test_line_modifications{[]()
buffer.insert(buffer.iterator_at({1, 7}), "line 3");
auto modifs = compute_line_modifications(buffer, ts);
kak_assert(modifs.size() == 1 && modifs[0] == LineModification{ 2 COMMA 2 COMMA 0 COMMA 1 });
kak_assert(modifs.size() == 1 and modifs[0] == LineModification{ 2 COMMA 2 COMMA 0 COMMA 1 });
}
{
@ -130,7 +130,7 @@ UnitTest test_line_modifications{[]()
buffer.erase(buffer.iterator_at({0, 0}), buffer.iterator_at({1, 0}));
auto modifs = compute_line_modifications(buffer, ts);
kak_assert(modifs.size() == 1 && modifs[0] == LineModification{ 0 COMMA 0 COMMA 2 COMMA 2 });
kak_assert(modifs.size() == 1 and modifs[0] == LineModification{ 0 COMMA 0 COMMA 2 COMMA 2 });
}
{
@ -142,13 +142,13 @@ UnitTest test_line_modifications{[]()
buffer.erase(buffer.iterator_at({0,0}), buffer.iterator_at({1,0}));
{
auto modifs = compute_line_modifications(buffer, ts);
kak_assert(modifs.size() == 1 && modifs[0] == LineModification{ 0 COMMA 0 COMMA 4 COMMA 3 });
kak_assert(modifs.size() == 1 and modifs[0] == LineModification{ 0 COMMA 0 COMMA 4 COMMA 3 });
}
buffer.insert(buffer.iterator_at({3,0}), "newline 4\n");
{
auto modifs = compute_line_modifications(buffer, ts);
kak_assert(modifs.size() == 1 && modifs[0] == LineModification{ 0 COMMA 0 COMMA 4 COMMA 4 });
kak_assert(modifs.size() == 1 and modifs[0] == LineModification{ 0 COMMA 0 COMMA 4 COMMA 4 });
}
}
@ -159,7 +159,7 @@ UnitTest test_line_modifications{[]()
buffer.insert(buffer.iterator_at({0,1}), "e");
buffer.insert(buffer.iterator_at({0,2}), "w");
auto modifs = compute_line_modifications(buffer, ts);
kak_assert(modifs.size() == 1 && modifs[0] == LineModification{ 0 COMMA 0 COMMA 1 COMMA 1 });
kak_assert(modifs.size() == 1 and modifs[0] == LineModification{ 0 COMMA 0 COMMA 1 COMMA 1 });
}
}};

View File

@ -119,7 +119,7 @@ struct SelectionList
size_t size() const { return m_selections.size(); }
bool operator==(const SelectionList& other) const { return m_buffer == other.m_buffer and m_selections == other.m_selections; }
bool operator!=(const SelectionList& other) const { return !((*this) == other); }
bool operator!=(const SelectionList& other) const { return not ((*this) == other); }
void sort_and_merge_overlapping();

View File

@ -105,7 +105,7 @@ public:
[[gnu::always_inline]]
constexpr bool operator!() const
{ return !m_value; }
{ return not m_value; }
[[gnu::always_inline]]
explicit constexpr operator ValueType() const { return m_value; }