Documentation
¶
Index ¶
- Constants
- func NewScrollPositionFromIndex(index linemetadata.Index, name string) scrollPosition
- func PanicHandler(goroutineName string, recoverResult any, stackTrace []byte)
- func TermcapToStyle(termcap string) (twin.Style, error)
- type FilteringReader
- type Pager
- type PagerMode
- type PagerModeFilter
- type PagerModeGotoLine
- type PagerModeJumpToMark
- type PagerModeMark
- type PagerModeNotFound
- type PagerModeSearch
- type PagerModeViewing
- type SearchDirection
- type StatusBarOption
Constants ¶
View Source
const NO_BREAK_SPACE = '\xa0'
Variables ¶
This section is empty.
Functions ¶
func NewScrollPositionFromIndex ¶ added in v1.32.0
func NewScrollPositionFromIndex(index linemetadata.Index, name string) scrollPosition
Create a new position, scrolled to the given line number
func PanicHandler ¶ added in v1.33.0
Types ¶
type FilteringReader ¶ added in v1.32.0
type FilteringReader struct {
BackingReader reader.Reader
// This is a reference to a reference so that we can track changes to the
// original pattern, including if it is set to nil.
FilterPattern **regexp.Regexp
// contains filtered or unexported fields
}
func (*FilteringReader) GetLine ¶ added in v1.32.0
func (f *FilteringReader) GetLine(index linemetadata.Index) *reader.NumberedLine
func (*FilteringReader) GetLineCount ¶ added in v1.32.0
func (f *FilteringReader) GetLineCount() int
func (*FilteringReader) GetLines ¶ added in v1.32.0
func (f *FilteringReader) GetLines(firstLine linemetadata.Index, wantedLineCount int) *reader.InputLines
func (*FilteringReader) ShouldShowLineCount ¶ added in v1.33.0
func (f *FilteringReader) ShouldShowLineCount() bool
type Pager ¶
type Pager struct {
// NewPager shows lines by default, this field can hide them
ShowLineNumbers bool
StatusBarStyle StatusBarOption
ShowStatusBar bool
UnprintableStyle textstyles.UnprintableStyleT
WrapLongLines bool
// Ref: https://github.com/walles/moar/issues/113
QuitIfOneScreen bool
// Ref: https://github.com/walles/moar/issues/94
ScrollLeftHint twin.StyledRune
ScrollRightHint twin.StyledRune
SideScrollAmount int // Should be positive
// If non-nil, scroll to this line as soon as possible. Set this value to
// IndexMax() to follow the end of the input (tail).
//
// NOTE: Always use setTargetLine() to keep the reader in sync with the
// pager!
TargetLine *linemetadata.Index
// If true, pager will clear the screen on return. If false, pager will
// clear the last line, and show the cursor.
DeInit bool
// If DeInit is false, leave this number of lines for the shell prompt after
// exiting
DeInitFalseMargin int
WithTerminalFg bool // If true, don't set linePrefix
AfterExit func() error
// contains filtered or unexported fields
}
Pager is the main on-screen pager
func NewPager ¶
func NewPager(r *reader.ReaderImpl) *Pager
NewPager creates a new Pager with default settings
func (*Pager) ReprintAfterExit ¶ added in v1.8.4
After the pager has exited and the normal screen has been restored, you can call this method to print the pager contents to screen again, faking "leaving" pager contents on screen after exit.
type PagerMode ¶ added in v1.22.0
type PagerMode interface {
// contains filtered or unexported methods
}
type PagerModeFilter ¶ added in v1.32.0
type PagerModeFilter struct {
// contains filtered or unexported fields
}
type PagerModeGotoLine ¶ added in v1.22.0
type PagerModeGotoLine struct {
// contains filtered or unexported fields
}
type PagerModeJumpToMark ¶ added in v1.22.0
type PagerModeJumpToMark struct {
// contains filtered or unexported fields
}
type PagerModeMark ¶ added in v1.22.0
type PagerModeMark struct {
// contains filtered or unexported fields
}
type PagerModeNotFound ¶ added in v1.22.0
type PagerModeNotFound struct {
// contains filtered or unexported fields
}
type PagerModeSearch ¶ added in v1.22.0
type PagerModeSearch struct {
// contains filtered or unexported fields
}
type PagerModeViewing ¶ added in v1.22.0
type PagerModeViewing struct {
// contains filtered or unexported fields
}
type SearchDirection ¶ added in v1.32.0
type SearchDirection int
const ( SearchDirectionForward SearchDirection = iota SearchDirectionBackward )
type StatusBarOption ¶ added in v1.20.0
type StatusBarOption int
const ( //revive:disable-next-line:var-naming STATUSBAR_STYLE_INVERSE StatusBarOption = iota //revive:disable-next-line:var-naming STATUSBAR_STYLE_PLAIN //revive:disable-next-line:var-naming STATUSBAR_STYLE_BOLD )
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
This package handles styled strings.
|
This package handles styled strings. |
Click to show internal directories.
Click to hide internal directories.