diff --git a/ide/weditor.pas b/ide/weditor.pas index 3616989fb8..77f52808f8 100644 --- a/ide/weditor.pas +++ b/ide/weditor.pas @@ -6805,8 +6805,7 @@ begin S:=GetLineText(Line); { Remove all traling spaces PM } if not Editor^.IsFlagSet(efKeepTrailingSpaces) then - While (Length(S)>0) and (S[Length(S)]=' ') do - Dec(S[0]); + s:=RTrim(S); { if FlagSet(efUseTabCharacters) then S:=CompressUsingTabs(S,TabSize); }