From 20ef73bb57cc7b9ec9e064011cdb9fe463d6c1a2 Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Wed, 12 Aug 2015 13:12:19 +0200 Subject: [PATCH] ddoc comments, ignore a line that starts with 'ditto' and optionally a period. --- src/ce_dcd.pas | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ce_dcd.pas b/src/ce_dcd.pas index 898418ee..1887992f 100644 --- a/src/ce_dcd.pas +++ b/src/ce_dcd.pas @@ -337,6 +337,7 @@ end; procedure TCEDcdWrapper.getDdocFromCursor(out aComment: string); var i: Integer; + str: string; begin if not fAvailable then exit; if not fServerListening then exit; @@ -361,8 +362,12 @@ begin fTempLines.LoadFromStream(fClient.Output); if fTempLines.Count = 0 then updateServerlistening; - for i := 0 to fTempLines.Count-1 do - aComment += ReplaceStr(fTempLines.Strings[i], '\n', LineEnding); + for str in fTempLines do + begin + if (length(str) < 9) and AnsiSameText(str[1..5], 'DITTO') then + continue; + aComment += ReplaceStr(str, '\n', LineEnding); + end; end; procedure TCEDcdWrapper.getDeclFromCursor(out aFilename: string; out aPosition: Integer);