choru

package module
v0.0.0-...-37ffedd Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2016 License: MIT Imports: 7 Imported by: 0

README

choる

ラーメン次郎mattn/choインスパイア系

Example

c := choru.New()
if i, v := c.Choose([]string{"foo", "bar", "hoge", "fuga"}); i >= 0 {
	fmt.Printf("%d => %s\n", i, v)
}

Screen Shot

capture

Keybind

key operation
j down
k up
g top
G bottom
q, <ESC> quit

Documentation

Index

Constants

View Source
const (
	VtDefault = "0"

	FgDefault     = VtDefault
	FgBlack       = "30"
	FgRed         = "31"
	FgGreen       = "32"
	FgYellow      = "33"
	FgBlue        = "34"
	FgMagenta     = "35"
	FgCyan        = "36"
	FgWhite       = "37"
	FgBlackBold   = "30;1"
	FgRedBold     = "31;1"
	FgGreenBold   = "32;1"
	FgYellowBold  = "33;1"
	FgBlueBold    = "34;1"
	FgMagentaBold = "35;1"
	FgCyanBold    = "36;1"
	FgWhiteBold   = "37;1"

	BgBlack         = "40"
	BgRed           = "41"
	BgGreen         = "42"
	BgYellow        = "43"
	BgBlue          = "44"
	BgMagenta       = "45"
	BgCyan          = "46"
	BgWhite         = "47"
	BgDefault       = "49"
	BgBlackBright   = "100"
	BgRedBright     = "101"
	BgGreenBright   = "102"
	BgYellowBright  = "103"
	BgBlueBright    = "104"
	BgMagentaBright = "105"
	BgCyanBright    = "106"
	BgWhiteBright   = "107"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Choru

type Choru struct {
	LineFg    string
	LineBg    string
	CursorFg  string
	CursorBg  string
	MaxHeight int
	Header    string
	HeaderFg  string
	HeaderBg  string
	Footer    string
	FooterFg  string
	FooterBg  string
}

func New

func New() *Choru

func (*Choru) Choose

func (c *Choru) Choose(items []string) (int, string)

Directories

Path Synopsis
example
foobar command
word_chain command

Jump to

Keyboard shortcuts

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