github.com/hoop33/elvish@v0.0.0-20160801152013-6d25485beab4/edit/mode.go (about) 1 package edit 2 3 // Mode is an editor mode. 4 type Mode interface { 5 Mode() ModeType 6 // ModeLine renders a mode line under the given width constraint. It 7 // returns a rendered buffer. 8 ModeLine(width int) *buffer 9 } 10 11 type ModeType int 12 13 const ( 14 modeInsert ModeType = iota 15 modeCommand 16 modeCompletion 17 modeNavigation 18 modeHistory 19 modeHistoryListing 20 modeBang 21 modeLocation 22 ) 23 24 // Lister is a mode with a listing. 25 type Lister interface { 26 // List renders the listing under the given constraint of width and maximum 27 // height. It returns a rendered buffer. 28 List(width, maxHeight int) *buffer 29 }