From 5c1e94e909a187cb42e9e50d5668600798a80891 Mon Sep 17 00:00:00 2001 From: mattias Date: Sat, 22 Aug 2009 22:44:23 +0000 Subject: [PATCH] IDE: code help: fixed conversion of line endings to unix line endings git-svn-id: trunk@21412 - --- ide/codehelp.pas | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/ide/codehelp.pas b/ide/codehelp.pas index 388533ccdc..c89f72ac06 100644 --- a/ide/codehelp.pas +++ b/ide/codehelp.pas @@ -319,20 +319,21 @@ var begin Result:=s; p:=1; - while (p<=length(s)) do begin - if not (s[p] in [#10,#13]) then begin - inc(p); - end else begin - // line ending - if (ps[p+1]) then begin + while (p<=length(Result)) do begin + case Result[p] of + #10: + if (pResult[p+1]) then begin // double character line ending - Result:=copy(Result,1,p-1)+#10+copy(Result,p+2,length(Result)); - end else if s[p]=#13 then begin + System.Delete(Result,p,2); + end; + #13: + begin // single char line ending #13 Result[p]:=#10; end; - inc(p); end; + inc(p); end; end;