rivo / tview

Terminal UI library with rich, interactive widgets — written in Golang

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TextArea -> does not have a SetDynamicColors(true)

taha-cmyk opened this issue · comments

How to implement Dynamic Colors in TextArea
my case : i want to implement a syntax highlighting for C language but it render color flags as strings not ANSI

#include<studio.h>

struct typeof {
 int size;
}Token;

OUTPUT IN TextArea

#include<studio.h>

[red]struct[-] typeof {
 [red]int[-] size;
}Token;
commented

TextArea does not support syntax highlighting. That was never within the planned scope. You might have some luck with external tview widgets. Maybe an issue search will turn something up.

For read-only text, TextView supports coloured text, of course.

@rivo sorry for bumping closed thread, just information for @taha-cmyk

There is a widget from pgavlin that I have forked and updated the color handling and re-added some features back that were stripped out.

The editor is an old version of the micro editor's main text view for code editing with syntax highlighting enabled, albeit in a rather simplistic form. It is fairly simple to use, both repo's linked below have example usages.

image

digitallyserviced/femto and pgavlin/femto

@rivo sorry for bumping closed thread, just information for @taha-cmyk

There is a widget from pgavlin that I have forked and updated the color handling and re-added some features back that were stripped out.

The editor is an old version of the micro editor's main text view for code editing with syntax highlighting enabled, albeit in a rather simplistic form. It is fairly simple to use, both repo's linked below have example usages.

image

digitallyserviced/femto and pgavlin/femto

Thank u for that , I really appreciate it