micro: github.com/zyedidia/micro/internal/display Index | Files

package display

import "github.com/zyedidia/micro/internal/display"

Index

Package Files

bufwindow.go infowindow.go statusline.go tabwindow.go termwindow.go uiwindow.go window.go

func SetStatusInfoFnLua Uses

func SetStatusInfoFnLua(fn string)

type BWindow Uses

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

type BufWindow Uses

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 Uses

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 Uses

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 Uses

func (w *BufWindow) Clear()

Clear resets all cells in this window to the default style

func (*BufWindow) Display Uses

func (w *BufWindow) Display()

Display displays the buffer and the statusline

func (*BufWindow) GetView Uses

func (w *BufWindow) GetView() *View

func (*BufWindow) IsActive Uses

func (w *BufWindow) IsActive() bool

func (*BufWindow) LocFromVisual Uses

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 Uses

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 Uses

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

func (*BufWindow) SetActive Uses

func (w *BufWindow) SetActive(b bool)

func (*BufWindow) SetBuffer Uses

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

func (*BufWindow) SetView Uses

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

type InfoWindow Uses

type InfoWindow struct {
    *info.InfoBuf
    *View
    // contains filtered or unexported fields
}

func NewInfoWindow Uses

func NewInfoWindow(b *info.InfoBuf) *InfoWindow

func (*InfoWindow) Clear Uses

func (i *InfoWindow) Clear()

func (*InfoWindow) Display Uses

func (i *InfoWindow) Display()

func (*InfoWindow) GetView Uses

func (i *InfoWindow) GetView() *View

func (*InfoWindow) IsActive Uses

func (i *InfoWindow) IsActive() bool

func (*InfoWindow) LocFromVisual Uses

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

func (*InfoWindow) Relocate Uses

func (i *InfoWindow) Relocate() bool

func (*InfoWindow) Resize Uses

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

func (*InfoWindow) SetActive Uses

func (i *InfoWindow) SetActive(b bool)

func (*InfoWindow) SetBuffer Uses

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

func (*InfoWindow) SetView Uses

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

type StatusLine Uses

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 Uses

func NewStatusLine(win *BufWindow) *StatusLine

NewStatusLine returns a statusline bound to a window

func (*StatusLine) Display Uses

func (s *StatusLine) Display()

Display draws the statusline to the screen

func (*StatusLine) FindOpt Uses

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

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

type TabWindow Uses

type TabWindow struct {
    Names []string

    Y     int
    Width int
    // contains filtered or unexported fields
}

func NewTabWindow Uses

func NewTabWindow(w int, y int) *TabWindow

func (*TabWindow) Active Uses

func (w *TabWindow) Active() int

func (*TabWindow) Display Uses

func (w *TabWindow) Display()

func (*TabWindow) LocFromVisual Uses

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

func (*TabWindow) Resize Uses

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

func (*TabWindow) Scroll Uses

func (w *TabWindow) Scroll(amt int)

func (*TabWindow) SetActive Uses

func (w *TabWindow) SetActive(a int)

func (*TabWindow) TotalSize Uses

func (w *TabWindow) TotalSize() int

type TermWindow Uses

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

func NewTermWindow Uses

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

func (*TermWindow) Clear Uses

func (w *TermWindow) Clear()

func (*TermWindow) Display Uses

func (w *TermWindow) Display()

Display displays this terminal in a view

func (*TermWindow) GetView Uses

func (w *TermWindow) GetView() *View

func (*TermWindow) IsActive Uses

func (w *TermWindow) IsActive() bool

func (*TermWindow) LocFromVisual Uses

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

func (*TermWindow) Relocate Uses

func (w *TermWindow) Relocate() bool

func (*TermWindow) Resize Uses

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

Resize informs the terminal of a resize event

func (*TermWindow) SetActive Uses

func (w *TermWindow) SetActive(b bool)

func (*TermWindow) SetView Uses

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

type UIWindow Uses

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

func NewUIWindow Uses

func NewUIWindow(n *views.Node) *UIWindow

func (*UIWindow) Display Uses

func (w *UIWindow) Display()

func (*UIWindow) GetMouseSplitID Uses

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

func (*UIWindow) Resize Uses

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

func (*UIWindow) SetActive Uses

func (w *UIWindow) SetActive(b bool)

type View Uses

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 Uses

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
}

Package display imports 20 packages (graph) and is imported by 2 packages. Updated 2020-02-21. Refresh now. Tools for package owners.