forked from elves/elvish
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mode.go
27 lines (22 loc) · 942 Bytes
/
mode.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package edit
import "github.com/elves/elvish/edit/ui"
// Additional interfaces mode implementations may satisfy.
// cursorOnModeLiner is an optional interface that modes can implement. If a
// mode does and the method returns true, the cursor is placed on the modeline
// when that mode is active.
type cursorOnModeLiner interface {
CursorOnModeLine() bool
}
// lister is an optional interface that modes can implement. If a mode
// implements this interface, the result of this method will be shown in the
// listing area.
type lister interface {
List(maxHeight int) ui.Renderer
}
// listRenderer is similar to lister, but the mode handles the rendering itself.
// NOTE(xiaq): This interface is being deprecated in favor of Lister.
type listRenderer interface {
// ListRender renders the listing under the given constraint of width and
// maximum height. It returns a rendered buffer.
ListRender(width, maxHeight int) *ui.Buffer
}