diff options
| author | Neil <nyamatongwe@gmail.com> | 2026-04-13 11:31:36 +1000 |
|---|---|---|
| committer | Neil <nyamatongwe@gmail.com> | 2026-04-13 11:31:36 +1000 |
| commit | 4db72474ccc799b6f39bb37604154cbcf33e08be (patch) | |
| tree | 6b9f00c323fb287b1f00bb27d2e5e581d9a2d9e2 /src/Editor.cxx | |
| parent | 59d707bee0292d434513b28bcbfa7257c56a910c (diff) | |
| download | scintilla-mirror-4db72474ccc799b6f39bb37604154cbcf33e08be.tar.gz | |
Copy AnyOf from Lexilla to clarify code checking if a value is in a set.
Diffstat (limited to 'src/Editor.cxx')
| -rw-r--r-- | src/Editor.cxx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index 500373a8a..d946c7bd2 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -3818,7 +3818,7 @@ int Editor::DelWordOrLine(Message iMessage) { // Rightwards and leftwards deletions differ in treatment of virtual space. // Clear virtual space for leftwards, realise for rightwards. - const bool leftwards = (iMessage == Message::DelWordLeft) || (iMessage == Message::DelLineLeft); + const bool leftwards = AnyOf(iMessage, Message::DelWordLeft, Message::DelLineLeft); if (!additionalSelectionTyping) { InvalidateWholeSelection(); @@ -4029,14 +4029,14 @@ int Editor::KeyCommand(Message iMessage) { break; case Message::DeleteBack: DelCharBack(true); - if ((caretSticky == CaretSticky::Off) || (caretSticky == CaretSticky::WhiteSpace)) { + if (AnyOf(caretSticky, CaretSticky::Off, CaretSticky::WhiteSpace)) { SetLastXChosen(); } EnsureCaretVisible(); break; case Message::DeleteBackNotLine: DelCharBack(false); - if ((caretSticky == CaretSticky::Off) || (caretSticky == CaretSticky::WhiteSpace)) { + if (AnyOf(caretSticky, CaretSticky::Off, CaretSticky::WhiteSpace)) { SetLastXChosen(); } EnsureCaretVisible(); @@ -4053,7 +4053,7 @@ int Editor::KeyCommand(Message iMessage) { case Message::BackTab: case Message::LineDedent: Indent(false, iMessage == Message::LineDedent); - if ((caretSticky == CaretSticky::Off) || (caretSticky == CaretSticky::WhiteSpace)) { + if (AnyOf(caretSticky, CaretSticky::Off, CaretSticky::WhiteSpace)) { SetLastXChosen(); } EnsureCaretVisible(); @@ -4859,7 +4859,7 @@ void Editor::ButtonDownWithModifiers(Point pt, unsigned int curTime, KeyMod modi wordSelectAnchorEndPos = endWord; wordSelectInitialCaretPos = sel.MainCaret(); WordSelection(wordSelectInitialCaretPos); - } else if (selectionUnit == TextUnit::subLine || selectionUnit == TextUnit::wholeLine) { + } else if (AnyOf(selectionUnit, TextUnit::subLine, TextUnit::wholeLine)) { lineAnchorPos = newPos.Position(); LineSelection(lineAnchorPos, lineAnchorPos, selectionUnit == TextUnit::wholeLine); //Platform::DebugPrintf("Triple click: %d - %d\n", anchor, currentPos); @@ -5395,7 +5395,7 @@ Sci::Position Editor::PositionAfterMaxStyling(Sci::Position posMax, bool scrolli } void Editor::StartIdleStyling(bool truncatedLastStyling) { - if ((idleStyling == IdleStyling::All) || (idleStyling == IdleStyling::AfterVisible)) { + if (AnyOf(idleStyling, IdleStyling::All, IdleStyling::AfterVisible)) { if (pdoc->GetEndStyled() < pdoc->Length()) { // Style remainder of document in idle time needIdleStyling = true; @@ -6344,7 +6344,7 @@ sptr_t Editor::WndProc(Message iMessage, uptr_t wParam, sptr_t lParam) { case Message::Paste: Paste(); - if ((caretSticky == CaretSticky::Off) || (caretSticky == CaretSticky::WhiteSpace)) { + if (AnyOf(caretSticky, CaretSticky::Off, CaretSticky::WhiteSpace)) { SetLastXChosen(); } EnsureCaretVisible(); |
