Commit Graph

9 Commits

Author SHA1 Message Date
Ayman Bagabas
517b1a163e
fix: remove unused type 2024-05-06 09:16:14 -04:00
Ayman Bagabas
160ffe826e
fix: cache color profile and background (#212)
* fix: renderer race condition

Guard accessing the underlying Termenv output behind a mutex. Multiple goroutines can set/get the dark background color causing a race condition.

* fix: cache color profile and background

* docs: add comment
2023-08-04 12:58:59 -04:00
Ayman Bagabas
ac8231edce
fix: renderer race condition (#210)
Guard accessing the underlying Termenv output behind a mutex. Multiple goroutines can set/get the dark background color causing a race condition.

Needs: https://github.com/muesli/termenv/pull/146
2023-08-01 08:23:15 -04:00
Ayman Bagabas
7f47f0b5e0 fix(renderer): use termenv default renderer
Creating a _new_ global termenv output clashes with the default global
termenv output leading the terminal to block and freeze.
Share the default termenv output with the global default lipgloss renderer.
2023-03-09 19:38:42 +01:00
Christian Rocha
19ca9a3f8c
docs: renderer documentation (#175)
* docs(readme): add some context to the examples

* docs(readme): revert to render-function-based initial example

* docs(readme): drop extraneous stringer usage

* docs(readme): copyedits

* docs(renderer): minor documentation improvements

* docs(readme): edit renderer section to focus on custom outputs

* docs(readme): for now just use SetString to illustrate stringer

* docs(readme): re-add Ayman's clever stringer example

* docs(examples): tidy up wish example

* docs(examples): improve wish example

* docs(examples): session is an io.Writer

Co-authored-by: Ayman Bagabas <ayman.bagabas@gmail.com>

* docs(examples): add missing pty argument

Co-authored-by: Ayman Bagabas <ayman.bagabas@gmail.com>

* docs(example): remove extra space

* fix(examples): use termenv output

---------

Co-authored-by: Ayman Bagabas <ayman.bagabas@gmail.com>
2023-03-08 14:51:26 -05:00
Ayman Bagabas
c5382b35ef ref(renderer): change renderer impl 2023-03-08 09:54:27 -08:00
Ayman Bagabas
e5401eb8b8 feat(renderer): add WithTermenvOutput option 2023-02-09 11:59:54 -05:00
Ayman Bagabas
b9c2626fe7 feat(renderer): use style renderer
lipgloss.Style now takes a renderer instance to be used to detect styles
and colors based on its termenv.Output and terminal
2023-02-09 11:59:54 -05:00
Ayman Bagabas
31ab45f810 feat: instantiate lipgloss renderers
* Use lipgloss instances instead of a singleton global instance
* Deprecate (s Style).Render & (s Style).String
* Deprecate the Stringer interface
* Update README and godocs
* Update example
2023-02-09 11:59:54 -05:00