No_coor Reads Not in a Single Block at the End 4 -1

Quality-of-Life Updates

This release includes a menagerie of modest simply useful and handy improvements.

Automatic Wrapping for Long Words

Occasionally you lot'll have a word (oftentimes a URL or a path) that runs wider than the Width() you set on a style:

            // style.Width(5) ╭───────────╮ │Schnurrbart│ ╰───────────╯ // ... that is definitely more than 5 cells wide                      

Such words will now automatically wrap:

            // manner.Width(5) ╭─────╮ │Schnu│ │rrbar│ │t    │ ╰─────╯ // In that location we go                      

For details, meet the respective PR.

Query Borders and Whitespace

Sometimes y'all demand to measure borders and whitespace when calculating your layouts and y'all end up with code like this:

            const            horizontalPadding            =            six            style.Copy().Width(windowWidth            -            horizontalPadding)

This update includes a multitude of methods for querying your styles so y'all can do away with unnecessary constants and magic numbers. For example:

            style.Copy().Width(windowWidth            -            way.GetHorizontalPadding())

The near useful of these methods are perhaps the ones that allow you lot query margins, borders and padding all at in one case:

  • Mode.GetFrameSize() (x, y int)
  • Style.GetVerticalFrameSize() int
  • Style.GetHorizontalFrameSize() int

For details run across the changelog below.

Improved Automatic Color Degradation

  • Amend colour conversions when automatically degrading a color profile (for example, when coercing from TrueColor to ANSI256).

The Mystical Hidden Border

At first glance a subconscious border seems silly. Hidden borders can be useful, however, if you want to remove a border but maintain layout positioning in, say, an interactive TUI. Also note that you can still utilize a background colour to a hidden border.

To make a hidden border simply call lipgloss.HiddenBorder().


Changelog

Inverse

  • Words wider than a style'south Width() at present wrap automatically
  • Update termenv for improved color space for color profile conversions (it now uses the first-class HSLuv color infinite)

New

  • HiddenBorder(), which renders a border comprised of spaces
  • Style-level methods for querying borders and whitespace:
    • Borders:
      • Style.GetBorderTopSize() int
      • Style.GetBorderRightSize() int
      • Style.GetBorderBottomSize() int
      • Mode.GetBorderLeftSize() int
      • Fashion.GetHorizontalBorderSize() int
      • Manner.GetVerticalBorderSize() int
    • Margins:
      • Style.GetMarginTop() int
      • Style.GetMarginRight() int
      • Manner.GetMarginBottom() int
      • Style.GetMarginLeft() int
      • Fashion.GetHorizontalMargins() int
      • Style.GetVerticalMargins() int
    • Padding:
      • Style.GetPaddingTop() int
      • Mode.GetPaddingRight() int
      • Style.GetPaddingBottom() int
      • Style.GetPaddingLeft() int
      • Style.GetHorizontalPadding() int
      • Style.GetVerticalPadding() int
    • Get horizontal margins, padding, and border widths all at in one case:
      • Style.GetVerticalFrameSize() int
      • Fashion.GetHorizontalFrameSize() int
      • Style.GetFrameSize() (x, y int)
  • Border-level size querying methods:
    • Border.GetTopSize() int
    • Border.GetRightSize() int
    • Border.GetBottomSize() int
    • Edge.GetLeftSize() int

Thoughts? Questions? Nosotros love hearing from yous. Experience free to reach out on Twitter, The Fediverse or right here in GitHub Discussions.

The Charm logo

ruizhispers.blogspot.com

Source: https://github.com/charmbracelet/lipgloss/releases

0 Response to "No_coor Reads Not in a Single Block at the End 4 -1"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel