From 8781fcb5f4d31f4ae9fe57009657f4804be2476c Mon Sep 17 00:00:00 2001 From: Juha Date: Sun, 23 Jan 2022 12:04:16 +0200 Subject: [PATCH] =?UTF-8?q?Codetools:=20Complete=20code=20correctly=20for?= =?UTF-8?q?=20"procedure=20xxx;=20forward;".=20Issue=20#39510,=20patch=20b?= =?UTF-8?q?y=20Domingo=20Galm=C3=A9s.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit dfa66431c4f77563e9aa74e182dce4294175b2b3) --- components/codetools/codecompletiontool.pas | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/codetools/codecompletiontool.pas b/components/codetools/codecompletiontool.pas index 3e4ddead03..fd2d4d9453 100644 --- a/components/codetools/codecompletiontool.pas +++ b/components/codetools/codecompletiontool.pas @@ -1009,7 +1009,8 @@ begin while (NearestProcNode.NextBrother<>nil) do NearestProcNode:=NearestProcNode.NextBrother; if NearestProcNode<>nil then begin - SetIndentAndInsertPos(NearestProcNode,true); + // don't insert after "begin end." block in program. Issue #39510 + SetIndentAndInsertPos(NearestProcNode, NearestProcNode.Desc<>ctnBeginBlock); exit; end;