escapefilter

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EscapeFilter

type EscapeFilter struct {
	// contains filtered or unexported fields
}

EscapeFilter stores virtual screen and process text files contains ANSI escape code.

func New

func New() *EscapeFilter

New returns a new EscapeFilter.

func (*EscapeFilter) Load

func (f *EscapeFilter) Load(rd io.Reader) error

Load loads contents from the Reader.

func (*EscapeFilter) String

func (f *EscapeFilter) String() string

String returns the current screen content.

type Screen

type Screen struct {
	// contains filtered or unexported fields
}

Screen stores character content and a cursor position.

func NewScreen

func NewScreen() *Screen

NewScreen returns a new empty Screen.

func (*Screen) Col

func (s *Screen) Col() int

Col returns the current col position (1-based).

func (*Screen) EraseLine

func (s *Screen) EraseLine()

EraseLineBefore erases characters in the current row.

func (*Screen) EraseLineAfter

func (s *Screen) EraseLineAfter()

EraseLineAfter erases characters from the current position to the end of the line.

func (*Screen) EraseLineBefore

func (s *Screen) EraseLineBefore()

EraseLineBefore erases characters from the current position to the beginning of the line.

func (*Screen) EraseScreen

func (s *Screen) EraseScreen()

EraseScreen erases characters in the entire screen.

func (*Screen) EraseScreenAfter

func (s *Screen) EraseScreenAfter()

EraseScreenAfter erases characters from the current position to the end of the screen.

func (*Screen) EraseScreenBefore

func (s *Screen) EraseScreenBefore()

EraseScreenBefore erases characters from the current position to the beginning of the screen.

func (*Screen) MoveCursor

func (s *Screen) MoveCursor(row int, col int)

MoveCursor moves the cursor position to (row, col).

func (*Screen) NextTabStop

func (s *Screen) NextTabStop(n int) int

NextTabStop returns the n-th next tab stop from the current position.

func (*Screen) PrevTabStop

func (s *Screen) PrevTabStop(n int) int

PrevTabStop returns the n-th last tab stop from the current position.

func (*Screen) PutRune

func (s *Screen) PutRune(r rune)

PutRune puts a rune to the screen.

func (*Screen) Row

func (s *Screen) Row() int

Row returns the current row position (1-based).

func (*Screen) String

func (s *Screen) String() string

String returns string content of the screen. If the cursor is farther than the end of the content, additional lines and spaces will be added.

Jump to

Keyboard shortcuts

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