Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ScreenContentToStrings ¶
ScreenContentToStrings converts the screen content to a slice of strings. It reads the screen content from the specified range (x1, x2, y1, y2) and converts it to a slice of strings. Each string in the slice represents a row of the screen content.
Parameters:
- screen: tcell.Screen to be converted.
- x1: int, the starting column of the range.
- x2: int, the ending column of the range.
- y1: int, the starting row of the range.
- y2: int, the ending row of the range.
Returns:
- A slice of strings representing the screen content in the specified range.
func ToAnsi ¶
ToAnsi converts the tcell style to an ANSI escape sequence. It handles foreground color, background color, and various text attributes such as bold, italic, underline, etc. The function supports both palette colors and RGB colors for foreground and background.
Parameters:
- style: tcell.Style to be converted.
Returns:
- A string containing the ANSI escape sequence representing the given style.
func TrimRightSpaces ¶
TrimRightSpaces trims trailing spaces from each line of the given screen content strings. ANSI escape sequences are preserved. TrimRightSpaces removes trailing spaces from each line in the given slice of strings. If a line ends with a newline character, it trims spaces before the newline. If the line ends with a specific reset style sequence before the newline, the original lines are returned unmodified. The function preserves the newline character at the end of each line.
Types ¶
This section is empty.