From b4dc348f76f46ec7873c2953fe0cbc7fa76a1395 Mon Sep 17 00:00:00 2001 From: zufuliu Date: Sun, 15 Dec 2024 20:33:44 +0800 Subject: [PATCH] Simplify code folding. --- scintilla/lexers/LexAPDL.cxx | 2 -- scintilla/lexers/LexAsm.cxx | 2 -- scintilla/lexers/LexAsymptote.cxx | 2 -- scintilla/lexers/LexAutoHotkey.cxx | 2 -- scintilla/lexers/LexAutoIt3.cxx | 2 -- scintilla/lexers/LexAviSynth.cxx | 2 -- scintilla/lexers/LexAwk.cxx | 2 -- scintilla/lexers/LexBash.cxx | 2 -- scintilla/lexers/LexCMake.cxx | 2 -- scintilla/lexers/LexCSV.cxx | 2 -- scintilla/lexers/LexCSharp.cxx | 2 -- scintilla/lexers/LexCangjie.cxx | 2 -- scintilla/lexers/LexD.cxx | 2 -- scintilla/lexers/LexDart.cxx | 2 -- scintilla/lexers/LexFortran.cxx | 2 -- scintilla/lexers/LexGo.cxx | 2 -- scintilla/lexers/LexGroovy.cxx | 2 -- scintilla/lexers/LexHaxe.cxx | 2 -- scintilla/lexers/LexInno.cxx | 2 -- scintilla/lexers/LexJSON.cxx | 2 -- scintilla/lexers/LexJam.cxx | 2 -- scintilla/lexers/LexJava.cxx | 2 -- scintilla/lexers/LexJavaScript.cxx | 2 -- scintilla/lexers/LexJulia.cxx | 2 -- scintilla/lexers/LexKotlin.cxx | 2 -- scintilla/lexers/LexLua.cxx | 2 -- scintilla/lexers/LexNSIS.cxx | 2 -- scintilla/lexers/LexPHP.cxx | 2 -- scintilla/lexers/LexPerl.cxx | 2 -- scintilla/lexers/LexPowerShell.cxx | 2 -- scintilla/lexers/LexR.cxx | 2 -- scintilla/lexers/LexRebol.cxx | 2 -- scintilla/lexers/LexRuby.cxx | 2 -- scintilla/lexers/LexRust.cxx | 2 -- scintilla/lexers/LexSwift.cxx | 2 -- scintilla/lexers/LexVB.cxx | 2 -- scintilla/lexers/LexVHDL.cxx | 2 -- scintilla/lexers/LexVerilog.cxx | 2 -- scintilla/lexers/LexVim.cxx | 2 -- scintilla/lexers/LexWASM.cxx | 2 -- scintilla/lexers/LexZig.cxx | 2 -- scintilla/src/EditView.cxx | 12 ++++++------ 42 files changed, 6 insertions(+), 88 deletions(-) diff --git a/scintilla/lexers/LexAPDL.cxx b/scintilla/lexers/LexAPDL.cxx index 5d7870ca50..58cc394ea1 100644 --- a/scintilla/lexers/LexAPDL.cxx +++ b/scintilla/lexers/LexAPDL.cxx @@ -204,7 +204,6 @@ void FoldAPDLDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int /*initStyle int levelNext = levelCurrent; FoldLineState foldCurrent(styler.GetLineState(lineCurrent)); Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); char buf[16]; constexpr int MaxFoldWordLength = sizeof(buf) - 1; @@ -251,7 +250,6 @@ void FoldAPDLDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int /*initStyle lineCurrent++; lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); levelCurrent = levelNext; foldPrev = foldCurrent; foldCurrent = foldNext; diff --git a/scintilla/lexers/LexAsm.cxx b/scintilla/lexers/LexAsm.cxx index e085ead564..ca59aadc8d 100644 --- a/scintilla/lexers/LexAsm.cxx +++ b/scintilla/lexers/LexAsm.cxx @@ -374,7 +374,6 @@ void FoldAsmDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, L int levelNext = levelCurrent; Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); int style = initStyle; int styleNext = styler.StyleIndexAt(startPos); @@ -490,7 +489,6 @@ void FoldAsmDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, L lineCurrent++; lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); levelCurrent = levelNext; chPrevNonWhite = '\0'; chBefore = '\0'; diff --git a/scintilla/lexers/LexAsymptote.cxx b/scintilla/lexers/LexAsymptote.cxx index fb2b6ec4b6..d18b273894 100644 --- a/scintilla/lexers/LexAsymptote.cxx +++ b/scintilla/lexers/LexAsymptote.cxx @@ -248,7 +248,6 @@ void FoldAsyDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, L int levelNext = levelCurrent; FoldLineState foldCurrent(styler.GetLineState(lineCurrent)); Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); int styleNext = styler.StyleIndexAt(startPos); int style = initStyle; @@ -310,7 +309,6 @@ void FoldAsyDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, L lineCurrent++; lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); levelCurrent = levelNext; foldPrev = foldCurrent; foldCurrent = foldNext; diff --git a/scintilla/lexers/LexAutoHotkey.cxx b/scintilla/lexers/LexAutoHotkey.cxx index 1955bfeee5..dea2767b5d 100644 --- a/scintilla/lexers/LexAutoHotkey.cxx +++ b/scintilla/lexers/LexAutoHotkey.cxx @@ -772,7 +772,6 @@ void FoldAHKDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, L int levelNext = levelCurrent; int lineCommentCurrent = GetLineCommentState(styler.GetLineState(lineCurrent)); Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); int styleNext = styler.StyleIndexAt(startPos); int style = initStyle; @@ -833,7 +832,6 @@ void FoldAHKDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, L lineCurrent++; lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); levelCurrent = levelNext; lineCommentPrev = lineCommentCurrent; lineCommentCurrent = lineCommentNext; diff --git a/scintilla/lexers/LexAutoIt3.cxx b/scintilla/lexers/LexAutoIt3.cxx index 00c9a2b28e..2a34434633 100644 --- a/scintilla/lexers/LexAutoIt3.cxx +++ b/scintilla/lexers/LexAutoIt3.cxx @@ -592,7 +592,6 @@ void FoldAU3Doc(Sci_PositionU startPos, Sci_Position length, int /*initStyle*/, levelCurrent = styler.LevelAt(lineCurrent - 1) >> 16; } Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); int levelNext = levelCurrent; char chPrev = ' '; while (startPos < endPos) { @@ -732,7 +731,6 @@ void FoldAU3Doc(Sci_PositionU startPos, Sci_Position length, int /*initStyle*/, // reset values for the next line lineCurrent++; lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); stylePrev = style; style = styleNext; levelCurrent = levelNext; diff --git a/scintilla/lexers/LexAviSynth.cxx b/scintilla/lexers/LexAviSynth.cxx index 08f0e412ef..884076ae4d 100644 --- a/scintilla/lexers/LexAviSynth.cxx +++ b/scintilla/lexers/LexAviSynth.cxx @@ -266,7 +266,6 @@ void FoldAvsDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, L int levelNext = levelCurrent; int lineCommentCurrent = GetLineCommentState(styler.GetLineState(lineCurrent)); Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); char chNext = styler[startPos]; int styleNext = styler.StyleIndexAt(startPos); @@ -337,7 +336,6 @@ void FoldAvsDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, L lineCurrent++; lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); levelCurrent = levelNext; lineCommentPrev = lineCommentCurrent; lineCommentCurrent = lineCommentNext; diff --git a/scintilla/lexers/LexAwk.cxx b/scintilla/lexers/LexAwk.cxx index fbeb5351b9..695be1dee6 100644 --- a/scintilla/lexers/LexAwk.cxx +++ b/scintilla/lexers/LexAwk.cxx @@ -427,7 +427,6 @@ void FoldAwkDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int /*initStyle* int levelNext = levelCurrent; FoldLineState foldCurrent(styler.GetLineState(lineCurrent)); Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); int visibleChars = 0; while (startPos < endPos) { @@ -471,7 +470,6 @@ void FoldAwkDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int /*initStyle* lineCurrent++; lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); levelCurrent = levelNext; foldPrev = foldCurrent; foldCurrent = foldNext; diff --git a/scintilla/lexers/LexBash.cxx b/scintilla/lexers/LexBash.cxx index f0e21d5f8e..dc56d5dcdf 100644 --- a/scintilla/lexers/LexBash.cxx +++ b/scintilla/lexers/LexBash.cxx @@ -929,7 +929,6 @@ void FoldBashDoc(Sci_PositionU startPos, Sci_Position length, int initStyle, Lex const Sci_PositionU endPos = startPos + length; Sci_Line lineCurrent = styler.GetLine(startPos); Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK; int levelCurrent = levelPrev; int styleNext = styler.StyleIndexAt(startPos); @@ -1009,7 +1008,6 @@ void FoldBashDoc(Sci_PositionU startPos, Sci_Position length, int initStyle, Lex styler.SetLevel(lineCurrent, lev); lineCurrent++; lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); levelPrev = levelCurrent; } } diff --git a/scintilla/lexers/LexCMake.cxx b/scintilla/lexers/LexCMake.cxx index 0e9cfa939e..550c1a5c12 100644 --- a/scintilla/lexers/LexCMake.cxx +++ b/scintilla/lexers/LexCMake.cxx @@ -347,7 +347,6 @@ void FoldCMakeDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, int levelNext = levelCurrent; int lineCommentCurrent = GetLineCommentState(styler.GetLineState(lineCurrent)); Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); int styleNext = styler.StyleIndexAt(startPos); int style = initStyle; @@ -412,7 +411,6 @@ void FoldCMakeDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, lineCurrent++; lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); levelCurrent = levelNext; lineCommentPrev = lineCommentCurrent; lineCommentCurrent = lineCommentNext; diff --git a/scintilla/lexers/LexCSV.cxx b/scintilla/lexers/LexCSV.cxx index bbf593f6d4..2e96b1c83f 100644 --- a/scintilla/lexers/LexCSV.cxx +++ b/scintilla/lexers/LexCSV.cxx @@ -60,7 +60,6 @@ void ColouriseCSVDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initSty styler.StartSegment(startPos); Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1); const Sci_PositionU endPos = startPos + lengthDoc; - lineStartNext = sci::min(lineStartNext, endPos); uint8_t chPrev = 0; uint8_t chPrevNonWhite = delimiter; @@ -126,7 +125,6 @@ void ColouriseCSVDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initSty styler.SetLineState(lineCurrent, lineState); lineCurrent++; lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); } } diff --git a/scintilla/lexers/LexCSharp.cxx b/scintilla/lexers/LexCSharp.cxx index f3028a8f1d..a4a31b7d52 100644 --- a/scintilla/lexers/LexCSharp.cxx +++ b/scintilla/lexers/LexCSharp.cxx @@ -785,7 +785,6 @@ void FoldCSharpDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle int levelNext = levelCurrent; FoldLineState foldCurrent(styler.GetLineState(lineCurrent)); Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); char buf[12]; // endregion constexpr int MaxFoldWordLength = sizeof(buf) - 1; @@ -874,7 +873,6 @@ void FoldCSharpDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle lineCurrent++; lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); levelCurrent = levelNext; foldPrev = foldCurrent; foldCurrent = foldNext; diff --git a/scintilla/lexers/LexCangjie.cxx b/scintilla/lexers/LexCangjie.cxx index c4a433572d..2efa45b871 100644 --- a/scintilla/lexers/LexCangjie.cxx +++ b/scintilla/lexers/LexCangjie.cxx @@ -425,7 +425,6 @@ void FoldCangjieDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyl int levelNext = levelCurrent; FoldLineState foldCurrent(styler.GetLineState(lineCurrent)); Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); char chNext = styler[startPos]; int styleNext = styler.StyleIndexAt(startPos); @@ -503,7 +502,6 @@ void FoldCangjieDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyl lineCurrent++; lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); levelCurrent = levelNext; foldPrev = foldCurrent; foldCurrent = foldNext; diff --git a/scintilla/lexers/LexD.cxx b/scintilla/lexers/LexD.cxx index 0af6f75f1c..d1eda333b3 100644 --- a/scintilla/lexers/LexD.cxx +++ b/scintilla/lexers/LexD.cxx @@ -661,7 +661,6 @@ void FoldDDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, Lex int levelNext = levelCurrent; FoldLineState foldCurrent(styler.GetLineState(lineCurrent)); Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); char chNext = styler[startPos]; int styleNext = styler.StyleIndexAt(startPos); @@ -739,7 +738,6 @@ void FoldDDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, Lex lineCurrent++; lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); levelCurrent = levelNext; foldPrev = foldCurrent; foldCurrent = foldNext; diff --git a/scintilla/lexers/LexDart.cxx b/scintilla/lexers/LexDart.cxx index ae21a4cda7..76284c2d27 100644 --- a/scintilla/lexers/LexDart.cxx +++ b/scintilla/lexers/LexDart.cxx @@ -451,7 +451,6 @@ void FoldDartDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, int levelNext = levelCurrent; FoldLineState foldCurrent(styler.GetLineState(lineCurrent)); Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); char chNext = styler[startPos]; int styleNext = styler.StyleIndexAt(startPos); @@ -529,7 +528,6 @@ void FoldDartDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, lineCurrent++; lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); levelCurrent = levelNext; foldPrev = foldCurrent; foldCurrent = foldNext; diff --git a/scintilla/lexers/LexFortran.cxx b/scintilla/lexers/LexFortran.cxx index c6ea0173c4..f1a2e2709f 100644 --- a/scintilla/lexers/LexFortran.cxx +++ b/scintilla/lexers/LexFortran.cxx @@ -354,7 +354,6 @@ void FoldFortranDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int /*initSt int levelNext = levelCurrent; int lineCommentCurrent = GetLineCommentState(styler.GetLineState(lineCurrent)); Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); int style = SCE_F_DEFAULT; while (startPos < endPos) { @@ -402,7 +401,6 @@ void FoldFortranDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int /*initSt lineCurrent++; lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); levelCurrent = levelNext; lineCommentPrev = lineCommentCurrent; lineCommentCurrent = lineCommentNext; diff --git a/scintilla/lexers/LexGo.cxx b/scintilla/lexers/LexGo.cxx index 8f035277e4..64c08279f8 100644 --- a/scintilla/lexers/LexGo.cxx +++ b/scintilla/lexers/LexGo.cxx @@ -564,7 +564,6 @@ void FoldGoDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, Le int levelNext = levelCurrent; int lineCommentCurrent = GetLineCommentState(styler.GetLineState(lineCurrent)); Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); int styleNext = styler.StyleIndexAt(startPos); int style = initStyle; @@ -623,7 +622,6 @@ void FoldGoDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, Le lineCurrent++; lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); levelCurrent = levelNext; lineCommentPrev = lineCommentCurrent; lineCommentCurrent = lineCommentNext; diff --git a/scintilla/lexers/LexGroovy.cxx b/scintilla/lexers/LexGroovy.cxx index a90a80f838..245730503e 100644 --- a/scintilla/lexers/LexGroovy.cxx +++ b/scintilla/lexers/LexGroovy.cxx @@ -567,7 +567,6 @@ void FoldGroovyDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle int levelNext = levelCurrent; FoldLineState foldCurrent(styler.GetLineState(lineCurrent)); Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); int styleNext = styler.StyleIndexAt(startPos); int style = initStyle; @@ -633,7 +632,6 @@ void FoldGroovyDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle lineCurrent++; lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); levelCurrent = levelNext; foldPrev = foldCurrent; foldCurrent = foldNext; diff --git a/scintilla/lexers/LexHaxe.cxx b/scintilla/lexers/LexHaxe.cxx index ffe2d8e223..99b19e5299 100644 --- a/scintilla/lexers/LexHaxe.cxx +++ b/scintilla/lexers/LexHaxe.cxx @@ -395,7 +395,6 @@ void FoldHaxeDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, int levelNext = levelCurrent; FoldLineState foldCurrent(styler.GetLineState(lineCurrent)); Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); char chNext = styler[startPos]; int styleNext = styler.StyleIndexAt(startPos); @@ -473,7 +472,6 @@ void FoldHaxeDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, lineCurrent++; lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); levelCurrent = levelNext; foldPrev = foldCurrent; foldCurrent = foldNext; diff --git a/scintilla/lexers/LexInno.cxx b/scintilla/lexers/LexInno.cxx index 4647005857..fcc3854126 100644 --- a/scintilla/lexers/LexInno.cxx +++ b/scintilla/lexers/LexInno.cxx @@ -451,7 +451,6 @@ void FoldInnoDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, int levelNext = levelCurrent; int lineState = styler.GetLineState(lineCurrent); Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); char buf[12]; // interface constexpr int MaxFoldWordLength = sizeof(buf) - 1; @@ -530,7 +529,6 @@ void FoldInnoDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, lineCurrent++; lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); levelCurrent = levelNext; lineStatePrev = lineState; lineState = lineStateNext; diff --git a/scintilla/lexers/LexJSON.cxx b/scintilla/lexers/LexJSON.cxx index 8e8e6d443e..073a058589 100644 --- a/scintilla/lexers/LexJSON.cxx +++ b/scintilla/lexers/LexJSON.cxx @@ -87,7 +87,6 @@ void ColouriseJSONDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initSt assert(startPos == static_cast(styler.LineStart(lineCurrent))); Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1); const Sci_PositionU endPos = startPos + lengthDoc; - lineStartNext = sci::min(lineStartNext, endPos); // see GenerateJsonCharClass() in scripts/GenerateCharTable.py static constexpr uint8_t kJsonCharClass[256] = { @@ -263,7 +262,6 @@ void ColouriseJSONDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initSt } lineCurrent++; lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); } } diff --git a/scintilla/lexers/LexJam.cxx b/scintilla/lexers/LexJam.cxx index 8b9ff37cd4..845bcfa0d7 100644 --- a/scintilla/lexers/LexJam.cxx +++ b/scintilla/lexers/LexJam.cxx @@ -257,7 +257,6 @@ void FoldJamDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, L int levelNext = levelCurrent; FoldLineState foldCurrent(styler.GetLineState(lineCurrent)); Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); int visibleChars = 0; int style = initStyle; @@ -316,7 +315,6 @@ void FoldJamDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, L lineCurrent++; lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); levelCurrent = levelNext; foldPrev = foldCurrent; foldCurrent = foldNext; diff --git a/scintilla/lexers/LexJava.cxx b/scintilla/lexers/LexJava.cxx index 82b5bff52e..5fe6dc2df1 100644 --- a/scintilla/lexers/LexJava.cxx +++ b/scintilla/lexers/LexJava.cxx @@ -595,7 +595,6 @@ void FoldJavaDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, int levelNext = levelCurrent; FoldLineState foldCurrent(styler.GetLineState(lineCurrent)); Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); int styleNext = styler.StyleIndexAt(startPos); int style = initStyle; @@ -659,7 +658,6 @@ void FoldJavaDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, lineCurrent++; lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); levelCurrent = levelNext; foldPrev = foldCurrent; foldCurrent = foldNext; diff --git a/scintilla/lexers/LexJavaScript.cxx b/scintilla/lexers/LexJavaScript.cxx index 806fae358f..e5fbd1d27d 100644 --- a/scintilla/lexers/LexJavaScript.cxx +++ b/scintilla/lexers/LexJavaScript.cxx @@ -611,7 +611,6 @@ void FoldJsDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, Le int levelNext = levelCurrent; FoldLineState foldCurrent(styler.GetLineState(lineCurrent)); Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); char chNext = styler[startPos]; int styleNext = styler.StyleIndexAt(startPos); @@ -694,7 +693,6 @@ void FoldJsDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, Le lineCurrent++; lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); levelCurrent = levelNext; foldPrev = foldCurrent; foldCurrent = foldNext; diff --git a/scintilla/lexers/LexJulia.cxx b/scintilla/lexers/LexJulia.cxx index cd3e5775d1..96d649fd82 100644 --- a/scintilla/lexers/LexJulia.cxx +++ b/scintilla/lexers/LexJulia.cxx @@ -541,7 +541,6 @@ void FoldJuliaDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, int levelNext = levelCurrent; int lineCommentCurrent = GetLineCommentState(styler.GetLineState(lineCurrent)); Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); char buf[12]; // baremodule constexpr int MaxFoldWordLength = sizeof(buf) - 1; @@ -629,7 +628,6 @@ void FoldJuliaDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, lineCurrent++; lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); levelCurrent = levelNext; lineCommentPrev = lineCommentCurrent; lineCommentCurrent = lineCommentNext; diff --git a/scintilla/lexers/LexKotlin.cxx b/scintilla/lexers/LexKotlin.cxx index 836e3daea9..a7cddc0dc2 100644 --- a/scintilla/lexers/LexKotlin.cxx +++ b/scintilla/lexers/LexKotlin.cxx @@ -431,7 +431,6 @@ void FoldKotlinDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle int levelNext = levelCurrent; FoldLineState foldCurrent(styler.GetLineState(lineCurrent)); Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); char chNext = styler[startPos]; int styleNext = styler.StyleIndexAt(startPos); @@ -506,7 +505,6 @@ void FoldKotlinDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle lineCurrent++; lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); levelCurrent = levelNext; foldPrev = foldCurrent; foldCurrent = foldNext; diff --git a/scintilla/lexers/LexLua.cxx b/scintilla/lexers/LexLua.cxx index 24696b4750..08fc3eead3 100644 --- a/scintilla/lexers/LexLua.cxx +++ b/scintilla/lexers/LexLua.cxx @@ -381,7 +381,6 @@ void FoldLuaDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, L int levelNext = levelCurrent; int lineCommentCurrent = GetLineCommentState(styler.GetLineState(lineCurrent)); Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); int styleNext = styler.StyleIndexAt(startPos); int style = initStyle; @@ -446,7 +445,6 @@ void FoldLuaDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, L lineCurrent++; lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); levelCurrent = levelNext; lineCommentPrev = lineCommentCurrent; lineCommentCurrent = lineCommentNext; diff --git a/scintilla/lexers/LexNSIS.cxx b/scintilla/lexers/LexNSIS.cxx index acb4479b65..2de532e91f 100644 --- a/scintilla/lexers/LexNSIS.cxx +++ b/scintilla/lexers/LexNSIS.cxx @@ -218,7 +218,6 @@ void FoldNSISDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, int levelNext = levelCurrent; int lineTypeCurrent = styler.GetLineState(lineCurrent) & NsisLineTypeMask; Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); int styleNext = styler.StyleIndexAt(startPos); int style = initStyle; @@ -282,7 +281,6 @@ void FoldNSISDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, lineCurrent++; lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); levelCurrent = levelNext; lineTypePrev = lineTypeCurrent; lineTypeCurrent = lineTypeNext; diff --git a/scintilla/lexers/LexPHP.cxx b/scintilla/lexers/LexPHP.cxx index 36e3011feb..60db15497e 100644 --- a/scintilla/lexers/LexPHP.cxx +++ b/scintilla/lexers/LexPHP.cxx @@ -1474,7 +1474,6 @@ void FoldPHPDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, L int levelNext = levelCurrent; FoldLineState foldCurrent(styler.GetLineState(lineCurrent)); Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); char chNext = styler[startPos]; int styleNext = styler.StyleIndexAt(startPos); @@ -1578,7 +1577,6 @@ void FoldPHPDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, L lineCurrent++; lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); levelCurrent = levelNext; foldPrev = foldCurrent; foldCurrent = foldNext; diff --git a/scintilla/lexers/LexPerl.cxx b/scintilla/lexers/LexPerl.cxx index 4cd5588805..20d88d92ff 100644 --- a/scintilla/lexers/LexPerl.cxx +++ b/scintilla/lexers/LexPerl.cxx @@ -1567,7 +1567,6 @@ void FoldPerlDoc(Sci_PositionU startPos, Sci_Position length, int /*initStyle*/, int stylePrevCh = styler.StyleAt(startPos - 1); // Used at end of line to determine if the line was a package definition Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); bool isPackageLine = false; bool atLineStart = true; int podHeading = 0; @@ -1682,7 +1681,6 @@ void FoldPerlDoc(Sci_PositionU startPos, Sci_Position length, int /*initStyle*/, styler.SetLevel(lineCurrent, lev); lineCurrent++; lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); levelPrev = levelCurrent; } } diff --git a/scintilla/lexers/LexPowerShell.cxx b/scintilla/lexers/LexPowerShell.cxx index a3f0d5d4ba..fff6e6d5cb 100644 --- a/scintilla/lexers/LexPowerShell.cxx +++ b/scintilla/lexers/LexPowerShell.cxx @@ -394,7 +394,6 @@ void FoldPowerShellDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initS int levelNext = levelCurrent; int lineCommentCurrent = GetLineCommentState(styler.GetLineState(lineCurrent)); Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); int styleNext = styler.StyleIndexAt(startPos); int style = initStyle; @@ -457,7 +456,6 @@ void FoldPowerShellDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initS lineCurrent++; lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); levelCurrent = levelNext; lineCommentPrev = lineCommentCurrent; lineCommentCurrent = lineCommentNext; diff --git a/scintilla/lexers/LexR.cxx b/scintilla/lexers/LexR.cxx index bd0862c160..1feaaf44a2 100644 --- a/scintilla/lexers/LexR.cxx +++ b/scintilla/lexers/LexR.cxx @@ -362,7 +362,6 @@ void FoldSimpleDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int /*initSty int levelNext = levelCurrent; int lineCommentCurrent = GetLineCommentState(styler.GetLineState(lineCurrent)); Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); while (startPos < endPos) { const int style = styler.StyleIndexAt(startPos); @@ -392,7 +391,6 @@ void FoldSimpleDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int /*initSty lineCurrent++; lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); levelCurrent = levelNext; lineCommentPrev = lineCommentCurrent; lineCommentCurrent = lineCommentNext; diff --git a/scintilla/lexers/LexRebol.cxx b/scintilla/lexers/LexRebol.cxx index 3ebdcb1462..e7e41d3b11 100644 --- a/scintilla/lexers/LexRebol.cxx +++ b/scintilla/lexers/LexRebol.cxx @@ -418,7 +418,6 @@ void FoldRebolDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int /*initStyl int levelNext = levelCurrent; int lineTypeCurrent = styler.GetLineState(lineCurrent) & RebolLineTypeMask; Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); while (startPos < endPos) { const int style = styler.StyleIndexAt(startPos); @@ -460,7 +459,6 @@ void FoldRebolDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int /*initStyl lineCurrent++; lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); levelCurrent = levelNext; lineTypePrev = lineTypeCurrent; lineTypeCurrent = lineTypeNext; diff --git a/scintilla/lexers/LexRuby.cxx b/scintilla/lexers/LexRuby.cxx index 34fa1c1a1d..0c8c59679e 100644 --- a/scintilla/lexers/LexRuby.cxx +++ b/scintilla/lexers/LexRuby.cxx @@ -1747,7 +1747,6 @@ void FoldRbDoc(Sci_PositionU startPos, Sci_Position length, int initStyle, Lexer int styleNext = styler.StyleAt(startPos); int stylePrev = styler.StyleAt(startPos - 1); Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); // detect endless method definition to fix up code folding enum class MethodDefinition { None, @@ -1873,7 +1872,6 @@ void FoldRbDoc(Sci_PositionU startPos, Sci_Position length, int initStyle, Lexer styler.SetLevel(lineCurrent, lev); lineCurrent++; lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); levelPrev = levelCurrent; method_definition = MethodDefinition::None; argument_paren_count = 0; diff --git a/scintilla/lexers/LexRust.cxx b/scintilla/lexers/LexRust.cxx index 9828db995c..7d9acd7230 100644 --- a/scintilla/lexers/LexRust.cxx +++ b/scintilla/lexers/LexRust.cxx @@ -535,7 +535,6 @@ void FoldRustDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, int levelNext = levelCurrent; FoldLineState foldCurrent(styler.GetLineState(lineCurrent)); Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); char chNext = styler[startPos]; int styleNext = styler.StyleIndexAt(startPos); @@ -613,7 +612,6 @@ void FoldRustDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, lineCurrent++; lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); levelCurrent = levelNext; foldPrev = foldCurrent; foldCurrent = foldNext; diff --git a/scintilla/lexers/LexSwift.cxx b/scintilla/lexers/LexSwift.cxx index 5c61b98dd3..cd9afed3b4 100644 --- a/scintilla/lexers/LexSwift.cxx +++ b/scintilla/lexers/LexSwift.cxx @@ -532,7 +532,6 @@ void FoldSwiftDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, int levelNext = levelCurrent; FoldLineState foldCurrent(styler.GetLineState(lineCurrent)); Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); char chNext = styler[startPos]; int styleNext = styler.StyleIndexAt(startPos); @@ -618,7 +617,6 @@ void FoldSwiftDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, lineCurrent++; lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); levelCurrent = levelNext; foldPrev = foldCurrent; foldCurrent = foldNext; diff --git a/scintilla/lexers/LexVB.cxx b/scintilla/lexers/LexVB.cxx index 5b92d8adf2..48d55724ef 100644 --- a/scintilla/lexers/LexVB.cxx +++ b/scintilla/lexers/LexVB.cxx @@ -474,7 +474,6 @@ void FoldVBDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, Le int levelNext = levelCurrent; FoldLineState foldCurrent(styler.GetLineState(lineCurrent)); Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); int style = initStyle; int styleNext = styler.StyleAt(startPos); @@ -637,7 +636,6 @@ void FoldVBDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, Le lineCurrent++; lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); levelCurrent = levelNext; foldPrev = foldCurrent; foldCurrent = foldNext; diff --git a/scintilla/lexers/LexVHDL.cxx b/scintilla/lexers/LexVHDL.cxx index 373f7769cc..f645d781e2 100644 --- a/scintilla/lexers/LexVHDL.cxx +++ b/scintilla/lexers/LexVHDL.cxx @@ -375,7 +375,6 @@ void FoldVHDLDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, int levelNext = levelCurrent; int lineCommentCurrent = GetLineCommentState(styler.GetLineState(lineCurrent)); Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); char buf[16]; // configuration constexpr int MaxFoldWordLength = sizeof(buf) - 1; @@ -461,7 +460,6 @@ void FoldVHDLDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, lineCurrent++; lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); levelCurrent = levelNext; lineCommentPrev = lineCommentCurrent; lineCommentCurrent = lineCommentNext; diff --git a/scintilla/lexers/LexVerilog.cxx b/scintilla/lexers/LexVerilog.cxx index e7d6341d45..c1398af816 100644 --- a/scintilla/lexers/LexVerilog.cxx +++ b/scintilla/lexers/LexVerilog.cxx @@ -509,7 +509,6 @@ void FoldVerilogDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyl int levelNext = levelCurrent; int lineCommentCurrent = GetLineCommentState(styler.GetLineState(lineCurrent)); Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); char buf[16]; // celldefine constexpr int MaxFoldWordLength = sizeof(buf) - 1; @@ -584,7 +583,6 @@ void FoldVerilogDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyl lineCurrent++; lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); levelCurrent = levelNext; lineCommentPrev = lineCommentCurrent; lineCommentCurrent = lineCommentNext; diff --git a/scintilla/lexers/LexVim.cxx b/scintilla/lexers/LexVim.cxx index 21815a5e5a..d24a2f7094 100644 --- a/scintilla/lexers/LexVim.cxx +++ b/scintilla/lexers/LexVim.cxx @@ -306,7 +306,6 @@ void FoldVimDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int /*initStyle* int levelNext = levelCurrent; FoldLineState foldCurrent(styler.GetLineState(lineCurrent)); Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); char buf[8]; // while constexpr int MaxFoldWordLength = sizeof(buf) - 1; @@ -349,7 +348,6 @@ void FoldVimDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int /*initStyle* lineCurrent++; lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); levelCurrent = levelNext; foldPrev = foldCurrent; foldCurrent = foldNext; diff --git a/scintilla/lexers/LexWASM.cxx b/scintilla/lexers/LexWASM.cxx index ad523625d6..dc30636bb4 100644 --- a/scintilla/lexers/LexWASM.cxx +++ b/scintilla/lexers/LexWASM.cxx @@ -221,7 +221,6 @@ void FoldWASMDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int /*initStyle int levelNext = levelCurrent; int lineCommentCurrent = GetLineCommentState(styler.GetLineState(lineCurrent)); Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); char chNext = styler[startPos]; int styleNext = styler.StyleIndexAt(startPos); @@ -268,7 +267,6 @@ void FoldWASMDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int /*initStyle lineCurrent++; lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); levelCurrent = levelNext; lineCommentPrev = lineCommentCurrent; lineCommentCurrent = lineCommentNext; diff --git a/scintilla/lexers/LexZig.cxx b/scintilla/lexers/LexZig.cxx index cac7e80083..ea6c8c6d7b 100644 --- a/scintilla/lexers/LexZig.cxx +++ b/scintilla/lexers/LexZig.cxx @@ -359,7 +359,6 @@ void FoldZigDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, L int levelNext = levelCurrent; FoldLineState foldCurrent(styler.GetLineState(lineCurrent)); Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); int visibleChars = 0; while (startPos < endPos) { @@ -402,7 +401,6 @@ void FoldZigDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, L lineCurrent++; lineStartNext = styler.LineStart(lineCurrent + 1); - lineStartNext = sci::min(lineStartNext, endPos); levelCurrent = levelNext; foldPrev = foldCurrent; foldCurrent = foldNext; diff --git a/scintilla/src/EditView.cxx b/scintilla/src/EditView.cxx index 8f7f107813..8736ea092b 100644 --- a/scintilla/src/EditView.cxx +++ b/scintilla/src/EditView.cxx @@ -1840,9 +1840,10 @@ void DrawWrapIndentAndMarker(Surface *surface, const ViewStyle &vsDraw, const Li // is at the end of a text segment. // This function should only be called if iDoc is within the main selection. InSelection CharacterInCursesSelection(Sci::Position iDoc, const EditModel &model, const ViewStyle &vsDraw) noexcept { - const SelectionPosition &posCaret = model.sel.RangeMain().caret; - const bool caretAtStart = posCaret < model.sel.RangeMain().anchor && posCaret.Position() == iDoc; - const bool caretAtEnd = posCaret > model.sel.RangeMain().anchor && + const SelectionRange &rangeMain = model.sel.RangeMain(); + const SelectionPosition &posCaret = rangeMain.caret; + const bool caretAtStart = posCaret < rangeMain.anchor && posCaret.Position() == iDoc; + const bool caretAtEnd = posCaret > rangeMain.anchor && vsDraw.DrawCaretInsideSelection(false, false) && model.pdoc->MovePositionOutsideChar(posCaret.Position() - 1, -1) == iDoc; return (caretAtStart || caretAtEnd) ? InSelection::inNone : InSelection::inMain; @@ -2745,8 +2746,7 @@ void EditView::PaintText(Surface *surfaceWindow, const EditModel &model, const V if ((phasesDraw == PhasesDraw::Multiple) && !bufferedDraw) { phase = DrawPhase::back; } - - while (true) { + for (;;) { int yposScreen = screenLinePaintFirst * vsDraw.lineHeight; int ypos = bufferedDraw ? 0 : yposScreen; const int bottom = static_cast(rcArea.bottom); @@ -2845,7 +2845,7 @@ void EditView::PaintText(Surface *surfaceWindow, const EditModel &model, const V if (phase >= DrawPhase::carets) { break; } - phase = static_cast(static_cast(phase) << 1); + phase = static_cast(static_cast(phase) * 2); } #if defined(TIME_PAINTING) if (durPaint < 0.00000001)