diff --git a/comp/src/gb.eval.highlight/.component b/comp/src/gb.eval.highlight/.component index f6e76aeeb..516676bc3 100644 --- a/comp/src/gb.eval.highlight/.component +++ b/comp/src/gb.eval.highlight/.component @@ -1,4 +1,4 @@ [Component] Key=gb.eval.highlight -Version=3.12.90 +Version=3.13.90 Requires=gb.eval diff --git a/comp/src/gb.eval.highlight/.project b/comp/src/gb.eval.highlight/.project index 9f4248414..fb951af32 100644 --- a/comp/src/gb.eval.highlight/.project +++ b/comp/src/gb.eval.highlight/.project @@ -1,7 +1,7 @@ # Gambas Project File 3.0 Title=gb.eval.highlight Startup=Main -Version=3.12.90 +Version=3.13.90 VersionFile=1 Component=gb.eval Component=gb.net diff --git a/comp/src/gb.eval.highlight/.src/TextHighlighter.class b/comp/src/gb.eval.highlight/.src/TextHighlighter.class index 82a75206d..b2c4c003f 100644 --- a/comp/src/gb.eval.highlight/.src/TextHighlighter.class +++ b/comp/src/gb.eval.highlight/.src/TextHighlighter.class @@ -146,8 +146,8 @@ Public Sub ToHTML(Text As String, Optional Styles As TextHighlighterStyle[]) As If hStyle.Underline Then sHtml = "" & sHtml & "" sStyle = "" - If bAlt Then sStyle &= "background:#E0E0E0;" - If hStyle.Color Then sStyle &= "color:#" & Hex$(hStyle.Color, 6) + If bAlt Then sStyle &= "background:#" & Hex$(Styles[Highlight.Alternate], 6) & ";" + If hStyle.Color Then sStyle &= "color:#" & Hex$(hStyle.Color, 6) & ";" If sStyle <> sOldStyle Then sOldStyle = sStyle @@ -206,6 +206,7 @@ Static Private Function DefaultStyle_Read() As TextHighlighterStyle[] $aStyle[Highlight.Escape] = TextHighlighterStyle(&H7F0000&, False, True) $aStyle[Highlight.Label] = TextHighlighterStyle(&H000000&, False, True) $aStyle[Highlight.Constant] = TextHighlighterStyle(&HA00000&, True) + $aStyle[Highlight.Alternate] = TextHighlighterStyle(&HA00000&, True) Endif diff --git a/comp/src/gb.form.editor/.project b/comp/src/gb.form.editor/.project index 2962ec940..cd69e236b 100644 --- a/comp/src/gb.form.editor/.project +++ b/comp/src/gb.form.editor/.project @@ -1,7 +1,6 @@ # Gambas Project File 3.0 Title=Text editor with syntax highlighting Startup=FTestEditor -Profiling=1 Icon=.hidden/control/texteditor.png Version=3.13.90 VersionFile=1 diff --git a/comp/src/gb.form.editor/.src/TextEditor.class b/comp/src/gb.form.editor/.src/TextEditor.class index 9e3bed133..223eaf4ab 100644 --- a/comp/src/gb.form.editor/.src/TextEditor.class +++ b/comp/src/gb.form.editor/.src/TextEditor.class @@ -520,9 +520,11 @@ Private Sub DrawMatch(X As Integer, Y As Integer, H As Integer, XM As Integer, Y Dim XY As Point Dim WW As Integer + If Not $bShowCursor Then Return XY = LinePos(YM, XM) WW = TextWidth($hDoc.Lines[YM], XM + 1, 1) - Paint.FillRect(X + XY.X, Y + XY.Y + H - 1, WW, 1, $iForeground) + 'Paint.FillRect(X + XY.X, Y + XY.Y + H - 1, WW, 1, $iForeground) + Paint.FillRect(X + XY.X, Y + XY.Y, WW, H, $iMatchColor) End @@ -643,7 +645,7 @@ Private Sub DrawHighlightedText(Row As Integer, sText As String, aColor As Byte[ iBg = hStyle.Background If iBg <> Color.Default Then Paint.FillRect(XX, YY, X2 - XX, H, iBg) - If bAlt Then Paint.FillRect(XX, YY, X2 - XX, H, Color.SetAlpha(&HD0D0D0&, 192)) + If bAlt Then Paint.FillRect(XX, YY, X2 - XX, H, Color.SetAlpha(aStyle[Highlight.Alternate].Color, 192)) sStr = String.Mid$(sText, P + 1, iLen) ' If hStyle.Bold Then @@ -1390,6 +1392,10 @@ Public Sub TimerCursor_Timer() If $bMouseDown Then Return $bShowCursor = Not $bShowCursor _RefreshLine($Y) + If $YM >= 0 Then + If $YM <> $Y Then _RefreshLine($YM) + If $YMO <> $Y Then _RefreshLine($YMO) + Endif End @@ -1732,6 +1738,7 @@ Public Sub Goto(NX As Integer, NY As Integer, Optional Mark As Boolean) Endif $bShowCursor = True + $hTimerCursor.Restart If Not $bReadOnly Then $hTimerCursor.Start CheckMatch diff --git a/comp/src/gb.form.editor/.src/_TextEditor_Styles.class b/comp/src/gb.form.editor/.src/_TextEditor_Styles.class index 8c91ef8fd..215212796 100644 --- a/comp/src/gb.form.editor/.src/_TextEditor_Styles.class +++ b/comp/src/gb.form.editor/.src/_TextEditor_Styles.class @@ -31,6 +31,7 @@ Public Sub _new() $aStyle[Highlight.Escape] = New TextEditorStyle(&H7F0000&, True, False, True) As "Style" $aStyle[Highlight.Label] = New TextEditorStyle(Color.Black, False, False, True) As "Style" $aStyle[Highlight.Constant] = New TextEditorStyle(&HA00000&, True) As "Style" + $aStyle[Highlight.Alternate] = New TextEditorStyle(&HE0E0E0&) As "Style" End diff --git a/main/lib/eval/c_highlight.c b/main/lib/eval/c_highlight.c index bad85de62..51d0a1286 100644 --- a/main/lib/eval/c_highlight.c +++ b/main/lib/eval/c_highlight.c @@ -268,13 +268,6 @@ BEGIN_PROPERTY(Highlight_TextAfter) END_PROPERTY -BEGIN_PROPERTY(Highlight_Alternate) - - GB.Deprecated("gb.eval", "Highlight.Alternate", NULL); - GB.ReturnInteger(-1); - -END_PROPERTY - GB_DESC CHighlightDesc[] = { GB_DECLARE("Highlight", 0), GB_VIRTUAL_CLASS(), @@ -300,10 +293,9 @@ GB_DESC CHighlightDesc[] = GB_CONSTANT("Escape", "i", HIGHLIGHT_ESCAPE), GB_CONSTANT("Label", "i", HIGHLIGHT_LABEL), GB_CONSTANT("Constant", "i", HIGHLIGHT_CONSTANT), + GB_CONSTANT("Alternate", "i", HIGHLIGHT_ALTERNATE), GB_CONSTANT("Custom", "i", HIGHLIGHT_NUM_COLOR), - GB_STATIC_PROPERTY_READ("Alternate", "i", Highlight_Alternate), - GB_STATIC_METHOD("_exit", NULL, Highlight_exit, NULL), GB_STATIC_METHOD("Analyze", "String[]", Highlight_Analyze, "(Code)s[(Rewrite)b(State)i]"), GB_STATIC_PROPERTY_READ("Symbols", "String[]", Highlight_Symbols), diff --git a/main/lib/eval/gb.eval.h b/main/lib/eval/gb.eval.h index 2ddd602b7..68a020c28 100644 --- a/main/lib/eval/gb.eval.h +++ b/main/lib/eval/gb.eval.h @@ -96,6 +96,7 @@ typedef HIGHLIGHT_ESCAPE, HIGHLIGHT_LABEL, HIGHLIGHT_CONSTANT, + HIGHLIGHT_ALTERNATE, HIGHLIGHT_NUM_COLOR } HIGHLIGHT_COLOR;