From b50acfc112151c668243b2b814d45631451b3a03 Mon Sep 17 00:00:00 2001 From: Martin Date: Sat, 1 Mar 2025 12:37:15 +0100 Subject: [PATCH] SynEdit: fixed using for-var after loop. --- components/synedit/syneditplugins.pas | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/synedit/syneditplugins.pas b/components/synedit/syneditplugins.pas index 8aff1f9347..f7b5bf2b5b 100644 --- a/components/synedit/syneditplugins.pas +++ b/components/synedit/syneditplugins.pas @@ -439,9 +439,12 @@ begin (CurrentEditor.CaretX -1 <= Length(iString)) then begin iIdentChars := CurrentEditor.IdentChars; - for cCol := CurrentEditor.CaretX -1 downto 1 do + cCol := CurrentEditor.CaretX -1; + while cCol > 0 do begin if not (iString[cCol] in iIdentChars) then break; + dec(cCol); + end; Result := Copy( iString, cCol +1, CurrentEditor.CaretX - cCol -1); end; end;