From 3aeac6048a777fa6e27170e1babf6428ee2918a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D0=BE=D0=BD=D0=B4=D0=B0=D1=80=D0=B5=D0=B2=20=D0=98?= =?UTF-8?q?=D0=B2=D0=B0=D0=BD?= Date: Mon, 17 Sep 2018 21:13:46 +0200 Subject: [PATCH] fix #1206 --- .../CodeCompletionHighlighter.cs | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/VisualPascalABCNET/IB/CodeCompletion/CodeCompletionHighlighter.cs b/VisualPascalABCNET/IB/CodeCompletion/CodeCompletionHighlighter.cs index fd928d6cc..c194f73da 100644 --- a/VisualPascalABCNET/IB/CodeCompletion/CodeCompletionHighlighter.cs +++ b/VisualPascalABCNET/IB/CodeCompletion/CodeCompletionHighlighter.cs @@ -51,6 +51,8 @@ namespace VisualPascalABC { if (isClassMember(beg_off, textArea)) return; + if (isClassPredefinition(end_off, textArea)) + return; } TmpPos end_pos = GetPositionOfEnd(textArea, end_off); if (end_pos != null) @@ -112,6 +114,34 @@ namespace VisualPascalABC return true; } + private static bool isClassPredefinition(int end_off, TextArea textArea) + { + int off = end_off; + if (off >= textArea.Document.TextContent.Length) + return true; + char c = textArea.Document.TextContent[off]; + while (char.IsWhiteSpace(c) || c == '{') + { + if (c == '{') + { + while (c != '}') + { + off++; + if (off >= textArea.Document.TextContent.Length) + break; + c = textArea.Document.TextContent[off]; + } + } + off++; + if (off >= textArea.Document.TextContent.Length) + break; + c = textArea.Document.TextContent[off]; + } + if (c == ';') + return true; + return false; + } + private static bool isClassMember(int beg_off, TextArea textArea) { int off = beg_off - 1;