Documentation ¶
Index ¶
- func SetStatusInfoFnLua(fn string)
- type BWindow
- type BufWindow
- func (w *BufWindow) BufView() View
- func (w *BufWindow) Clear()
- func (w *BufWindow) Diff(s1, s2 SLoc) int
- func (w *BufWindow) Display()
- func (w *BufWindow) GetView() *View
- func (w *BufWindow) IsActive() bool
- func (w *BufWindow) LocFromVLoc(vloc VLoc) buffer.Loc
- func (w *BufWindow) LocFromVisual(svloc buffer.Loc) buffer.Loc
- func (w *BufWindow) Relocate() bool
- func (w *BufWindow) Resize(width, height int)
- func (w *BufWindow) SLocFromLoc(loc buffer.Loc) SLoc
- func (w *BufWindow) Scroll(s SLoc, n int) SLoc
- func (w *BufWindow) SetActive(b bool)
- func (w *BufWindow) SetBuffer(b *buffer.Buffer)
- func (w *BufWindow) SetView(view *View)
- func (w *BufWindow) VLocFromLoc(loc buffer.Loc) VLoc
- type InfoWindow
- func (i *InfoWindow) BufView() View
- func (i *InfoWindow) Clear()
- func (i *InfoWindow) Diff(s1, s2 SLoc) int
- func (i *InfoWindow) Display()
- func (i *InfoWindow) GetView() *View
- func (i *InfoWindow) IsActive() bool
- func (i *InfoWindow) LocFromVLoc(vloc VLoc) buffer.Loc
- func (i *InfoWindow) LocFromVisual(vloc buffer.Loc) buffer.Loc
- func (i *InfoWindow) Relocate() bool
- func (i *InfoWindow) Resize(w, h int)
- func (i *InfoWindow) SLocFromLoc(loc buffer.Loc) SLoc
- func (i *InfoWindow) Scroll(s SLoc, n int) SLoc
- func (i *InfoWindow) SetActive(b bool)
- func (i *InfoWindow) SetBuffer(b *buffer.Buffer)
- func (i *InfoWindow) SetView(v *View)
- func (i *InfoWindow) VLocFromLoc(loc buffer.Loc) VLoc
- type SLoc
- type SoftWrap
- type StatusLine
- type TabWindow
- type TermWindow
- func (w *TermWindow) Clear()
- func (w *TermWindow) Display()
- func (w *TermWindow) GetView() *View
- func (w *TermWindow) IsActive() bool
- func (w *TermWindow) LocFromVisual(vloc buffer.Loc) buffer.Loc
- func (w *TermWindow) Relocate() bool
- func (w *TermWindow) Resize(width, height int)
- func (w *TermWindow) SetActive(b bool)
- func (w *TermWindow) SetView(v *View)
- type UIWindow
- type VLoc
- type View
- type Window
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetStatusInfoFnLua ¶
func SetStatusInfoFnLua(fn string)
Types ¶
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 ¶
NewBufWindow creates a new window at a location in the screen with a width and height
func (*BufWindow) BufView ¶
BufView returns the width, height and x,y location of the actual buffer. It is not exactly the same as the whole window which also contains gutter, ruler, scrollbar and statusline.
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) LocFromVLoc ¶
LocFromVLoc takes a visual location in the linewrapped buffer and returns the position in the buffer corresponding to this visual location.
func (*BufWindow) LocFromVisual ¶
LocFromVisual takes a visual location (x and y position) and returns the position in the buffer corresponding to the visual location If the requested position does not correspond to a buffer location it returns the nearest position
func (*BufWindow) Relocate ¶
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) SLocFromLoc ¶
SLocFromLoc takes a position in the buffer and returns the location of the visual line containing this position.
func (*BufWindow) Scroll ¶
Scroll returns the location which is n visual lines below the location s i.e. the result of scrolling n lines down. n can be negative, which means scrolling up. The returned location is guaranteed to be within the buffer boundaries.
type InfoWindow ¶
func NewInfoWindow ¶
func NewInfoWindow(b *info.InfoBuf) *InfoWindow
func (*InfoWindow) BufView ¶
func (i *InfoWindow) BufView() View
func (*InfoWindow) Clear ¶
func (i *InfoWindow) Clear()
func (*InfoWindow) Diff ¶
func (i *InfoWindow) Diff(s1, s2 SLoc) int
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) LocFromVLoc ¶
func (i *InfoWindow) LocFromVLoc(vloc VLoc) buffer.Loc
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) SLocFromLoc ¶
func (i *InfoWindow) SLocFromLoc(loc buffer.Loc) SLoc
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)
func (*InfoWindow) VLocFromLoc ¶
func (i *InfoWindow) VLocFromLoc(loc buffer.Loc) VLoc
type SLoc ¶
type SLoc struct {
Line, Row int
}
SLoc represents a vertical scrolling location, i.e. a location of a visual line in the buffer. When softwrap is enabled, a buffer line may be displayed as multiple visual lines (rows). So SLoc stores a number of a line in the buffer and a number of a row within this line.
func (SLoc) GreaterEqual ¶
GreaterEqual returns true if s is bigger than or equal to b
func (SLoc) GreaterThan ¶
GreaterThan returns true if s is bigger than b
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 ¶
func NewTabWindow ¶
type TermWindow ¶
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 (*UIWindow) GetMouseSplitNode ¶
type VLoc ¶
VLoc represents a location in the buffer as a visual location in the linewrapped buffer.
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 of the view (for vertical scroll)
StartLine SLoc
// Start column of the view (for 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)
StartCol int
}