display

package
v1.4.2-0...-d7b39fe Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2020 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetStatusInfoFnLua

func SetStatusInfoFnLua(fn string)

Types

type BWindow

type BWindow interface {
	Window
	SetBuffer(b *buffer.Buffer)
}

type BufWindow

type BufWindow struct {
	*View

	// Buffer being shown in this window
	Buf *buffer.Buffer
	// contains filtered or unexported fields
}

The BufWindow provides a way of displaying a certain section of a buffer

func NewBufWindow

func NewBufWindow(x, y, width, height int, buf *buffer.Buffer) *BufWindow

NewBufWindow creates a new window at a location in the screen with a width and height

func (*BufWindow) Bottomline

func (w *BufWindow) Bottomline() int

Bottomline returns the line number of the lowest line in the view You might think that this is obviously just v.StartLine + v.Height but if softwrap is enabled things get complicated since one buffer line can take up multiple lines in the view

func (*BufWindow) Clear

func (w *BufWindow) Clear()

Clear resets all cells in this window to the default style

func (*BufWindow) Display

func (w *BufWindow) Display()

Display displays the buffer and the statusline

func (*BufWindow) GetView

func (w *BufWindow) GetView() *View

func (*BufWindow) IsActive

func (w *BufWindow) IsActive() bool

func (*BufWindow) LocFromVisual

func (w *BufWindow) LocFromVisual(svloc buffer.Loc) buffer.Loc

LocFromVisual takes a visual location (x and y position) and returns the position in the buffer corresponding to the visual location Computing the buffer location requires essentially drawing the entire screen to account for complications like softwrap, wide characters, and horizontal scrolling If the requested position does not correspond to a buffer location it returns the nearest position

func (*BufWindow) Relocate

func (w *BufWindow) Relocate() bool

Relocate moves the view window so that the cursor is in view This is useful if the user has scrolled far away, and then starts typing Returns true if the window location is moved

func (*BufWindow) Resize

func (w *BufWindow) Resize(width, height int)

func (*BufWindow) SetActive

func (w *BufWindow) SetActive(b bool)

func (*BufWindow) SetBuffer

func (w *BufWindow) SetBuffer(b *buffer.Buffer)

func (*BufWindow) SetView

func (w *BufWindow) SetView(view *View)

type InfoWindow

type InfoWindow struct {
	*info.InfoBuf
	*View
}

func NewInfoWindow

func NewInfoWindow(b *info.InfoBuf) *InfoWindow

func (*InfoWindow) Clear

func (i *InfoWindow) Clear()

func (*InfoWindow) Display

func (i *InfoWindow) Display()

func (*InfoWindow) GetView

func (i *InfoWindow) GetView() *View

func (*InfoWindow) IsActive

func (i *InfoWindow) IsActive() bool

func (*InfoWindow) LocFromVisual

func (i *InfoWindow) LocFromVisual(vloc buffer.Loc) buffer.Loc

func (*InfoWindow) Relocate

func (i *InfoWindow) Relocate() bool

func (*InfoWindow) Resize

func (i *InfoWindow) Resize(w, h int)

func (*InfoWindow) SetActive

func (i *InfoWindow) SetActive(b bool)

func (*InfoWindow) SetBuffer

func (i *InfoWindow) SetBuffer(b *buffer.Buffer)

func (*InfoWindow) SetView

func (i *InfoWindow) SetView(v *View)

type StatusLine

type StatusLine struct {
	Info map[string]func(*buffer.Buffer) string
	// contains filtered or unexported fields
}

StatusLine represents the information line at the bottom of each window It gives information such as filename, whether the file has been modified, filetype, cursor location

func NewStatusLine

func NewStatusLine(win *BufWindow) *StatusLine

NewStatusLine returns a statusline bound to a window

func (*StatusLine) Display

func (s *StatusLine) Display()

Display draws the statusline to the screen

func (*StatusLine) FindOpt

func (s *StatusLine) FindOpt(opt string) interface{}

FindOpt finds a given option in the current buffer's settings

type TabWindow

type TabWindow struct {
	Names []string

	Y int
	// contains filtered or unexported fields
}

func NewTabWindow

func NewTabWindow(w int, y int) *TabWindow

func (*TabWindow) Active

func (w *TabWindow) Active() int

func (*TabWindow) Display

func (w *TabWindow) Display()

func (*TabWindow) LocFromVisual

func (w *TabWindow) LocFromVisual(vloc buffer.Loc) int

func (*TabWindow) Scroll

func (w *TabWindow) Scroll(amt int)

func (*TabWindow) SetActive

func (w *TabWindow) SetActive(a int)

func (*TabWindow) TotalSize

func (w *TabWindow) TotalSize() int

type TermWindow

type TermWindow struct {
	*View
	*shell.Terminal
	// contains filtered or unexported fields
}

func NewTermWindow

func NewTermWindow(x, y, w, h int, term *shell.Terminal) *TermWindow

func (*TermWindow) Clear

func (w *TermWindow) Clear()

func (*TermWindow) Display

func (w *TermWindow) Display()

Display displays this terminal in a view

func (*TermWindow) GetView

func (w *TermWindow) GetView() *View

func (*TermWindow) IsActive

func (w *TermWindow) IsActive() bool

func (*TermWindow) LocFromVisual

func (w *TermWindow) LocFromVisual(vloc buffer.Loc) buffer.Loc

func (*TermWindow) Relocate

func (w *TermWindow) Relocate() bool

func (*TermWindow) Resize

func (w *TermWindow) Resize(width, height int)

Resize informs the terminal of a resize event

func (*TermWindow) SetActive

func (w *TermWindow) SetActive(b bool)

func (*TermWindow) SetView

func (w *TermWindow) SetView(v *View)

type UIWindow

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

func NewUIWindow

func NewUIWindow(n *views.Node) *UIWindow

func (*UIWindow) Display

func (w *UIWindow) Display()

func (*UIWindow) GetMouseSplitID

func (w *UIWindow) GetMouseSplitID(vloc buffer.Loc) uint64

func (*UIWindow) Resize

func (w *UIWindow) Resize(width, height int)

func (*UIWindow) SetActive

func (w *UIWindow) SetActive(b bool)

type View

type View struct {
	X, Y          int // X,Y location of the view
	Width, Height int // Width and height of the view

	// Start line and start column of the view (vertical/horizontal scroll)
	// note that since the starting column of every line is different if the view
	// is scrolled, StartCol is a visual index (will be the same for every line)
	StartLine, StartCol int
}

type Window

type Window interface {
	Display()
	Clear()
	Relocate() bool
	GetView() *View
	SetView(v *View)
	LocFromVisual(vloc buffer.Loc) buffer.Loc
	Resize(w, h int)
	SetActive(b bool)
	IsActive() bool
}

Jump to

Keyboard shortcuts

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