Commit Graph

295 Commits

Author SHA1 Message Date
Ayman Bagabas
93cd5e0d35
feat: bump minimum go version to 1.18 (#216)
* feat: bump minimum go version to 1.18

* chore: bump go version in build.yml

---------

Co-authored-by: Maas Lalani <maas@lalani.dev>
2023-10-05 12:07:18 -04:00
dependabot[bot]
b766f24d45
feat(deps): bump github.com/mattn/go-runewidth from 0.0.14 to 0.0.15 (#215)
Bumps [github.com/mattn/go-runewidth](https://github.com/mattn/go-runewidth) from 0.0.14 to 0.0.15.
- [Commits](https://github.com/mattn/go-runewidth/compare/v0.0.14...v0.0.15)

---
updated-dependencies:
- dependency-name: github.com/mattn/go-runewidth
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-05 12:01:04 -04:00
nervo
b0eb95dbc1
fix(border): both GetHorizontalBorderSize and GetVerticalBorderSize (#225) 2023-10-05 11:48:38 -04:00
nervo
2d2a577e2d
fix(border): GetBorderRightSize (#224) 2023-10-05 11:45:52 -04:00
dependabot[bot]
18166eaa8a
chore(deps): bump actions/checkout from 3 to 4 (#222) 2023-09-05 11:57:55 +00:00
Ayman Bagabas
07d22725d9
chore(ci): bump workflow actions 2023-08-04 13:49:32 -04:00
dependabot[bot]
7611cdfffe
chore(deps): bump golang.org/x/crypto in /examples (#192)
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.0.0-20220307211146-efcb8507fb70 to 0.1.0.
- [Release notes](https://github.com/golang/crypto/releases)
- [Commits](https://github.com/golang/crypto/commits/v0.1.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-04 12:59:17 -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
Christian Rocha
b3bce2366a
chore(docs): add section about tab conversion (#207) 2023-07-24 12:42:34 -04:00
Christian Rocha
01248034d0
chore(lint): add various nolint directives (#206)
Generally run-of-the-mill directives to disable magic number and exhaustive switches. Reasonings should be self explanatory while reading the code and comments, where applicable.
2023-07-24 11:50:04 -04:00
Christian Rocha
df8b3fa1f2
feat: convert tabs to spaces with Style.TabWidth(int) (#204)
* feat: convert tabs to spaces with Style.TabWidth(int)

By default tabs will be converted to 4 spaces. To disable tab
conversion set Style.TabWidth(NoTabConversion).
2023-07-24 11:22:48 -04:00
Christian Muehlhaeuser
233079e2d9 fix: go mod tidy examples 2023-06-28 17:01:41 +02:00
Carlos Alexandro Becker
3556cdfa89
feat(deps): update termenv (#202)
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-06-27 12:07:45 -03:00
bashbunni
859b49e848
docs: add FAQ (#189)
* docs: add FAQ

* chore(docs): update encoding/locale answer in FAQ

* chore(docs): update color profile disclaimer

* chore(docs): faq copyedits

* chore(docs): additional faq copy edits

* fix(docs): add missing closing code block in faq

---------

Co-authored-by: Christian Rocha <christian@rocha.is>
2023-05-23 11:58:52 -07:00
bashbunni
9bc85709f2
docs: add issue template (#193)
* docs: add issue template

* chore(template): add locale
2023-05-23 11:58:18 -07:00
Ayman Bagabas
97bf676aa0
fix(ci): remove soft-serve workflow 2023-05-12 14:11:20 -04:00
Carlos Alexandro Becker
63540b90ab
docs: update license
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-05-11 12:39:34 +00:00
mieubrisse
7fef6782b8 Undo additions to .gitignore 2023-05-01 09:37:20 -04:00
mieubrisse
4c3e61d4d1 Fix bugs with border size calculation 2023-05-01 09:37:20 -04:00
dependabot[bot]
da2d04b534 chore(deps): bump actions/checkout from 3.4.0 to 3.5.0
Bumps [actions/checkout](https://github.com/actions/checkout) from 3.4.0 to 3.5.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3.4.0...v3.5.0)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-25 08:24:43 +01:00
dependabot[bot]
06dd20ee57 chore(deps): bump actions/checkout from 3.3.0 to 3.4.0
Bumps [actions/checkout](https://github.com/actions/checkout) from 3.3.0 to 3.4.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3.3.0...v3.4.0)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-16 11:05:48 +01:00
dependabot[bot]
403643d322 chore(deps): bump actions/setup-go from 2 to 4
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 2 to 4.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v2...v4)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-16 11:05:16 +01:00
Glenn Gonda
303724f7da
docs: fix typos and clean up comments (#182) 2023-03-12 11:04:42 +01:00
Glenn Gonda
53cc780a5a chore: use io pkg for Discard 2023-03-12 05:26:34 +01:00
Carlos Alexandro Becker
9afe8e2952
fix: retract v0.7.0 (#181)
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2023-03-10 10:28:23 -03:00
Christian Muehlhaeuser
c43b22e00f chore: bump termenv to v0.15.1 2023-03-09 19:54:32 +01: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
b3440ac41f feat(go): bump termenv to v0.15 2023-03-08 09:54:27 -08:00
Ayman Bagabas
c5382b35ef ref(renderer): change renderer impl 2023-03-08 09:54:27 -08:00
László GÖRÖG
d09532a91a chore: unify get border size function names 2023-03-08 09:16:03 -05:00
Ayman Bagabas
4eea195dfa feat(go): upgrade golang to 1.17
feat(examples): upgrade golang to 1.17
2023-03-07 16:44:08 +01:00
István Donkó
1eab58f1d8 docs: fix the description of MaxHeight 2023-03-01 13:58:42 +01:00
Christian Muehlhaeuser
a74950e6da fix: don't concurrently change output profiles
Multiple lipgloss renderer instances can end up using the same default
termenv.Output. This leads to a race condition when manipulating the
ColorProfile concurrently.

We could mutex protect the standard output in termenv, but it feels like
a weak promise, as the rest of the Output wouldn't (and probably
shouldn't) get protected. Protecting it in lipgloss itself would require
a global lock however.

I can't come up with a proper use-case for this scenario, and therefore
we shift this responsibility to the user.
2023-02-22 17:28:33 +01:00
Ayman Bagabas
776c15f0da chore(examples): update ssh example
chore(examples): go mod tidy
2023-02-09 11:59:54 -05:00
Ayman Bagabas
5e2b9055dc docs: update readme 2023-02-09 11:59:54 -05:00
Ayman Bagabas
cb0f2fd931 chore(tests): add more style tests 2023-02-09 11:59:54 -05:00
Ayman Bagabas
60d090659b feat(opts): use style options 2023-02-09 11:59:54 -05:00
Ayman Bagabas
abee24064a docs: update readme example 2023-02-09 11:59:54 -05:00
Ayman Bagabas
29a309cde1 fix: renderer nil check 2023-02-09 11:59:54 -05:00
Ayman Bagabas
53fe53727e feat: conform to the Go color interface
implement RGBA with the default output
2023-02-09 11:59:54 -05:00
Ayman Bagabas
e5401eb8b8 feat(renderer): add WithTermenvOutput option 2023-02-09 11:59:54 -05:00
Ayman Bagabas
4aa1f38785 chore: use unified examples go.mod 2023-02-09 11:59:54 -05:00
Ayman Bagabas
0a35904daa fix(whitespace): style color profile 2023-02-09 11:59:54 -05:00
Ayman Bagabas
8565b7428f fix(whitespace): use position renderer 2023-02-09 11:59:54 -05:00
Ayman Bagabas
3fe14d0547 chore: add ssh example 2023-02-09 11:59:54 -05:00
Ayman Bagabas
6f6b47fbe3 docs: update readme
* add new color types
* more examples
* custom renderer example
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