[GH-ISSUE #928] TextArea -> does not have a SetDynamicColors(true) #678

Closed
opened 2026-03-04 01:06:58 +03:00 by kerem · 2 comments
Owner

Originally created by @taha-cmyk on GitHub (Dec 12, 2023).
Original GitHub issue: https://github.com/rivo/tview/issues/928

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;
Originally created by @taha-cmyk on GitHub (Dec 12, 2023). Original GitHub issue: https://github.com/rivo/tview/issues/928 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; ```
kerem closed this issue 2026-03-04 01:06:58 +03:00
Author
Owner

@rivo commented on GitHub (Dec 12, 2023):

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.

<!-- gh-comment-id:1852053550 --> @rivo commented on GitHub (Dec 12, 2023): `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.
Author
Owner

@taha-cmyk commented on GitHub (Dec 18, 2023):

@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

<!-- gh-comment-id:1861462806 --> @taha-cmyk commented on GitHub (Dec 18, 2023): > @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](https://github.com/rivo/tview/assets/1828125/93364462-d629-4bc3-86ce-c51d87e3b09c) > > [digitallyserviced/femto](https://github.com/digitallyserviced/femto) and [pgavlin/femto](https://github.com/pgavlin/femto) > Thank u for that , I really appreciate it
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tview#678
No description provided.