rivo / tview

Terminal UI library with rich, interactive widgets — written in Golang
MIT License
11.12k stars 576 forks source link

TextArea -> does not have a SetDynamicColors(true) #928

Closed taha-cmyk closed 11 months ago

taha-cmyk commented 11 months ago

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;
rivo commented 11 months ago

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.

digitallyserviced commented 11 months ago

@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

taha-cmyk commented 11 months ago

@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