@@ -70,6 +70,8 @@ const (
7070 TextAttrValue
7171 TextTag
7272 Type
73+ CurlyBracket
74+ IncludeSystem
7375)
7476
7577// TextConfig holds the Text class configuration to be used by annotators when highlighting code.
@@ -79,8 +81,10 @@ type TextConfig struct {
7981 AssemblyEnd string
8082 Class string
8183 Comment string
84+ CurlyBracket string
8285 Decimal string
8386 Dollar string
87+ IncludeSystem string
8488 Keyword string
8589 Literal string
8690 Mut string
@@ -118,8 +122,10 @@ var DefaultTextConfig = TextConfig{
118122 AssemblyEnd : "lightyellow" ,
119123 Class : "white" ,
120124 Comment : "darkgray" ,
125+ CurlyBracket : "red" ,
121126 Decimal : "red" ,
122127 Dollar : "white" ,
128+ IncludeSystem : "red" ,
123129 Keyword : "red" ,
124130 Literal : "white" ,
125131 Mut : "magenta" ,
@@ -191,6 +197,10 @@ func (c TextConfig) GetClass(kind Kind) string {
191197 return c .AssemblyEnd
192198 case Mut :
193199 return c .Mut
200+ case CurlyBracket :
201+ return c .CurlyBracket
202+ case IncludeSystem :
203+ return c .IncludeSystem
194204 }
195205 return ""
196206}
@@ -259,9 +269,10 @@ func Print(s *scanner.Scanner, w io.Writer, p Printer, m mode.Mode) error {
259269 }
260270 }
261271 inComment := false
272+ inInclude := false
262273 for tok := s .Scan (); tok != scanner .EOF ; tok = s .Scan () {
263274 tokText := s .TokenText ()
264- if err := p .Print (w , tokenKind (tok , tokText , & inComment , m ), tokText ); err != nil {
275+ if err := p .Print (w , tokenKind (tok , tokText , & inComment , & inInclude , m ), tokText ); err != nil {
265276 return err
266277 }
267278 }
@@ -901,15 +912,15 @@ func (e *Editor) WriteLines(c *vt.Canvas, fromline, toline LineIndex, cx, cy uin
901912 if inSelection {
902913 c .WriteWideRuneBNoLock (tx , ty , e .NanoHelpForeground , e .NanoHelpBackground , letter )
903914 } else if highlightCurrentLine && (e .highlightCurrentText || e .highlightCurrentLine ) {
904- c .WriteWideRuneBNoLock (tx , ty , e .HighlightForeground , e .HighlightBackground , letter )
915+ c .WriteWideRuneBNoLock (tx , ty , e .HighlightForeground , e .Background , letter )
905916 } else {
906917 c .WriteWideRuneBNoLock (tx , ty , fg , bg , letter )
907918 }
908919 } else if rw <= 1 {
909920 if inSelection {
910921 c .WriteRuneBNoLock (tx , ty , e .NanoHelpForeground , e .NanoHelpBackground , letter )
911922 } else if highlightCurrentLine && (e .highlightCurrentText || e .highlightCurrentLine ) {
912- c .WriteRuneBNoLock (tx , ty , e .HighlightForeground , e .HighlightBackground , letter )
923+ c .WriteRuneBNoLock (tx , ty , e .HighlightForeground , e .Background , letter )
913924 } else {
914925 c .WriteRuneBNoLock (tx , ty , fg , bg , letter )
915926 }
@@ -945,7 +956,7 @@ func (e *Editor) WriteLines(c *vt.Canvas, fromline, toline LineIndex, cx, cy uin
945956 xp = cx + lineRuneCount
946957 if int (cw - lineRuneCount ) > 0 {
947958 if highlightCurrentLine && e .highlightCurrentLine {
948- c .WriteRunesB (xp , yp , e .HighlightForeground , e .HighlightBackground , ' ' , cw - lineRuneCount )
959+ c .WriteRunesB (xp , yp , e .HighlightForeground , e .Background , ' ' , cw - lineRuneCount )
949960 } else {
950961 c .WriteRunesB (xp , yp , e .Foreground , bg , ' ' , cw - lineRuneCount )
951962 }
0 commit comments