From 0f3eb95f4b04fbdd4bae9102093fbad8fa2423de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Tue, 31 Oct 2023 13:35:14 +0100 Subject: [PATCH] The component is now deprecated. Raise an error early if we try to load 'gb.eval.highlight' when 'gb.highlight' is loaded. [GB.EVAL.HIGHLIGHT] * NEW: The component is now deprecated. * NEW: Raise an error early if we try to load 'gb.eval.highlight' when 'gb.highlight' is loaded. --- comp/src/gb.eval.highlight/.component | 2 ++ comp/src/gb.eval.highlight/.lang/fr.po | 2 +- comp/src/gb.eval.highlight/.src/Highlight.class | 8 ++++++++ comp/src/gb.eval.highlight/.src/Main.module | 10 +++------- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/comp/src/gb.eval.highlight/.component b/comp/src/gb.eval.highlight/.component index f0f896780..ad04e4d07 100644 --- a/comp/src/gb.eval.highlight/.component +++ b/comp/src/gb.eval.highlight/.component @@ -1,4 +1,6 @@ [Component] Key=gb.eval.highlight Version=3.18.90 +State=3 Requires=gb.eval +Excludes=gb.highlight diff --git a/comp/src/gb.eval.highlight/.lang/fr.po b/comp/src/gb.eval.highlight/.lang/fr.po index cd7f410e6..69e8f26b3 100644 --- a/comp/src/gb.eval.highlight/.lang/fr.po +++ b/comp/src/gb.eval.highlight/.lang/fr.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: gb.eval.highlight 3.16.90\n" -"POT-Creation-Date: 2021-11-05 16:03 UTC\n" +"POT-Creation-Date: 2023-09-23 11:38 UTC\n" "PO-Revision-Date: 2021-11-05 11:54 UTC\n" "Last-Translator: BenoƮt Minisini \n" "Language: fr\n" diff --git a/comp/src/gb.eval.highlight/.src/Highlight.class b/comp/src/gb.eval.highlight/.src/Highlight.class index b1c491dcf..a1b5fd3d8 100644 --- a/comp/src/gb.eval.highlight/.src/Highlight.class +++ b/comp/src/gb.eval.highlight/.src/Highlight.class @@ -7,6 +7,14 @@ Static Property Read Styles As String[] Static Private $aStyles As String[] Static Private $aStyleNames As String[] +Static Public Sub _init() + + If Component.IsLoaded("gb.highlight") Then + Error.Raise("'gb.eval.highlight' component is not compatible with 'gb.highlight'.") + Endif + +End + Static Private Function Styles_Read() As String[] If Not $aStyles Then diff --git a/comp/src/gb.eval.highlight/.src/Main.module b/comp/src/gb.eval.highlight/.src/Main.module index 590158b64..c3b3e24d3 100644 --- a/comp/src/gb.eval.highlight/.src/Main.module +++ b/comp/src/gb.eval.highlight/.src/Main.module @@ -46,12 +46,8 @@ Private Const TAG_CODE As Integer = 1 ' Public Sub Main() - Dim hHighlighter As TextHighlighter - Dim hTheme As TextHighlighterTheme - - hHighlighter = TextHighlighter["gambas"] - hTheme = New TextHighlighterTheme - 'hTheme.Invert() - Print hHighlighter.ToANSI(File.Load("UnitTest/TestProgram"), hTheme) + Highlight.Analyze("Dim I As Integer%>
", True,, True) + Print Highlight.TextAfter; "|" + Print Highlight.LengthBefore End