ansifill

package
v0.65.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 30, 2026 License: MIT Imports: 4 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package ansifill keeps a painted background solid behind nested styles.

Lip Gloss applies a block background by emitting the background sequence at the start of a line and again around padding it adds itself. Any nested style inside the content ends with a reset, which also clears the block background, so every run of text after the first styled span renders on the terminal's default background instead of the modal surface. Re-applying the background after each SGR sequence closes those holes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Code

func Code(value string) string

Code returns the SGR sequence that sets the background to the given color value (any form Lip Gloss accepts). An empty value yields an empty code, which makes Lines a no-op.

func Lines

func Lines(content, bgCode string, width int) string

Lines re-applies bgCode after every SGR sequence on every line so nested styles cannot punch holes in the surface behind text. When width is positive each line is also padded to that visual width with the background applied, which is what a host-owned chrome renderer needs: it pads short lines with unstyled spaces of its own otherwise.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL