diff --git a/cmd/cloudflared/tunnel/cmd.go b/cmd/cloudflared/tunnel/cmd.go index 344333b0..793f8c2b 100644 --- a/cmd/cloudflared/tunnel/cmd.go +++ b/cmd/cloudflared/tunnel/cmd.go @@ -25,7 +25,6 @@ import ( "github.com/cloudflare/cloudflared/cfapi" "github.com/cloudflare/cloudflared/cmd/cloudflared/cliutil" "github.com/cloudflare/cloudflared/cmd/cloudflared/proxydns" - "github.com/cloudflare/cloudflared/cmd/cloudflared/ui" "github.com/cloudflare/cloudflared/cmd/cloudflared/updater" "github.com/cloudflare/cloudflared/config" "github.com/cloudflare/cloudflared/connection" @@ -218,7 +217,7 @@ func runAdhocNamedTunnel(sc *subcommandContext, name, credentialsOutputPath stri // runClassicTunnel creates a "classic" non-named tunnel func runClassicTunnel(sc *subcommandContext) error { - return StartServer(sc.c, buildInfo, nil, sc.log, sc.isUIEnabled) + return StartServer(sc.c, buildInfo, nil, sc.log) } func routeFromFlag(c *cli.Context) (route cfapi.HostnameRoute, ok bool) { @@ -236,7 +235,6 @@ func StartServer( info *cliutil.BuildInfo, namedTunnel *connection.NamedTunnelProperties, log *zerolog.Logger, - isUIEnabled bool, ) error { _ = raven.SetDSN(sentryDSN) var wg sync.WaitGroup @@ -331,9 +329,9 @@ func StartServer( return fmt.Errorf(errText) } - logTransport := logger.CreateTransportLoggerFromContext(c, isUIEnabled) + logTransport := logger.CreateTransportLoggerFromContext(c, logger.EnableTerminalLog) - observer := connection.NewObserver(log, logTransport, isUIEnabled) + observer := connection.NewObserver(log, logTransport) // Send Quick Tunnel URL to UI if applicable var quickTunnelURL string @@ -392,18 +390,6 @@ func StartServer( errC <- supervisor.StartTunnelDaemon(ctx, tunnelConfig, orchestrator, connectedSignal, reconnectCh, graceShutdownC) }() - if isUIEnabled { - tunnelUI := ui.NewUIModel( - info.Version(), - hostname, - metricsListener.Addr().String(), - orchestratorConfig.Ingress, - tunnelConfig.HAConnections, - ) - app := tunnelUI.Launch(ctx, log, logTransport) - observer.RegisterSink(app) - } - gracePeriod, err := gracePeriod(c) if err != nil { return err @@ -663,9 +649,9 @@ func tunnelFlags(shouldHide bool) []cli.Flag { }), altsrc.NewBoolFlag(&cli.BoolFlag{ Name: uiFlag, - Usage: "Launch tunnel UI. Tunnel logs are scrollable via 'j', 'k', or arrow keys.", + Usage: "(depreciated) Launch tunnel UI. Tunnel logs are scrollable via 'j', 'k', or arrow keys.", Value: false, - Hidden: shouldHide, + Hidden: true, }), altsrc.NewStringFlag(&cli.StringFlag{ Name: "quick-service", diff --git a/cmd/cloudflared/tunnel/quick_tunnel.go b/cmd/cloudflared/tunnel/quick_tunnel.go index 0dd7747b..51662b7a 100644 --- a/cmd/cloudflared/tunnel/quick_tunnel.go +++ b/cmd/cloudflared/tunnel/quick_tunnel.go @@ -78,7 +78,6 @@ func RunQuickTunnel(sc *subcommandContext) error { buildInfo, &connection.NamedTunnelProperties{Credentials: credentials, QuickTunnelUrl: data.Result.Hostname}, sc.log, - sc.isUIEnabled, ) } diff --git a/cmd/cloudflared/tunnel/subcommand_context.go b/cmd/cloudflared/tunnel/subcommand_context.go index df1d95f0..650781e8 100644 --- a/cmd/cloudflared/tunnel/subcommand_context.go +++ b/cmd/cloudflared/tunnel/subcommand_context.go @@ -31,10 +31,9 @@ func (e errInvalidJSONCredential) Error() string { // subcommandContext carries structs shared between subcommands, to reduce number of arguments needed to // pass between subcommands, and make sure they are only initialized once type subcommandContext struct { - c *cli.Context - log *zerolog.Logger - isUIEnabled bool - fs fileSystem + c *cli.Context + log *zerolog.Logger + fs fileSystem // These fields should be accessed using their respective Getter tunnelstoreClient cfapi.Client @@ -42,16 +41,10 @@ type subcommandContext struct { } func newSubcommandContext(c *cli.Context) (*subcommandContext, error) { - isUIEnabled := c.IsSet(uiFlag) && c.String("name") != "" - - // If UI is enabled, terminal log output should be disabled -- log should be written into a UI log window instead - log := logger.CreateLoggerFromContext(c, isUIEnabled) - return &subcommandContext{ - c: c, - log: log, - isUIEnabled: isUIEnabled, - fs: realFileSystem{}, + c: c, + log: logger.CreateLoggerFromContext(c, logger.EnableTerminalLog), + fs: realFileSystem{}, }, nil } @@ -312,7 +305,6 @@ func (sc *subcommandContext) runWithCredentials(credentials connection.Credentia buildInfo, &connection.NamedTunnelProperties{Credentials: credentials}, sc.log, - sc.isUIEnabled, ) } diff --git a/cmd/cloudflared/tunnel/subcommand_context_test.go b/cmd/cloudflared/tunnel/subcommand_context_test.go index 82b866d9..35cc46e7 100644 --- a/cmd/cloudflared/tunnel/subcommand_context_test.go +++ b/cmd/cloudflared/tunnel/subcommand_context_test.go @@ -35,7 +35,6 @@ func Test_subcommandContext_findCredentials(t *testing.T) { type fields struct { c *cli.Context log *zerolog.Logger - isUIEnabled bool fs fileSystem tunnelstoreClient cfapi.Client userCredential *userCredential @@ -168,7 +167,6 @@ func Test_subcommandContext_findCredentials(t *testing.T) { sc := &subcommandContext{ c: tt.fields.c, log: tt.fields.log, - isUIEnabled: tt.fields.isUIEnabled, fs: tt.fields.fs, tunnelstoreClient: tt.fields.tunnelstoreClient, userCredential: tt.fields.userCredential, @@ -307,7 +305,6 @@ func Test_subcommandContext_Delete(t *testing.T) { sc := &subcommandContext{ c: tt.fields.c, log: tt.fields.log, - isUIEnabled: tt.fields.isUIEnabled, fs: tt.fields.fs, tunnelstoreClient: tt.fields.tunnelstoreClient, userCredential: tt.fields.userCredential, diff --git a/cmd/cloudflared/ui/launch_ui.go b/cmd/cloudflared/ui/launch_ui.go deleted file mode 100644 index 023359ca..00000000 --- a/cmd/cloudflared/ui/launch_ui.go +++ /dev/null @@ -1,223 +0,0 @@ -package ui - -import ( - "context" - "fmt" - "strings" - - "github.com/gdamore/tcell" - "github.com/rivo/tview" - "github.com/rs/zerolog" - - "github.com/cloudflare/cloudflared/connection" - "github.com/cloudflare/cloudflared/ingress" -) - -type connState struct { - location string -} - -type uiModel struct { - version string - edgeURL string - metricsURL string - localServices []string - connections []connState -} - -type palette struct { - url string - connected string - defaultText string - disconnected string - reconnecting string - unregistered string -} - -func NewUIModel(version, hostname, metricsURL string, ing *ingress.Ingress, haConnections int) *uiModel { - localServices := make([]string, len(ing.Rules)) - for i, rule := range ing.Rules { - localServices[i] = rule.Service.String() - } - return &uiModel{ - version: version, - edgeURL: hostname, - metricsURL: metricsURL, - localServices: localServices, - connections: make([]connState, haConnections), - } -} - -func (data *uiModel) Launch( - ctx context.Context, - log, transportLog *zerolog.Logger, -) connection.EventSink { - // Configure the logger to stream logs into the textview - - // Add TextView as a group to write output to - logTextView := NewDynamicColorTextView() - // TODO: Format log for UI - //log.Add(logTextView, logger.NewUIFormatter(time.RFC3339), logLevels...) - //transportLog.Add(logTextView, logger.NewUIFormatter(time.RFC3339), logLevels...) - - // Construct the UI - palette := palette{ - url: "lightblue", - connected: "lime", - defaultText: "white", - disconnected: "red", - reconnecting: "orange", - unregistered: "orange", - } - - app := tview.NewApplication() - - grid := tview.NewGrid().SetGap(1, 0) - frame := tview.NewFrame(grid) - header := fmt.Sprintf("cloudflared [::b]%s", data.version) - - frame.AddText(header, true, tview.AlignLeft, tcell.ColorWhite) - - // Create table to store connection info and status - connTable := tview.NewTable() - // SetColumns takes a value for each column, representing the size of the column - // Numbers <= 0 represent proportional widths and positive numbers represent absolute widths - grid.SetColumns(20, 0) - - // SetRows takes a value for each row, representing the size of the row - grid.SetRows(1, 1, len(data.connections), 1, 0) - - // AddItem takes a primitive tview type, row, column, rowSpan, columnSpan, minGridHeight, minGridWidth, and focus - grid.AddItem(tview.NewTextView().SetText("Tunnel:"), 0, 0, 1, 1, 0, 0, false) - grid.AddItem(tview.NewTextView().SetText("Status:"), 1, 0, 1, 1, 0, 0, false) - grid.AddItem(tview.NewTextView().SetText("Connections:"), 2, 0, 1, 1, 0, 0, false) - - grid.AddItem(tview.NewTextView().SetText("Metrics:"), 3, 0, 1, 1, 0, 0, false) - - tunnelHostText := tview.NewTextView().SetText(data.edgeURL) - - grid.AddItem(tunnelHostText, 0, 1, 1, 1, 0, 0, false) - status := fmt.Sprintf("[%s]\u2022[%s] Proxying to [%s::b]%s", palette.connected, palette.defaultText, palette.url, strings.Join(data.localServices, ", ")) - grid.AddItem(NewDynamicColorTextView().SetText(status), 1, 1, 1, 1, 0, 0, false) - - grid.AddItem(connTable, 2, 1, 1, 1, 0, 0, false) - - grid.AddItem(NewDynamicColorTextView().SetText(fmt.Sprintf("Metrics at [%s::b]http://%s/metrics", palette.url, data.metricsURL)), 3, 1, 1, 1, 0, 0, false) - - // Add TextView to stream logs - // Logs are displayed in a new grid so a border can be set around them - logGrid := tview.NewGrid().SetBorders(true).AddItem(logTextView.SetChangedFunc(handleNewText(app, logTextView)), 0, 0, 5, 2, 0, 0, false) - // LogFrame holds the Logs header as well as the grid with the textView for streamed logs - logFrame := tview.NewFrame(logGrid).AddText("[::b]Logs:[::-]", true, tview.AlignLeft, tcell.ColorWhite).SetBorders(0, 0, 0, 0, 0, 0) - // Footer for log frame - logFrame.AddText("[::d]Use Ctrl+C to exit[::-]", false, tview.AlignRight, tcell.ColorWhite) - grid.AddItem(logFrame, 4, 0, 5, 2, 0, 0, false) - - go func() { - <-ctx.Done() - app.Stop() - return - }() - - go func() { - if err := app.SetRoot(frame, true).Run(); err != nil { - log.Error().Msgf("Error launching UI: %s", err) - } - }() - - return connection.EventSinkFunc(func(event connection.Event) { - switch event.EventType { - case connection.Connected: - data.setConnTableCell(event, connTable, palette) - case connection.Disconnected, connection.Reconnecting, connection.Unregistering: - data.changeConnStatus(event, connTable, log, palette) - case connection.SetURL: - tunnelHostText.SetText(event.URL) - data.edgeURL = event.URL - case connection.RegisteringTunnel: - if data.edgeURL == "" { - tunnelHostText.SetText(fmt.Sprintf("Registering tunnel connection %d...", event.Index)) - } - } - app.Draw() - }) -} - -func NewDynamicColorTextView() *tview.TextView { - return tview.NewTextView().SetDynamicColors(true) -} - -// Re-draws application when new logs are streamed to UI -func handleNewText(app *tview.Application, logTextView *tview.TextView) func() { - return func() { - app.Draw() - // SetFocus to enable scrolling in textview - app.SetFocus(logTextView) - } -} - -func (data *uiModel) changeConnStatus(event connection.Event, table *tview.Table, log *zerolog.Logger, palette palette) { - index := int(event.Index) - // Get connection location and state - connState := data.getConnState(index) - // Check if connection is already displayed in UI - if connState == nil { - log.Info().Msg("Connection is not in the UI table") - return - } - - locationState := event.Location - - if event.EventType == connection.Reconnecting { - locationState = "Reconnecting..." - } - - connectionNum := index + 1 - // Get table cell - cell := table.GetCell(index, 0) - // Change dot color in front of text as well as location state - text := newCellText(palette, connectionNum, locationState, event.EventType) - cell.SetText(text) -} - -// Return connection location and row in UI table -func (data *uiModel) getConnState(connID int) *connState { - if connID < len(data.connections) { - return &data.connections[connID] - } - - return nil -} - -func (data *uiModel) setConnTableCell(event connection.Event, table *tview.Table, palette palette) { - index := int(event.Index) - connectionNum := index + 1 - - // Update slice to keep track of connection location and state in UI table - data.connections[index].location = event.Location - - // Update text in table cell to show disconnected state - text := newCellText(palette, connectionNum, event.Location, event.EventType) - cell := tview.NewTableCell(text) - table.SetCell(index, 0, cell) -} - -func newCellText(palette palette, connectionNum int, location string, connectedStatus connection.Status) string { - // HA connection indicator formatted as: "• #: ", - // where the left middle dot's color depends on the status of the connection - const connFmtString = "[%s]\u2022[%s] #%d: %s" - - var dotColor string - switch connectedStatus { - case connection.Connected: - dotColor = palette.connected - case connection.Disconnected: - dotColor = palette.disconnected - case connection.Reconnecting: - dotColor = palette.reconnecting - case connection.Unregistering: - dotColor = palette.unregistered - } - - return fmt.Sprintf(connFmtString, dotColor, palette.defaultText, connectionNum, location) -} diff --git a/connection/h2mux_test.go b/connection/h2mux_test.go index 787cfd17..cf2337ec 100644 --- a/connection/h2mux_test.go +++ b/connection/h2mux_test.go @@ -47,7 +47,7 @@ func newH2MuxConnection(t require.TestingT) (*h2muxConnection, *h2mux.Muxer) { edgeMuxChan <- edgeMux }() var connIndex = uint8(0) - testObserver := NewObserver(&log, &log, false) + testObserver := NewObserver(&log, &log) h2muxConn, err, _ := NewH2muxConnection(testOrchestrator, testGracePeriod, testMuxerConfig, originConn, connIndex, testObserver, nil) require.NoError(t, err) return h2muxConn, <-edgeMuxChan diff --git a/connection/http2_test.go b/connection/http2_test.go index 82368d67..e962353f 100644 --- a/connection/http2_test.go +++ b/connection/http2_test.go @@ -33,7 +33,7 @@ func newTestHTTP2Connection() (*HTTP2Connection, net.Conn) { edgeConn, cfdConn := net.Pipe() var connIndex = uint8(0) log := zerolog.Nop() - obs := NewObserver(&log, &log, false) + obs := NewObserver(&log, &log) controlStream := NewControlStream( obs, mockConnectedFuse{}, @@ -356,7 +356,7 @@ func TestServeControlStream(t *testing.T) { unregistered: make(chan struct{}), } - obs := NewObserver(&log, &log, false) + obs := NewObserver(&log, &log) controlStream := NewControlStream( obs, mockConnectedFuse{}, @@ -407,7 +407,7 @@ func TestFailRegistration(t *testing.T) { unregistered: make(chan struct{}), } - obs := NewObserver(&log, &log, false) + obs := NewObserver(&log, &log) controlStream := NewControlStream( obs, mockConnectedFuse{}, @@ -453,7 +453,7 @@ func TestGracefulShutdownHTTP2(t *testing.T) { events := &eventCollectorSink{} shutdownC := make(chan struct{}) - obs := NewObserver(&log, &log, false) + obs := NewObserver(&log, &log) obs.RegisterSink(events) controlStream := NewControlStream( obs, diff --git a/connection/observer.go b/connection/observer.go index 1e8b62b5..3a855878 100644 --- a/connection/observer.go +++ b/connection/observer.go @@ -18,7 +18,6 @@ type Observer struct { logTransport *zerolog.Logger metrics *tunnelMetrics tunnelEventChan chan Event - uiEnabled bool addSinkChan chan EventSink } @@ -26,12 +25,11 @@ type EventSink interface { OnTunnelEvent(event Event) } -func NewObserver(log, logTransport *zerolog.Logger, uiEnabled bool) *Observer { +func NewObserver(log, logTransport *zerolog.Logger) *Observer { o := &Observer{ log: log, logTransport: logTransport, metrics: newTunnelMetrics(), - uiEnabled: uiEnabled, tunnelEventChan: make(chan Event, observerChannelBufferSize), addSinkChan: make(chan EventSink, observerChannelBufferSize), } diff --git a/connection/observer_test.go b/connection/observer_test.go index a8c68e9f..b5ea41b0 100644 --- a/connection/observer_test.go +++ b/connection/observer_test.go @@ -12,7 +12,7 @@ import ( ) func TestSendUrl(t *testing.T) { - observer := NewObserver(&log, &log, false) + observer := NewObserver(&log, &log) observer.SendURL("my-url.com") assert.Equal(t, 1.0, getCounterValue(t, observer.metrics.userHostnamesCounts, "https://my-url.com")) @@ -63,7 +63,7 @@ func TestRegisterServerLocation(t *testing.T) { } func TestObserverEventsDontBlock(t *testing.T) { - observer := NewObserver(&log, &log, false) + observer := NewObserver(&log, &log) var mu sync.Mutex observer.RegisterSink(EventSinkFunc(func(_ Event) { // callback will block if lock is already held diff --git a/go.mod b/go.mod index 1793f367..1f97b27c 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,6 @@ require ( github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf github.com/facebookgo/grace v0.0.0-20180706040059-75cf19382434 github.com/fsnotify/fsnotify v1.4.9 - github.com/gdamore/tcell v1.3.0 github.com/getsentry/raven-go v0.0.0-20180517221441-ed7bcb39ff10 github.com/gobwas/ws v1.0.4 github.com/golang-collections/collections v0.0.0-20130729185459-604e922904d3 @@ -24,7 +23,6 @@ require ( github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.12.1 github.com/prometheus/client_model v0.2.0 - github.com/rivo/tview v0.0.0-20200712113419-c65badfc3d92 github.com/rs/zerolog v1.20.0 github.com/stretchr/testify v1.7.1 github.com/urfave/cli/v2 v2.3.0 @@ -63,7 +61,6 @@ require ( github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 // indirect github.com/facebookgo/subset v0.0.0-20150612182917-8dac2c3c4870 // indirect github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568 // indirect - github.com/gdamore/encoding v1.0.0 // indirect github.com/go-logr/logr v1.2.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 // indirect @@ -73,12 +70,10 @@ require ( github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 // indirect github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 // indirect github.com/kylelemons/godebug v1.1.0 // indirect - github.com/lucasb-eyer/go-colorful v1.0.3 // indirect github.com/marten-seemann/qtls-go1-16 v0.1.5 // indirect github.com/marten-seemann/qtls-go1-17 v0.1.1 // indirect github.com/marten-seemann/qtls-go1-18 v0.1.1 // indirect github.com/mattn/go-isatty v0.0.12 // indirect - github.com/mattn/go-runewidth v0.0.8 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect @@ -89,7 +84,6 @@ require ( github.com/pquerna/cachecontrol v0.0.0-20180517163645-1555304b9b35 // indirect github.com/prometheus/common v0.32.1 // indirect github.com/prometheus/procfs v0.7.3 // indirect - github.com/rivo/uniseg v0.1.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect golang.org/x/mod v0.4.2 // indirect golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect diff --git a/go.sum b/go.sum index f6a15c92..c5b3b0d6 100644 --- a/go.sum +++ b/go.sum @@ -70,7 +70,6 @@ github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBp github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= github.com/DataDog/datadog-go v4.4.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/gostackparse v0.5.0/go.mod h1:lTfqcJKqS9KnXQGnyQMCugq3u1FP6UZMfWR0aitKFMM= github.com/DataDog/sketches-go v1.0.0/go.mod h1:O+XkJHWk9w4hDwY2ZUDU31ZC9sNYlYo8DiFsxjYeo1k= @@ -189,10 +188,6 @@ github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/gdamore/encoding v1.0.0 h1:+7OoQ1Bc6eTm5niUzBa0Ctsh6JbMW6Ra+YNuAtDBdko= -github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo5dl+VrEg= -github.com/gdamore/tcell v1.3.0 h1:r35w0JBADPZCVQijYebl6YMWWtHRqVEGt7kL2eBADRM= -github.com/gdamore/tcell v1.3.0/go.mod h1:Hjvr+Ofd+gLglo7RYKxxnzCBmev3BzsS67MebKS4zMM= github.com/getkin/kin-openapi v0.76.0/go.mod h1:660oXbgy5JFMKreazJaQTw7o+X00qeSyhcnluiMv+Xg= github.com/getsentry/raven-go v0.0.0-20180517221441-ed7bcb39ff10 h1:YO10pIIBftO/kkTFdWhctH96grJ7qiy7bMdiZcIvPKs= github.com/getsentry/raven-go v0.0.0-20180517221441-ed7bcb39ff10/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ= @@ -396,9 +391,6 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/lucasb-eyer/go-colorful v1.0.2/go.mod h1:0MS4r+7BZKSJ5mw4/S5MPN+qHFF1fYclkSPilDOKW0s= -github.com/lucasb-eyer/go-colorful v1.0.3 h1:QIbQXiugsb+q10B+MI+7DI1oQLdmnep86tWFlaaUAac= -github.com/lucasb-eyer/go-colorful v1.0.3/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= @@ -415,9 +407,6 @@ github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-runewidth v0.0.8 h1:3tS41NlGYSmhhe/8fhGRzc+z3AYCw1Fe1WAyLuujKs0= -github.com/mattn/go-runewidth v0.0.8/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/microcosm-cc/bluemonday v1.0.1/go.mod h1:hsXNsILzKxV+sX77C5b8FSuKF00vh2OMYv+xgHpAMF4= @@ -513,10 +502,6 @@ github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1 github.com/rabbitmq/amqp091-go v1.1.0/go.mod h1:ogQDLSOACsLPsIq0NpbtiifNZi2YOz0VTJ0kHRghqbM= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/rivo/tview v0.0.0-20200712113419-c65badfc3d92 h1:rqaqSUdaW+OBbjnsrOoiaJv43mSRARuvsAuirmdxu7E= -github.com/rivo/tview v0.0.0-20200712113419-c65badfc3d92/go.mod h1:6lkG1x+13OShEf0EaOCaTQYyB7d5nSbb181KtjlS+84= -github.com/rivo/uniseg v0.1.0 h1:+2KBaVoUmb9XzDsrx/Ct0W/EYOSFf/nWTauy++DprtY= -github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= @@ -773,7 +758,6 @@ golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190626150813-e07cf5db2756/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= diff --git a/vendor/github.com/gdamore/encoding/.appveyor.yml b/vendor/github.com/gdamore/encoding/.appveyor.yml deleted file mode 100644 index 19a4c5dd..00000000 --- a/vendor/github.com/gdamore/encoding/.appveyor.yml +++ /dev/null @@ -1,13 +0,0 @@ -version: 1.0.{build} -clone_folder: c:\gopath\src\github.com\gdamore\encoding -environment: - GOPATH: c:\gopath -build_script: -- go version -- go env -- SET PATH=%LOCALAPPDATA%\atom\bin;%GOPATH%\bin;%PATH% -- go get -t ./... -- go build -- go install ./... -test_script: -- go test ./... diff --git a/vendor/github.com/gdamore/encoding/.travis.yml b/vendor/github.com/gdamore/encoding/.travis.yml deleted file mode 100644 index 50424138..00000000 --- a/vendor/github.com/gdamore/encoding/.travis.yml +++ /dev/null @@ -1,7 +0,0 @@ -language: go - -go: - - 1.9.x - - 1.10.x - - 1.11.x - - tip diff --git a/vendor/github.com/gdamore/encoding/LICENSE b/vendor/github.com/gdamore/encoding/LICENSE deleted file mode 100644 index d6456956..00000000 --- a/vendor/github.com/gdamore/encoding/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/gdamore/encoding/README.md b/vendor/github.com/gdamore/encoding/README.md deleted file mode 100644 index 3db2b4c5..00000000 --- a/vendor/github.com/gdamore/encoding/README.md +++ /dev/null @@ -1,19 +0,0 @@ -## encoding - -[![Linux Status](https://img.shields.io/travis/gdamore/encoding.svg?label=linux)](https://travis-ci.org/gdamore/encoding) -[![Windows Status](https://img.shields.io/appveyor/ci/gdamore/encoding.svg?label=windows)](https://ci.appveyor.com/project/gdamore/encoding) -[![Apache License](https://img.shields.io/badge/license-APACHE2-blue.svg)](https://github.com/gdamore/encoding/blob/master/LICENSE) -[![GoDoc](https://img.shields.io/badge/godoc-reference-blue.svg)](https://godoc.org/github.com/gdamore/encoding) -[![Go Report Card](http://goreportcard.com/badge/gdamore/encoding)](http://goreportcard.com/report/gdamore/encoding) - -Package encoding provides a number of encodings that are missing from the -standard Go [encoding]("https://godoc.org/golang.org/x/text/encoding") package. - -We hope that we can contribute these to the standard Go library someday. It -turns out that some of these are useful for dealing with I/O streams coming -from non-UTF friendly sources. - -The UTF8 Encoder is also useful for situations where valid UTF-8 might be -carried in streams that contain non-valid UTF; in particular I use it for -helping me cope with terminals that embed escape sequences in otherwise -valid UTF-8. diff --git a/vendor/github.com/gdamore/encoding/ascii.go b/vendor/github.com/gdamore/encoding/ascii.go deleted file mode 100644 index b7321f43..00000000 --- a/vendor/github.com/gdamore/encoding/ascii.go +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2015 Garrett D'Amore -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package encoding - -import ( - "golang.org/x/text/encoding" -) - -// ASCII represents the 7-bit US-ASCII scheme. It decodes directly to -// UTF-8 without change, as all ASCII values are legal UTF-8. -// Unicode values less than 128 (i.e. 7 bits) map 1:1 with ASCII. -// It encodes runes outside of that to 0x1A, the ASCII substitution character. -var ASCII encoding.Encoding - -func init() { - amap := make(map[byte]rune) - for i := 128; i <= 255; i++ { - amap[byte(i)] = RuneError - } - - cm := &Charmap{Map: amap} - cm.Init() - ASCII = cm -} diff --git a/vendor/github.com/gdamore/encoding/charmap.go b/vendor/github.com/gdamore/encoding/charmap.go deleted file mode 100644 index db1c33ef..00000000 --- a/vendor/github.com/gdamore/encoding/charmap.go +++ /dev/null @@ -1,196 +0,0 @@ -// Copyright 2015 Garrett D'Amore -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package encoding - -import ( - "sync" - "unicode/utf8" - - "golang.org/x/text/encoding" - "golang.org/x/text/transform" -) - -const ( - // RuneError is an alias for the UTF-8 replacement rune, '\uFFFD'. - RuneError = '\uFFFD' - - // RuneSelf is the rune below which UTF-8 and the Unicode values are - // identical. Its also the limit for ASCII. - RuneSelf = 0x80 - - // ASCIISub is the ASCII substitution character. - ASCIISub = '\x1a' -) - -// Charmap is a structure for setting up encodings for 8-bit character sets, -// for transforming between UTF8 and that other character set. It has some -// ideas borrowed from golang.org/x/text/encoding/charmap, but it uses a -// different implementation. This implementation uses maps, and supports -// user-defined maps. -// -// We do assume that a character map has a reasonable substitution character, -// and that valid encodings are stable (exactly a 1:1 map) and stateless -// (that is there is no shift character or anything like that.) Hence this -// approach will not work for many East Asian character sets. -// -// Measurement shows little or no measurable difference in the performance of -// the two approaches. The difference was down to a couple of nsec/op, and -// no consistent pattern as to which ran faster. With the conversion to -// UTF-8 the code takes about 25 nsec/op. The conversion in the reverse -// direction takes about 100 nsec/op. (The larger cost for conversion -// from UTF-8 is most likely due to the need to convert the UTF-8 byte stream -// to a rune before conversion. -// -type Charmap struct { - transform.NopResetter - bytes map[rune]byte - runes [256][]byte - once sync.Once - - // The map between bytes and runes. To indicate that a specific - // byte value is invalid for a charcter set, use the rune - // utf8.RuneError. Values that are absent from this map will - // be assumed to have the identity mapping -- that is the default - // is to assume ISO8859-1, where all 8-bit characters have the same - // numeric value as their Unicode runes. (Not to be confused with - // the UTF-8 values, which *will* be different for non-ASCII runes.) - // - // If no values less than RuneSelf are changed (or have non-identity - // mappings), then the character set is assumed to be an ASCII - // superset, and certain assumptions and optimizations become - // available for ASCII bytes. - Map map[byte]rune - - // The ReplacementChar is the byte value to use for substitution. - // It should normally be ASCIISub for ASCII encodings. This may be - // unset (left to zero) for mappings that are strictly ASCII supersets. - // In that case ASCIISub will be assumed instead. - ReplacementChar byte -} - -type cmapDecoder struct { - transform.NopResetter - runes [256][]byte -} - -type cmapEncoder struct { - transform.NopResetter - bytes map[rune]byte - replace byte -} - -// Init initializes internal values of a character map. This should -// be done early, to minimize the cost of allocation of transforms -// later. It is not strictly necessary however, as the allocation -// functions will arrange to call it if it has not already been done. -func (c *Charmap) Init() { - c.once.Do(c.initialize) -} - -func (c *Charmap) initialize() { - c.bytes = make(map[rune]byte) - ascii := true - - for i := 0; i < 256; i++ { - r, ok := c.Map[byte(i)] - if !ok { - r = rune(i) - } - if r < 128 && r != rune(i) { - ascii = false - } - if r != RuneError { - c.bytes[r] = byte(i) - } - utf := make([]byte, utf8.RuneLen(r)) - utf8.EncodeRune(utf, r) - c.runes[i] = utf - } - if ascii && c.ReplacementChar == '\x00' { - c.ReplacementChar = ASCIISub - } -} - -// NewDecoder returns a Decoder the converts from the 8-bit -// character set to UTF-8. Unknown mappings, if any, are mapped -// to '\uFFFD'. -func (c *Charmap) NewDecoder() *encoding.Decoder { - c.Init() - return &encoding.Decoder{Transformer: &cmapDecoder{runes: c.runes}} -} - -// NewEncoder returns a Transformer that converts from UTF8 to the -// 8-bit character set. Unknown mappings are mapped to 0x1A. -func (c *Charmap) NewEncoder() *encoding.Encoder { - c.Init() - return &encoding.Encoder{ - Transformer: &cmapEncoder{ - bytes: c.bytes, - replace: c.ReplacementChar, - }, - } -} - -func (d *cmapDecoder) Transform(dst, src []byte, atEOF bool) (int, int, error) { - var e error - var ndst, nsrc int - - for _, c := range src { - b := d.runes[c] - l := len(b) - - if ndst+l > len(dst) { - e = transform.ErrShortDst - break - } - for i := 0; i < l; i++ { - dst[ndst] = b[i] - ndst++ - } - nsrc++ - } - return ndst, nsrc, e -} - -func (d *cmapEncoder) Transform(dst, src []byte, atEOF bool) (int, int, error) { - var e error - var ndst, nsrc int - for nsrc < len(src) { - if ndst >= len(dst) { - e = transform.ErrShortDst - break - } - - r, sz := utf8.DecodeRune(src[nsrc:]) - if r == utf8.RuneError && sz == 1 { - // If its inconclusive due to insufficient data in - // in the source, report it - if !atEOF && !utf8.FullRune(src[nsrc:]) { - e = transform.ErrShortSrc - break - } - } - - if c, ok := d.bytes[r]; ok { - dst[ndst] = c - } else { - dst[ndst] = d.replace - } - nsrc += sz - ndst++ - } - - return ndst, nsrc, e -} diff --git a/vendor/github.com/gdamore/encoding/doc.go b/vendor/github.com/gdamore/encoding/doc.go deleted file mode 100644 index 8a7b48d7..00000000 --- a/vendor/github.com/gdamore/encoding/doc.go +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2015 Garrett D'Amore -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package encoding provides a few of the encoding structures that are -// missing from the Go x/text/encoding tree. -package encoding diff --git a/vendor/github.com/gdamore/encoding/ebcdic.go b/vendor/github.com/gdamore/encoding/ebcdic.go deleted file mode 100644 index 8e13f1a9..00000000 --- a/vendor/github.com/gdamore/encoding/ebcdic.go +++ /dev/null @@ -1,273 +0,0 @@ -// Copyright 2015 Garrett D'Amore -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package encoding - -import ( - "golang.org/x/text/encoding" -) - -// EBCDIC represents the 8-bit EBCDIC scheme, found in some mainframe -// environments. If you don't know what this is, consider yourself lucky. -var EBCDIC encoding.Encoding - -func init() { - cm := &Charmap{ - ReplacementChar: '\x3f', - Map: map[byte]rune{ - // 0x00-0x03 match - 0x04: RuneError, - 0x05: '\t', - 0x06: RuneError, - 0x07: '\x7f', - 0x08: RuneError, - 0x09: RuneError, - 0x0a: RuneError, - // 0x0b-0x13 match - 0x14: RuneError, - 0x15: '\x85', // Not in any ISO code - 0x16: '\x08', - 0x17: RuneError, - // 0x18-0x19 match - 0x1a: RuneError, - 0x1b: RuneError, - // 0x1c-0x1f match - 0x20: RuneError, - 0x21: RuneError, - 0x22: RuneError, - 0x23: RuneError, - 0x24: RuneError, - 0x25: '\n', - 0x26: '\x17', - 0x27: '\x1b', - 0x28: RuneError, - 0x29: RuneError, - 0x2a: RuneError, - 0x2b: RuneError, - 0x2c: RuneError, - 0x2d: '\x05', - 0x2e: '\x06', - 0x2f: '\x07', - 0x30: RuneError, - 0x31: RuneError, - 0x32: '\x16', - 0x33: RuneError, - 0x34: RuneError, - 0x35: RuneError, - 0x36: RuneError, - 0x37: '\x04', - 0x38: RuneError, - 0x39: RuneError, - 0x3a: RuneError, - 0x3b: RuneError, - 0x3c: '\x14', - 0x3d: '\x15', - 0x3e: RuneError, - 0x3f: '\x1a', // also replacement char - 0x40: ' ', - 0x41: '\xa0', - 0x42: RuneError, - 0x43: RuneError, - 0x44: RuneError, - 0x45: RuneError, - 0x46: RuneError, - 0x47: RuneError, - 0x48: RuneError, - 0x49: RuneError, - 0x4a: RuneError, - 0x4b: '.', - 0x4c: '<', - 0x4d: '(', - 0x4e: '+', - 0x4f: '|', - 0x50: '&', - 0x51: RuneError, - 0x52: RuneError, - 0x53: RuneError, - 0x54: RuneError, - 0x55: RuneError, - 0x56: RuneError, - 0x57: RuneError, - 0x58: RuneError, - 0x59: RuneError, - 0x5a: '!', - 0x5b: '$', - 0x5c: '*', - 0x5d: ')', - 0x5e: ';', - 0x5f: '¬', - 0x60: '-', - 0x61: '/', - 0x62: RuneError, - 0x63: RuneError, - 0x64: RuneError, - 0x65: RuneError, - 0x66: RuneError, - 0x67: RuneError, - 0x68: RuneError, - 0x69: RuneError, - 0x6a: '¦', - 0x6b: ',', - 0x6c: '%', - 0x6d: '_', - 0x6e: '>', - 0x6f: '?', - 0x70: RuneError, - 0x71: RuneError, - 0x72: RuneError, - 0x73: RuneError, - 0x74: RuneError, - 0x75: RuneError, - 0x76: RuneError, - 0x77: RuneError, - 0x78: RuneError, - 0x79: '`', - 0x7a: ':', - 0x7b: '#', - 0x7c: '@', - 0x7d: '\'', - 0x7e: '=', - 0x7f: '"', - 0x80: RuneError, - 0x81: 'a', - 0x82: 'b', - 0x83: 'c', - 0x84: 'd', - 0x85: 'e', - 0x86: 'f', - 0x87: 'g', - 0x88: 'h', - 0x89: 'i', - 0x8a: RuneError, - 0x8b: RuneError, - 0x8c: RuneError, - 0x8d: RuneError, - 0x8e: RuneError, - 0x8f: '±', - 0x90: RuneError, - 0x91: 'j', - 0x92: 'k', - 0x93: 'l', - 0x94: 'm', - 0x95: 'n', - 0x96: 'o', - 0x97: 'p', - 0x98: 'q', - 0x99: 'r', - 0x9a: RuneError, - 0x9b: RuneError, - 0x9c: RuneError, - 0x9d: RuneError, - 0x9e: RuneError, - 0x9f: RuneError, - 0xa0: RuneError, - 0xa1: '~', - 0xa2: 's', - 0xa3: 't', - 0xa4: 'u', - 0xa5: 'v', - 0xa6: 'w', - 0xa7: 'x', - 0xa8: 'y', - 0xa9: 'z', - 0xaa: RuneError, - 0xab: RuneError, - 0xac: RuneError, - 0xad: RuneError, - 0xae: RuneError, - 0xaf: RuneError, - 0xb0: '^', - 0xb1: RuneError, - 0xb2: RuneError, - 0xb3: RuneError, - 0xb4: RuneError, - 0xb5: RuneError, - 0xb6: RuneError, - 0xb7: RuneError, - 0xb8: RuneError, - 0xb9: RuneError, - 0xba: '[', - 0xbb: ']', - 0xbc: RuneError, - 0xbd: RuneError, - 0xbe: RuneError, - 0xbf: RuneError, - 0xc0: '{', - 0xc1: 'A', - 0xc2: 'B', - 0xc3: 'C', - 0xc4: 'D', - 0xc5: 'E', - 0xc6: 'F', - 0xc7: 'G', - 0xc8: 'H', - 0xc9: 'I', - 0xca: '\xad', // NB: soft hyphen - 0xcb: RuneError, - 0xcc: RuneError, - 0xcd: RuneError, - 0xce: RuneError, - 0xcf: RuneError, - 0xd0: '}', - 0xd1: 'J', - 0xd2: 'K', - 0xd3: 'L', - 0xd4: 'M', - 0xd5: 'N', - 0xd6: 'O', - 0xd7: 'P', - 0xd8: 'Q', - 0xd9: 'R', - 0xda: RuneError, - 0xdb: RuneError, - 0xdc: RuneError, - 0xdd: RuneError, - 0xde: RuneError, - 0xdf: RuneError, - 0xe0: '\\', - 0xe1: '\u2007', // Non-breaking space - 0xe2: 'S', - 0xe3: 'T', - 0xe4: 'U', - 0xe5: 'V', - 0xe6: 'W', - 0xe7: 'X', - 0xe8: 'Y', - 0xe9: 'Z', - 0xea: RuneError, - 0xeb: RuneError, - 0xec: RuneError, - 0xed: RuneError, - 0xee: RuneError, - 0xef: RuneError, - 0xf0: '0', - 0xf1: '1', - 0xf2: '2', - 0xf3: '3', - 0xf4: '4', - 0xf5: '5', - 0xf6: '6', - 0xf7: '7', - 0xf8: '8', - 0xf9: '9', - 0xfa: RuneError, - 0xfb: RuneError, - 0xfc: RuneError, - 0xfd: RuneError, - 0xfe: RuneError, - 0xff: RuneError, - }} - cm.Init() - EBCDIC = cm -} diff --git a/vendor/github.com/gdamore/encoding/latin1.go b/vendor/github.com/gdamore/encoding/latin1.go deleted file mode 100644 index 226bf01d..00000000 --- a/vendor/github.com/gdamore/encoding/latin1.go +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2015 Garrett D'Amore -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package encoding - -import ( - "golang.org/x/text/encoding" -) - -// ISO8859_1 represents the 8-bit ISO8859-1 scheme. It decodes directly to -// UTF-8 without change, as all ISO8859-1 values are legal UTF-8. -// Unicode values less than 256 (i.e. 8 bits) map 1:1 with 8859-1. -// It encodes runes outside of that to 0x1A, the ASCII substitution character. -var ISO8859_1 encoding.Encoding - -func init() { - cm := &Charmap{} - cm.Init() - - // 8859-1 is the 8-bit identity map for Unicode. - ISO8859_1 = cm -} diff --git a/vendor/github.com/gdamore/encoding/latin5.go b/vendor/github.com/gdamore/encoding/latin5.go deleted file mode 100644 index c75ecf27..00000000 --- a/vendor/github.com/gdamore/encoding/latin5.go +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2015 Garrett D'Amore -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package encoding - -import ( - "golang.org/x/text/encoding" -) - -// ISO8859_9 represents the 8-bit ISO8859-9 scheme. -var ISO8859_9 encoding.Encoding - -func init() { - cm := &Charmap{Map: map[byte]rune{ - 0xD0: 'Ğ', - 0xDD: 'İ', - 0xDE: 'Ş', - 0xF0: 'ğ', - 0xFD: 'ı', - 0xFE: 'ş', - }} - cm.Init() - ISO8859_9 = cm -} diff --git a/vendor/github.com/gdamore/encoding/utf8.go b/vendor/github.com/gdamore/encoding/utf8.go deleted file mode 100644 index 2d59f4b3..00000000 --- a/vendor/github.com/gdamore/encoding/utf8.go +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2015 Garrett D'Amore -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package encoding - -import ( - "golang.org/x/text/encoding" -) - -type validUtf8 struct{} - -// UTF8 is an encoding for UTF-8. All it does is verify that the UTF-8 -// in is valid. The main reason for its existence is that it will detect -// and report ErrSrcShort or ErrDstShort, whereas the Nop encoding just -// passes every byte, blithely. -var UTF8 encoding.Encoding = validUtf8{} - -func (validUtf8) NewDecoder() *encoding.Decoder { - return &encoding.Decoder{Transformer: encoding.UTF8Validator} -} - -func (validUtf8) NewEncoder() *encoding.Encoder { - return &encoding.Encoder{Transformer: encoding.UTF8Validator} -} diff --git a/vendor/github.com/gdamore/tcell/.appveyor.yml b/vendor/github.com/gdamore/tcell/.appveyor.yml deleted file mode 100644 index 435dfe3a..00000000 --- a/vendor/github.com/gdamore/tcell/.appveyor.yml +++ /dev/null @@ -1,13 +0,0 @@ -version: 1.0.{build} -clone_folder: c:\gopath\src\github.com\gdamore\tcell -environment: - GOPATH: c:\gopath -build_script: -- go version -- go env -- SET PATH=%LOCALAPPDATA%\atom\bin;%GOPATH%\bin;%PATH% -- go get -t ./... -- go build -- go install ./... -test_script: -- go test ./... diff --git a/vendor/github.com/gdamore/tcell/.gitignore b/vendor/github.com/gdamore/tcell/.gitignore deleted file mode 100644 index c57100a5..00000000 --- a/vendor/github.com/gdamore/tcell/.gitignore +++ /dev/null @@ -1 +0,0 @@ -coverage.txt diff --git a/vendor/github.com/gdamore/tcell/.travis.yml b/vendor/github.com/gdamore/tcell/.travis.yml deleted file mode 100644 index fec3f669..00000000 --- a/vendor/github.com/gdamore/tcell/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -language: go - -go: - - 1.10.x - - 1.11.x - - master - -before_install: - - go get -t -v ./... - -script: - - go test -race -coverprofile=coverage.txt -covermode=atomic - -after_success: - - bash <(curl -s https://codecov.io/bash) diff --git a/vendor/github.com/gdamore/tcell/AUTHORS b/vendor/github.com/gdamore/tcell/AUTHORS deleted file mode 100644 index 53f87ee6..00000000 --- a/vendor/github.com/gdamore/tcell/AUTHORS +++ /dev/null @@ -1,4 +0,0 @@ -Garrett D'Amore -Zachary Yedidia -Junegunn Choi -Staysail Systems, Inc. diff --git a/vendor/github.com/gdamore/tcell/LICENSE b/vendor/github.com/gdamore/tcell/LICENSE deleted file mode 100644 index d6456956..00000000 --- a/vendor/github.com/gdamore/tcell/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/gdamore/tcell/README.adoc b/vendor/github.com/gdamore/tcell/README.adoc deleted file mode 100644 index bfea1e79..00000000 --- a/vendor/github.com/gdamore/tcell/README.adoc +++ /dev/null @@ -1,272 +0,0 @@ -= tcell - - -image:https://img.shields.io/travis/gdamore/tcell.svg?label=linux[Linux Status,link="https://travis-ci.org/gdamore/tcell"] -image:https://img.shields.io/appveyor/ci/gdamore/tcell.svg?label=windows[Windows Status,link="https://ci.appveyor.com/project/gdamore/tcell"] -image:https://img.shields.io/badge/license-APACHE2-blue.svg[Apache License,link="https://github.com/gdamore/tcell/blob/master/LICENSE"] -image:https://img.shields.io/badge/gitter-join-brightgreen.svg[Gitter,link="https://gitter.im/gdamore/tcell"] -image:https://img.shields.io/badge/godoc-reference-blue.svg[GoDoc,link="https://godoc.org/github.com/gdamore/tcell"] -image:http://goreportcard.com/badge/gdamore/tcell[Go Report Card,link="http://goreportcard.com/report/gdamore/tcell"] -image:https://codecov.io/gh/gdamore/tcell/branch/master/graph/badge.svg[codecov,link="https://codecov.io/gh/gdamore/tcell"] -image:https://tidelift.com/badges/github/gdamore/tcell?style=flat[Dependencies] - -[cols="2",grid="none"] -|=== -|_Tcell_ is a _Go_ package that provides a cell based view for text terminals, like _xterm_. -It was inspired by _termbox_, but includes many additional improvements. -a|[.right] -image::logos/tcell.png[float="right"] -|=== - -## Examples - -* https://github.com/gdamore/proxima5[proxima5] - space shooter (https://youtu.be/jNxKTCmY_bQ[video]) -* https://github.com/gdamore/govisor[govisor] - service management UI (http://2.bp.blogspot.com/--OsvnfzSNow/Vf7aqMw3zXI/AAAAAAAAARo/uOMtOvw4Sbg/s1600/Screen%2BShot%2B2015-09-20%2Bat%2B9.08.41%2BAM.png[screenshot]) -* mouse demo - included mouse test (http://2.bp.blogspot.com/-fWvW5opT0es/VhIdItdKqJI/AAAAAAAAATE/7Ojc0L1SpB0/s1600/Screen%2BShot%2B2015-10-04%2Bat%2B11.47.13%2BPM.png[screenshot]) -* https://github.com/gdamore/gomatrix[gomatrix] - converted from Termbox -* https://github.com/zyedidia/micro/[micro] - lightweight text editor with syntax-highlighting and themes -* https://github.com/viktomas/godu[godu] - simple golang utility helping to discover large files/folders. -* https://github.com/rivo/tview[tview] - rich interactive widgets for terminal UIs -* https://github.com/marcusolsson/tui-go[tui-go] - UI library for terminal apps -* https://github.com/rgm3/gomandelbrot[gomandelbrot] - Mandelbrot! -* https://github.com/senorprogrammer/wtf[WTF]- Personal information dashboard for your terminal -* https://github.com/browsh-org/browsh[browsh] - A fully-modern text-based browser, rendering to TTY and browsers (https://www.youtube.com/watch?v=HZq86XfBoRo[video]) -* https://github.com/sachaos/go-life[go-life] - Conway's Game of Life. -* https://github.com/gcla/gowid[gowid] - compositional widgets for terminal UIs, inspired by urwid -* https://termshark.io[termshark] - a terminal UI for tshark, inspired by Wireshark, built on gowid - -## Pure Go Terminfo Database - -_Tcell_ includes a full parser and expander for terminfo capability strings, -so that it can avoid hard coding escape strings for formatting. It also favors -portability, and includes support for all POSIX systems. - -The database is also flexible & extensible, and can modified by either running -a program to build the entire database, or an entry for just a single terminal. - -## More Portable - -_Tcell_ is portable to a wide variety of systems. -_Tcell_ is believed -to work with all of the systems officially supported by golang with -the exception of nacl (which lacks any kind of a terminal interface). -(Plan9 is not supported by _Tcell_, but it is experimental status only -in golang.) For all of these systems *except Solaris/illumos*, _Tcell_ -is pure Go, with no need for CGO. - -## No Async IO - -_Tcell_ is able to operate without requiring `SIGIO` signals (unlike _termbox_), -or asynchronous I/O, and can instead use standard Go file -objects and Go routines. -This means it should be safe, especially for -use with programs that use exec, or otherwise need to manipulate the -tty streams. -This model is also much closer to idiomatic Go, leading -to fewer surprises. - -## Rich Unicode & non-Unicode support - -_Tcell_ includes enhanced support for Unicode, including wide characters and -combining characters, provided your terminal can support them. -Note that -Windows terminals generally don't support the full Unicode repertoire. - -It will also convert to and from Unicode locales, so that the program -can work with UTF-8 internally, and get reasonable output in other locales. -_Tcell_ tries hard to convert to native characters on both input and output, and -on output _Tcell_ even makes use of the alternate character set to facilitate -drawing certain characters. - -## More Function Keys - -_Tcell_ also has richer support for a larger number of special keys that some terminals can send. - -## Better Color Handling - -_Tcell_ will respect your terminal's color space as specified within your terminfo -entries, so that for example attempts to emit color sequences on VT100 terminals -won't result in unintended consequences. - -In Windows mode, _Tcell_ supports 16 colors, bold, dim, and reverse, -instead of just termbox's 8 colors with reverse. (Note that there is some -conflation with bold/dim and colors.) - -_Tcell_ maps 16 colors down to 8, for terminals that need it. -(The upper 8 colors are just brighter versions of the lower 8.) - -## Better Mouse Support - -_Tcell_ supports enhanced mouse tracking mode, so your application can receive -regular mouse motion events, and wheel events, if your terminal supports it. - -## _Termbox_ Compatibility - -A compatibility layer for _termbox_ is provided in the `compat` directory. -To use it, try importing `github.com/gdamore/tcell/termbox` -instead. Most _termbox-go_ programs will probably work without further -modification. - -## Working With Unicode - -Internally Tcell uses UTF-8, just like Go. -However, Tcell understands how to -convert to and from other character sets, using the capabilities of -the `golang.org/x/text/encoding packages`. -Your application must supply -them, as the full set of the most common ones bloats the program by about 2MB. -If you're lazy, and want them all anyway, see the `encoding` sub-directory. - -## Wide & Combining Characters - -The `SetContent()` API takes a primary rune, and an optional list of combining runes. -If any of the runes is a wide (East Asian) rune occupying two cells, -then the library will skip output from the following cell, but care must be -taken in the application to avoid explicitly attempting to set content in the -next cell, otherwise the results are undefined. (Normally wide character -is displayed, and the other character is not; do not depend on that behavior.) - -Experience has shown that the vanilla Windows 8 console application does not -support any of these characters properly, but at least some options like -_ConEmu_ do support Wide characters. - -## Colors - -_Tcell_ assumes the ANSI/XTerm color model, including the 256 color map that -XTerm uses when it supports 256 colors. The terminfo guidance will be -honored, with respect to the number of colors supported. Also, only -terminals which expose ANSI style `setaf` and `setab` will support color; -if you have a color terminal that only has `setf` and `setb`, please let me -know; it wouldn't be hard to add that if there is need. - -## 24-bit Color - -_Tcell_ _supports true color_! (That is, if your terminal can support it, -_Tcell_ can accurately display 24-bit color.) - -To use 24-bit color, you need to use a terminal that supports it. Modern -xterm and similar teminal emulators can support this. As terminfo lacks any -way to describe this capability, we fabricate the capability for -terminals with names ending in `*-truecolor`. The stock distribution ships -with a database that defines `xterm-truecolor`. -To try it out, set your -`TERM` variable to `xterm-truecolor`. - -When using TrueColor, programs will display the colors that the programmer -intended, overriding any "`themes`" you may have set in your terminal -emulator. (For some cases, accurate color fidelity is more important -than respecting themes. For other cases, such as typical text apps that -only use a few colors, its more desirable to respect the themes that -the user has established.) - -If you find this undesirable, you can either use a `TERM` variable -that lacks the `TRUECOLOR` setting, or set `TCELL_TRUECOLOR=disable` in your -environment. - -## Performance - -Reasonable attempts have been made to minimize sending data to terminals, -avoiding repeated sequences or drawing the same cell on refresh updates. - -## Terminfo - -(Not relevent for Windows users.) - -The Terminfo implementation operates with two forms of database. The first -is the built-in go database, which contains a number of real database entries -that are compiled into the program directly. This should minimize calling -out to database file searches. - -The second is in the form of JSON files, that contain the same information, -which can be located either by the `$TCELLDB` environment file, `$HOME/.tcelldb`, -or is located in the Go source directory as `database.json`. - -These files (both the Go and the JSON files) can be generated using the -mkinfo.go program. If you need to regnerate the entire set for some reason, -run the mkdatabase.sh file. The generation uses the infocmp(1) program on -the system to collect the necessary information. - -The `mkinfo.go` program can also be used to generate specific database entries -for named terminals, in case your favorite terminal is missing. (If you -find that this is the case, please let me know and I'll try to add it!) - -_Tcell_ requires that the terminal support the `cup` mode of cursor addressing. -Terminals without absolute cursor addressability are not supported. -This is unlikely to be a problem; such terminals have not been mass produced -since the early 1970s. - -## Mouse Support - -Mouse support is detected via the `kmous` terminfo variable, however, -enablement/disablement and decoding mouse events is done using hard coded -sequences based on the XTerm X11 model. As of this writing all popular -terminals with mouse tracking support this model. (Full terminfo support -is not possible as terminfo sequences are not defined.) - -On Windows, the mouse works normally. - -Mouse wheel buttons on various terminals are known to work, but the support -in terminal emulators, as well as support for various buttons and -live mouse tracking, varies widely. Modern _xterm_, macOS _Terminal_, and _iTerm_ all work well. - -## Testablity - -There is a `SimulationScreen`, that can be used to simulate a real screen -for automated testing. The supplied tests do this. The simulation contains -event delivery, screen resizing support, and capabilities to inject events -and examine "`physical`" screen contents. - -## Platforms - -### POSIX (Linux, FreeBSD, macOS, Solaris, etc.) - -For mainstream systems with a suitably well defined system call interface -to tty settings, everything works using pure Go. - -For the remainder (right now means only Solaris/illumos) we use POSIX function -calls to manage termios, which implies that CGO is required on those platforms. - -### Windows - -Windows console mode applications are supported. Unfortunately _mintty_ -and other _cygwin_ style applications are not supported. - -Modern console applications like ConEmu, as well as the Windows 10 -console itself, support all the good features (resize, mouse tracking, etc.) - -I haven't figured out how to cleanly resolve the dichotomy between cygwin -style termios and the Windows Console API; it seems that perhaps nobody else -has either. If anyone has suggestions, let me know! Really, if you're -using a Windows application, you should use the native Windows console or a -fully compatible console implementation. - -### Plan9 and Native Client (Nacl) - -The nacl and plan9 platforms won't work, but compilation stubs are supplied -for folks that want to include parts of this in software targetting those -platforms. The Simulation screen works, but as Tcell doesn't know how to -allocate a real screen object on those platforms, `NewScreen()` will fail. - -If anyone has wisdom about how to improve support for either of these, -please let me know. PRs are especially welcome. - -### Commercial Support - -_Tcell_ is absolutely free, but if you want to obtain commercial, professional support, there are options. - -[cols="2",align="center",frame="none", grid="none"] -|=== -^.^| -image:logos/tidelift.png[100,100] -a| -https://tidelift.com/[Tidelift] subscriptions include support for _Tcell_, as well as many other open source packages. - -^.^| -image:logos/staysail.png[100,100] -a| -mailto:info@staysail.tech[Staysail Systems, Inc.] offers direct support, and custom development around _Tcell_ on an hourly basis. - -^.^| -image:logos/patreon.png[100,100] -a|I also welcome donations at https://www.patreon.com/gedamore/[Patreon], if you just want to make a contribution. -|=== diff --git a/vendor/github.com/gdamore/tcell/attr.go b/vendor/github.com/gdamore/tcell/attr.go deleted file mode 100644 index 866c0ebd..00000000 --- a/vendor/github.com/gdamore/tcell/attr.go +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2015 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tcell - -// AttrMask represents a mask of text attributes, apart from color. -// Note that support for attributes may vary widely across terminals. -type AttrMask int - -// Attributes are not colors, but affect the display of text. They can -// be combined. -const ( - AttrBold AttrMask = 1 << (25 + iota) - AttrBlink - AttrReverse - AttrUnderline - AttrDim - AttrNone AttrMask = 0 // Just normal text. -) - -const attrAll = AttrBold | AttrBlink | AttrReverse | AttrUnderline | AttrDim diff --git a/vendor/github.com/gdamore/tcell/cell.go b/vendor/github.com/gdamore/tcell/cell.go deleted file mode 100644 index c7f8f1ad..00000000 --- a/vendor/github.com/gdamore/tcell/cell.go +++ /dev/null @@ -1,177 +0,0 @@ -// Copyright 2019 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tcell - -import ( - runewidth "github.com/mattn/go-runewidth" -) - -type cell struct { - currMain rune - currComb []rune - currStyle Style - lastMain rune - lastStyle Style - lastComb []rune - width int -} - -// CellBuffer represents a two dimensional array of character cells. -// This is primarily intended for use by Screen implementors; it -// contains much of the common code they need. To create one, just -// declare a variable of its type; no explicit initialization is necessary. -// -// CellBuffer is not thread safe. -type CellBuffer struct { - w int - h int - cells []cell -} - -// SetContent sets the contents (primary rune, combining runes, -// and style) for a cell at a given location. -func (cb *CellBuffer) SetContent(x int, y int, - mainc rune, combc []rune, style Style) { - - if x >= 0 && y >= 0 && x < cb.w && y < cb.h { - c := &cb.cells[(y*cb.w)+x] - - c.currComb = append([]rune{}, combc...) - - if c.currMain != mainc { - c.width = runewidth.RuneWidth(mainc) - } - c.currMain = mainc - c.currStyle = style - } -} - -// GetContent returns the contents of a character cell, including the -// primary rune, any combining character runes (which will usually be -// nil), the style, and the display width in cells. (The width can be -// either 1, normally, or 2 for East Asian full-width characters.) -func (cb *CellBuffer) GetContent(x, y int) (rune, []rune, Style, int) { - var mainc rune - var combc []rune - var style Style - var width int - if x >= 0 && y >= 0 && x < cb.w && y < cb.h { - c := &cb.cells[(y*cb.w)+x] - mainc, combc, style = c.currMain, c.currComb, c.currStyle - if width = c.width; width == 0 || mainc < ' ' { - width = 1 - mainc = ' ' - } - } - return mainc, combc, style, width -} - -// Size returns the (width, height) in cells of the buffer. -func (cb *CellBuffer) Size() (int, int) { - return cb.w, cb.h -} - -// Invalidate marks all characters within the buffer as dirty. -func (cb *CellBuffer) Invalidate() { - for i := range cb.cells { - cb.cells[i].lastMain = rune(0) - } -} - -// Dirty checks if a character at the given location needs an -// to be refreshed on the physical display. This returns true -// if the cell content is different since the last time it was -// marked clean. -func (cb *CellBuffer) Dirty(x, y int) bool { - if x >= 0 && y >= 0 && x < cb.w && y < cb.h { - c := &cb.cells[(y*cb.w)+x] - if c.lastMain == rune(0) { - return true - } - if c.lastMain != c.currMain { - return true - } - if c.lastStyle != c.currStyle { - return true - } - if len(c.lastComb) != len(c.currComb) { - return true - } - for i := range c.lastComb { - if c.lastComb[i] != c.currComb[i] { - return true - } - } - } - return false -} - -// SetDirty is normally used to indicate that a cell has -// been displayed (in which case dirty is false), or to manually -// force a cell to be marked dirty. -func (cb *CellBuffer) SetDirty(x, y int, dirty bool) { - if x >= 0 && y >= 0 && x < cb.w && y < cb.h { - c := &cb.cells[(y*cb.w)+x] - if dirty { - c.lastMain = rune(0) - } else { - if c.currMain == rune(0) { - c.currMain = ' ' - } - c.lastMain = c.currMain - c.lastComb = c.currComb - c.lastStyle = c.currStyle - } - } -} - -// Resize is used to resize the cells array, with different dimensions, -// while preserving the original contents. The cells will be invalidated -// so that they can be redrawn. -func (cb *CellBuffer) Resize(w, h int) { - - if cb.h == h && cb.w == w { - return - } - - newc := make([]cell, w*h) - for y := 0; y < h && y < cb.h; y++ { - for x := 0; x < w && x < cb.w; x++ { - oc := &cb.cells[(y*cb.w)+x] - nc := &newc[(y*w)+x] - nc.currMain = oc.currMain - nc.currComb = oc.currComb - nc.currStyle = oc.currStyle - nc.width = oc.width - nc.lastMain = rune(0) - } - } - cb.cells = newc - cb.h = h - cb.w = w -} - -// Fill fills the entire cell buffer array with the specified character -// and style. Normally choose ' ' to clear the screen. This API doesn't -// support combining characters, or characters with a width larger than one. -func (cb *CellBuffer) Fill(r rune, style Style) { - for i := range cb.cells { - c := &cb.cells[i] - c.currMain = r - c.currComb = nil - c.currStyle = style - c.width = 1 - } -} diff --git a/vendor/github.com/gdamore/tcell/charset_stub.go b/vendor/github.com/gdamore/tcell/charset_stub.go deleted file mode 100644 index c1c1594c..00000000 --- a/vendor/github.com/gdamore/tcell/charset_stub.go +++ /dev/null @@ -1,21 +0,0 @@ -// +build plan9 nacl - -// Copyright 2015 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tcell - -func getCharset() string { - return "" -} diff --git a/vendor/github.com/gdamore/tcell/charset_unix.go b/vendor/github.com/gdamore/tcell/charset_unix.go deleted file mode 100644 index d9f9d8e1..00000000 --- a/vendor/github.com/gdamore/tcell/charset_unix.go +++ /dev/null @@ -1,49 +0,0 @@ -// +build !windows,!nacl,!plan9 - -// Copyright 2016 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tcell - -import ( - "os" - "strings" -) - -func getCharset() string { - // Determine the character set. This can help us later. - // Per POSIX, we search for LC_ALL first, then LC_CTYPE, and - // finally LANG. First one set wins. - locale := "" - if locale = os.Getenv("LC_ALL"); locale == "" { - if locale = os.Getenv("LC_CTYPE"); locale == "" { - locale = os.Getenv("LANG") - } - } - if locale == "POSIX" || locale == "C" { - return "US-ASCII" - } - if i := strings.IndexRune(locale, '@'); i >= 0 { - locale = locale[:i] - } - if i := strings.IndexRune(locale, '.'); i >= 0 { - locale = locale[i+1:] - } else { - // Default assumption, and on Linux we can see LC_ALL - // without a character set, which we assume implies UTF-8. - return "UTF-8" - } - // XXX: add support for aliases - return locale -} diff --git a/vendor/github.com/gdamore/tcell/charset_windows.go b/vendor/github.com/gdamore/tcell/charset_windows.go deleted file mode 100644 index 2400aa8a..00000000 --- a/vendor/github.com/gdamore/tcell/charset_windows.go +++ /dev/null @@ -1,21 +0,0 @@ -// +build windows - -// Copyright 2015 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tcell - -func getCharset() string { - return "UTF-16" -} diff --git a/vendor/github.com/gdamore/tcell/color.go b/vendor/github.com/gdamore/tcell/color.go deleted file mode 100644 index 2e096c70..00000000 --- a/vendor/github.com/gdamore/tcell/color.go +++ /dev/null @@ -1,1019 +0,0 @@ -// Copyright 2015 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tcell - -import "strconv" - -// Color represents a color. The low numeric values are the same as used -// by ECMA-48, and beyond that XTerm. A 24-bit RGB value may be used by -// adding in the ColorIsRGB flag. For Color names we use the W3C approved -// color names. -// -// Note that on various terminals colors may be approximated however, or -// not supported at all. If no suitable representation for a color is known, -// the library will simply not set any color, deferring to whatever default -// attributes the terminal uses. -type Color int32 - -const ( - // ColorDefault is used to leave the Color unchanged from whatever - // system or teminal default may exist. - ColorDefault Color = -1 - - // ColorIsRGB is used to indicate that the numeric value is not - // a known color constant, but rather an RGB value. The lower - // order 3 bytes are RGB. - ColorIsRGB Color = 1 << 24 -) - -// Note that the order of these options is important -- it follows the -// definitions used by ECMA and XTerm. Hence any further named colors -// must begin at a value not less than 256. -const ( - ColorBlack Color = iota - ColorMaroon - ColorGreen - ColorOlive - ColorNavy - ColorPurple - ColorTeal - ColorSilver - ColorGray - ColorRed - ColorLime - ColorYellow - ColorBlue - ColorFuchsia - ColorAqua - ColorWhite - Color16 - Color17 - Color18 - Color19 - Color20 - Color21 - Color22 - Color23 - Color24 - Color25 - Color26 - Color27 - Color28 - Color29 - Color30 - Color31 - Color32 - Color33 - Color34 - Color35 - Color36 - Color37 - Color38 - Color39 - Color40 - Color41 - Color42 - Color43 - Color44 - Color45 - Color46 - Color47 - Color48 - Color49 - Color50 - Color51 - Color52 - Color53 - Color54 - Color55 - Color56 - Color57 - Color58 - Color59 - Color60 - Color61 - Color62 - Color63 - Color64 - Color65 - Color66 - Color67 - Color68 - Color69 - Color70 - Color71 - Color72 - Color73 - Color74 - Color75 - Color76 - Color77 - Color78 - Color79 - Color80 - Color81 - Color82 - Color83 - Color84 - Color85 - Color86 - Color87 - Color88 - Color89 - Color90 - Color91 - Color92 - Color93 - Color94 - Color95 - Color96 - Color97 - Color98 - Color99 - Color100 - Color101 - Color102 - Color103 - Color104 - Color105 - Color106 - Color107 - Color108 - Color109 - Color110 - Color111 - Color112 - Color113 - Color114 - Color115 - Color116 - Color117 - Color118 - Color119 - Color120 - Color121 - Color122 - Color123 - Color124 - Color125 - Color126 - Color127 - Color128 - Color129 - Color130 - Color131 - Color132 - Color133 - Color134 - Color135 - Color136 - Color137 - Color138 - Color139 - Color140 - Color141 - Color142 - Color143 - Color144 - Color145 - Color146 - Color147 - Color148 - Color149 - Color150 - Color151 - Color152 - Color153 - Color154 - Color155 - Color156 - Color157 - Color158 - Color159 - Color160 - Color161 - Color162 - Color163 - Color164 - Color165 - Color166 - Color167 - Color168 - Color169 - Color170 - Color171 - Color172 - Color173 - Color174 - Color175 - Color176 - Color177 - Color178 - Color179 - Color180 - Color181 - Color182 - Color183 - Color184 - Color185 - Color186 - Color187 - Color188 - Color189 - Color190 - Color191 - Color192 - Color193 - Color194 - Color195 - Color196 - Color197 - Color198 - Color199 - Color200 - Color201 - Color202 - Color203 - Color204 - Color205 - Color206 - Color207 - Color208 - Color209 - Color210 - Color211 - Color212 - Color213 - Color214 - Color215 - Color216 - Color217 - Color218 - Color219 - Color220 - Color221 - Color222 - Color223 - Color224 - Color225 - Color226 - Color227 - Color228 - Color229 - Color230 - Color231 - Color232 - Color233 - Color234 - Color235 - Color236 - Color237 - Color238 - Color239 - Color240 - Color241 - Color242 - Color243 - Color244 - Color245 - Color246 - Color247 - Color248 - Color249 - Color250 - Color251 - Color252 - Color253 - Color254 - Color255 - ColorAliceBlue - ColorAntiqueWhite - ColorAquaMarine - ColorAzure - ColorBeige - ColorBisque - ColorBlanchedAlmond - ColorBlueViolet - ColorBrown - ColorBurlyWood - ColorCadetBlue - ColorChartreuse - ColorChocolate - ColorCoral - ColorCornflowerBlue - ColorCornsilk - ColorCrimson - ColorDarkBlue - ColorDarkCyan - ColorDarkGoldenrod - ColorDarkGray - ColorDarkGreen - ColorDarkKhaki - ColorDarkMagenta - ColorDarkOliveGreen - ColorDarkOrange - ColorDarkOrchid - ColorDarkRed - ColorDarkSalmon - ColorDarkSeaGreen - ColorDarkSlateBlue - ColorDarkSlateGray - ColorDarkTurquoise - ColorDarkViolet - ColorDeepPink - ColorDeepSkyBlue - ColorDimGray - ColorDodgerBlue - ColorFireBrick - ColorFloralWhite - ColorForestGreen - ColorGainsboro - ColorGhostWhite - ColorGold - ColorGoldenrod - ColorGreenYellow - ColorHoneydew - ColorHotPink - ColorIndianRed - ColorIndigo - ColorIvory - ColorKhaki - ColorLavender - ColorLavenderBlush - ColorLawnGreen - ColorLemonChiffon - ColorLightBlue - ColorLightCoral - ColorLightCyan - ColorLightGoldenrodYellow - ColorLightGray - ColorLightGreen - ColorLightPink - ColorLightSalmon - ColorLightSeaGreen - ColorLightSkyBlue - ColorLightSlateGray - ColorLightSteelBlue - ColorLightYellow - ColorLimeGreen - ColorLinen - ColorMediumAquamarine - ColorMediumBlue - ColorMediumOrchid - ColorMediumPurple - ColorMediumSeaGreen - ColorMediumSlateBlue - ColorMediumSpringGreen - ColorMediumTurquoise - ColorMediumVioletRed - ColorMidnightBlue - ColorMintCream - ColorMistyRose - ColorMoccasin - ColorNavajoWhite - ColorOldLace - ColorOliveDrab - ColorOrange - ColorOrangeRed - ColorOrchid - ColorPaleGoldenrod - ColorPaleGreen - ColorPaleTurquoise - ColorPaleVioletRed - ColorPapayaWhip - ColorPeachPuff - ColorPeru - ColorPink - ColorPlum - ColorPowderBlue - ColorRebeccaPurple - ColorRosyBrown - ColorRoyalBlue - ColorSaddleBrown - ColorSalmon - ColorSandyBrown - ColorSeaGreen - ColorSeashell - ColorSienna - ColorSkyblue - ColorSlateBlue - ColorSlateGray - ColorSnow - ColorSpringGreen - ColorSteelBlue - ColorTan - ColorThistle - ColorTomato - ColorTurquoise - ColorViolet - ColorWheat - ColorWhiteSmoke - ColorYellowGreen -) - -// These are aliases for the color gray, because some of us spell -// it as grey. -const ( - ColorGrey = ColorGray - ColorDimGrey = ColorDimGray - ColorDarkGrey = ColorDarkGray - ColorDarkSlateGrey = ColorDarkSlateGray - ColorLightGrey = ColorLightGray - ColorLightSlateGrey = ColorLightSlateGray - ColorSlateGrey = ColorSlateGray -) - -// ColorValues maps color constants to their RGB values. -var ColorValues = map[Color]int32{ - ColorBlack: 0x000000, - ColorMaroon: 0x800000, - ColorGreen: 0x008000, - ColorOlive: 0x808000, - ColorNavy: 0x000080, - ColorPurple: 0x800080, - ColorTeal: 0x008080, - ColorSilver: 0xC0C0C0, - ColorGray: 0x808080, - ColorRed: 0xFF0000, - ColorLime: 0x00FF00, - ColorYellow: 0xFFFF00, - ColorBlue: 0x0000FF, - ColorFuchsia: 0xFF00FF, - ColorAqua: 0x00FFFF, - ColorWhite: 0xFFFFFF, - Color16: 0x000000, // black - Color17: 0x00005F, - Color18: 0x000087, - Color19: 0x0000AF, - Color20: 0x0000D7, - Color21: 0x0000FF, // blue - Color22: 0x005F00, - Color23: 0x005F5F, - Color24: 0x005F87, - Color25: 0x005FAF, - Color26: 0x005FD7, - Color27: 0x005FFF, - Color28: 0x008700, - Color29: 0x00875F, - Color30: 0x008787, - Color31: 0x0087Af, - Color32: 0x0087D7, - Color33: 0x0087FF, - Color34: 0x00AF00, - Color35: 0x00AF5F, - Color36: 0x00AF87, - Color37: 0x00AFAF, - Color38: 0x00AFD7, - Color39: 0x00AFFF, - Color40: 0x00D700, - Color41: 0x00D75F, - Color42: 0x00D787, - Color43: 0x00D7AF, - Color44: 0x00D7D7, - Color45: 0x00D7FF, - Color46: 0x00FF00, // lime - Color47: 0x00FF5F, - Color48: 0x00FF87, - Color49: 0x00FFAF, - Color50: 0x00FFd7, - Color51: 0x00FFFF, // aqua - Color52: 0x5F0000, - Color53: 0x5F005F, - Color54: 0x5F0087, - Color55: 0x5F00AF, - Color56: 0x5F00D7, - Color57: 0x5F00FF, - Color58: 0x5F5F00, - Color59: 0x5F5F5F, - Color60: 0x5F5F87, - Color61: 0x5F5FAF, - Color62: 0x5F5FD7, - Color63: 0x5F5FFF, - Color64: 0x5F8700, - Color65: 0x5F875F, - Color66: 0x5F8787, - Color67: 0x5F87AF, - Color68: 0x5F87D7, - Color69: 0x5F87FF, - Color70: 0x5FAF00, - Color71: 0x5FAF5F, - Color72: 0x5FAF87, - Color73: 0x5FAFAF, - Color74: 0x5FAFD7, - Color75: 0x5FAFFF, - Color76: 0x5FD700, - Color77: 0x5FD75F, - Color78: 0x5FD787, - Color79: 0x5FD7AF, - Color80: 0x5FD7D7, - Color81: 0x5FD7FF, - Color82: 0x5FFF00, - Color83: 0x5FFF5F, - Color84: 0x5FFF87, - Color85: 0x5FFFAF, - Color86: 0x5FFFD7, - Color87: 0x5FFFFF, - Color88: 0x870000, - Color89: 0x87005F, - Color90: 0x870087, - Color91: 0x8700AF, - Color92: 0x8700D7, - Color93: 0x8700FF, - Color94: 0x875F00, - Color95: 0x875F5F, - Color96: 0x875F87, - Color97: 0x875FAF, - Color98: 0x875FD7, - Color99: 0x875FFF, - Color100: 0x878700, - Color101: 0x87875F, - Color102: 0x878787, - Color103: 0x8787AF, - Color104: 0x8787D7, - Color105: 0x8787FF, - Color106: 0x87AF00, - Color107: 0x87AF5F, - Color108: 0x87AF87, - Color109: 0x87AFAF, - Color110: 0x87AFD7, - Color111: 0x87AFFF, - Color112: 0x87D700, - Color113: 0x87D75F, - Color114: 0x87D787, - Color115: 0x87D7AF, - Color116: 0x87D7D7, - Color117: 0x87D7FF, - Color118: 0x87FF00, - Color119: 0x87FF5F, - Color120: 0x87FF87, - Color121: 0x87FFAF, - Color122: 0x87FFD7, - Color123: 0x87FFFF, - Color124: 0xAF0000, - Color125: 0xAF005F, - Color126: 0xAF0087, - Color127: 0xAF00AF, - Color128: 0xAF00D7, - Color129: 0xAF00FF, - Color130: 0xAF5F00, - Color131: 0xAF5F5F, - Color132: 0xAF5F87, - Color133: 0xAF5FAF, - Color134: 0xAF5FD7, - Color135: 0xAF5FFF, - Color136: 0xAF8700, - Color137: 0xAF875F, - Color138: 0xAF8787, - Color139: 0xAF87AF, - Color140: 0xAF87D7, - Color141: 0xAF87FF, - Color142: 0xAFAF00, - Color143: 0xAFAF5F, - Color144: 0xAFAF87, - Color145: 0xAFAFAF, - Color146: 0xAFAFD7, - Color147: 0xAFAFFF, - Color148: 0xAFD700, - Color149: 0xAFD75F, - Color150: 0xAFD787, - Color151: 0xAFD7AF, - Color152: 0xAFD7D7, - Color153: 0xAFD7FF, - Color154: 0xAFFF00, - Color155: 0xAFFF5F, - Color156: 0xAFFF87, - Color157: 0xAFFFAF, - Color158: 0xAFFFD7, - Color159: 0xAFFFFF, - Color160: 0xD70000, - Color161: 0xD7005F, - Color162: 0xD70087, - Color163: 0xD700AF, - Color164: 0xD700D7, - Color165: 0xD700FF, - Color166: 0xD75F00, - Color167: 0xD75F5F, - Color168: 0xD75F87, - Color169: 0xD75FAF, - Color170: 0xD75FD7, - Color171: 0xD75FFF, - Color172: 0xD78700, - Color173: 0xD7875F, - Color174: 0xD78787, - Color175: 0xD787AF, - Color176: 0xD787D7, - Color177: 0xD787FF, - Color178: 0xD7AF00, - Color179: 0xD7AF5F, - Color180: 0xD7AF87, - Color181: 0xD7AFAF, - Color182: 0xD7AFD7, - Color183: 0xD7AFFF, - Color184: 0xD7D700, - Color185: 0xD7D75F, - Color186: 0xD7D787, - Color187: 0xD7D7AF, - Color188: 0xD7D7D7, - Color189: 0xD7D7FF, - Color190: 0xD7FF00, - Color191: 0xD7FF5F, - Color192: 0xD7FF87, - Color193: 0xD7FFAF, - Color194: 0xD7FFD7, - Color195: 0xD7FFFF, - Color196: 0xFF0000, // red - Color197: 0xFF005F, - Color198: 0xFF0087, - Color199: 0xFF00AF, - Color200: 0xFF00D7, - Color201: 0xFF00FF, // fuchsia - Color202: 0xFF5F00, - Color203: 0xFF5F5F, - Color204: 0xFF5F87, - Color205: 0xFF5FAF, - Color206: 0xFF5FD7, - Color207: 0xFF5FFF, - Color208: 0xFF8700, - Color209: 0xFF875F, - Color210: 0xFF8787, - Color211: 0xFF87AF, - Color212: 0xFF87D7, - Color213: 0xFF87FF, - Color214: 0xFFAF00, - Color215: 0xFFAF5F, - Color216: 0xFFAF87, - Color217: 0xFFAFAF, - Color218: 0xFFAFD7, - Color219: 0xFFAFFF, - Color220: 0xFFD700, - Color221: 0xFFD75F, - Color222: 0xFFD787, - Color223: 0xFFD7AF, - Color224: 0xFFD7D7, - Color225: 0xFFD7FF, - Color226: 0xFFFF00, // yellow - Color227: 0xFFFF5F, - Color228: 0xFFFF87, - Color229: 0xFFFFAF, - Color230: 0xFFFFD7, - Color231: 0xFFFFFF, // white - Color232: 0x080808, - Color233: 0x121212, - Color234: 0x1C1C1C, - Color235: 0x262626, - Color236: 0x303030, - Color237: 0x3A3A3A, - Color238: 0x444444, - Color239: 0x4E4E4E, - Color240: 0x585858, - Color241: 0x626262, - Color242: 0x6C6C6C, - Color243: 0x767676, - Color244: 0x808080, // grey - Color245: 0x8A8A8A, - Color246: 0x949494, - Color247: 0x9E9E9E, - Color248: 0xA8A8A8, - Color249: 0xB2B2B2, - Color250: 0xBCBCBC, - Color251: 0xC6C6C6, - Color252: 0xD0D0D0, - Color253: 0xDADADA, - Color254: 0xE4E4E4, - Color255: 0xEEEEEE, - ColorAliceBlue: 0xF0F8FF, - ColorAntiqueWhite: 0xFAEBD7, - ColorAquaMarine: 0x7FFFD4, - ColorAzure: 0xF0FFFF, - ColorBeige: 0xF5F5DC, - ColorBisque: 0xFFE4C4, - ColorBlanchedAlmond: 0xFFEBCD, - ColorBlueViolet: 0x8A2BE2, - ColorBrown: 0xA52A2A, - ColorBurlyWood: 0xDEB887, - ColorCadetBlue: 0x5F9EA0, - ColorChartreuse: 0x7FFF00, - ColorChocolate: 0xD2691E, - ColorCoral: 0xFF7F50, - ColorCornflowerBlue: 0x6495ED, - ColorCornsilk: 0xFFF8DC, - ColorCrimson: 0xDC143C, - ColorDarkBlue: 0x00008B, - ColorDarkCyan: 0x008B8B, - ColorDarkGoldenrod: 0xB8860B, - ColorDarkGray: 0xA9A9A9, - ColorDarkGreen: 0x006400, - ColorDarkKhaki: 0xBDB76B, - ColorDarkMagenta: 0x8B008B, - ColorDarkOliveGreen: 0x556B2F, - ColorDarkOrange: 0xFF8C00, - ColorDarkOrchid: 0x9932CC, - ColorDarkRed: 0x8B0000, - ColorDarkSalmon: 0xE9967A, - ColorDarkSeaGreen: 0x8FBC8F, - ColorDarkSlateBlue: 0x483D8B, - ColorDarkSlateGray: 0x2F4F4F, - ColorDarkTurquoise: 0x00CED1, - ColorDarkViolet: 0x9400D3, - ColorDeepPink: 0xFF1493, - ColorDeepSkyBlue: 0x00BFFF, - ColorDimGray: 0x696969, - ColorDodgerBlue: 0x1E90FF, - ColorFireBrick: 0xB22222, - ColorFloralWhite: 0xFFFAF0, - ColorForestGreen: 0x228B22, - ColorGainsboro: 0xDCDCDC, - ColorGhostWhite: 0xF8F8FF, - ColorGold: 0xFFD700, - ColorGoldenrod: 0xDAA520, - ColorGreenYellow: 0xADFF2F, - ColorHoneydew: 0xF0FFF0, - ColorHotPink: 0xFF69B4, - ColorIndianRed: 0xCD5C5C, - ColorIndigo: 0x4B0082, - ColorIvory: 0xFFFFF0, - ColorKhaki: 0xF0E68C, - ColorLavender: 0xE6E6FA, - ColorLavenderBlush: 0xFFF0F5, - ColorLawnGreen: 0x7CFC00, - ColorLemonChiffon: 0xFFFACD, - ColorLightBlue: 0xADD8E6, - ColorLightCoral: 0xF08080, - ColorLightCyan: 0xE0FFFF, - ColorLightGoldenrodYellow: 0xFAFAD2, - ColorLightGray: 0xD3D3D3, - ColorLightGreen: 0x90EE90, - ColorLightPink: 0xFFB6C1, - ColorLightSalmon: 0xFFA07A, - ColorLightSeaGreen: 0x20B2AA, - ColorLightSkyBlue: 0x87CEFA, - ColorLightSlateGray: 0x778899, - ColorLightSteelBlue: 0xB0C4DE, - ColorLightYellow: 0xFFFFE0, - ColorLimeGreen: 0x32CD32, - ColorLinen: 0xFAF0E6, - ColorMediumAquamarine: 0x66CDAA, - ColorMediumBlue: 0x0000CD, - ColorMediumOrchid: 0xBA55D3, - ColorMediumPurple: 0x9370DB, - ColorMediumSeaGreen: 0x3CB371, - ColorMediumSlateBlue: 0x7B68EE, - ColorMediumSpringGreen: 0x00FA9A, - ColorMediumTurquoise: 0x48D1CC, - ColorMediumVioletRed: 0xC71585, - ColorMidnightBlue: 0x191970, - ColorMintCream: 0xF5FFFA, - ColorMistyRose: 0xFFE4E1, - ColorMoccasin: 0xFFE4B5, - ColorNavajoWhite: 0xFFDEAD, - ColorOldLace: 0xFDF5E6, - ColorOliveDrab: 0x6B8E23, - ColorOrange: 0xFFA500, - ColorOrangeRed: 0xFF4500, - ColorOrchid: 0xDA70D6, - ColorPaleGoldenrod: 0xEEE8AA, - ColorPaleGreen: 0x98FB98, - ColorPaleTurquoise: 0xAFEEEE, - ColorPaleVioletRed: 0xDB7093, - ColorPapayaWhip: 0xFFEFD5, - ColorPeachPuff: 0xFFDAB9, - ColorPeru: 0xCD853F, - ColorPink: 0xFFC0CB, - ColorPlum: 0xDDA0DD, - ColorPowderBlue: 0xB0E0E6, - ColorRebeccaPurple: 0x663399, - ColorRosyBrown: 0xBC8F8F, - ColorRoyalBlue: 0x4169E1, - ColorSaddleBrown: 0x8B4513, - ColorSalmon: 0xFA8072, - ColorSandyBrown: 0xF4A460, - ColorSeaGreen: 0x2E8B57, - ColorSeashell: 0xFFF5EE, - ColorSienna: 0xA0522D, - ColorSkyblue: 0x87CEEB, - ColorSlateBlue: 0x6A5ACD, - ColorSlateGray: 0x708090, - ColorSnow: 0xFFFAFA, - ColorSpringGreen: 0x00FF7F, - ColorSteelBlue: 0x4682B4, - ColorTan: 0xD2B48C, - ColorThistle: 0xD8BFD8, - ColorTomato: 0xFF6347, - ColorTurquoise: 0x40E0D0, - ColorViolet: 0xEE82EE, - ColorWheat: 0xF5DEB3, - ColorWhiteSmoke: 0xF5F5F5, - ColorYellowGreen: 0x9ACD32, -} - -// ColorNames holds the written names of colors. Useful to present a list of -// recognized named colors. -var ColorNames = map[string]Color{ - "black": ColorBlack, - "maroon": ColorMaroon, - "green": ColorGreen, - "olive": ColorOlive, - "navy": ColorNavy, - "purple": ColorPurple, - "teal": ColorTeal, - "silver": ColorSilver, - "gray": ColorGray, - "red": ColorRed, - "lime": ColorLime, - "yellow": ColorYellow, - "blue": ColorBlue, - "fuchsia": ColorFuchsia, - "aqua": ColorAqua, - "white": ColorWhite, - "aliceblue": ColorAliceBlue, - "antiquewhite": ColorAntiqueWhite, - "aquamarine": ColorAquaMarine, - "azure": ColorAzure, - "beige": ColorBeige, - "bisque": ColorBisque, - "blanchedalmond": ColorBlanchedAlmond, - "blueviolet": ColorBlueViolet, - "brown": ColorBrown, - "burlywood": ColorBurlyWood, - "cadetblue": ColorCadetBlue, - "chartreuse": ColorChartreuse, - "chocolate": ColorChocolate, - "coral": ColorCoral, - "cornflowerblue": ColorCornflowerBlue, - "cornsilk": ColorCornsilk, - "crimson": ColorCrimson, - "darkblue": ColorDarkBlue, - "darkcyan": ColorDarkCyan, - "darkgoldenrod": ColorDarkGoldenrod, - "darkgray": ColorDarkGray, - "darkgreen": ColorDarkGreen, - "darkkhaki": ColorDarkKhaki, - "darkmagenta": ColorDarkMagenta, - "darkolivegreen": ColorDarkOliveGreen, - "darkorange": ColorDarkOrange, - "darkorchid": ColorDarkOrchid, - "darkred": ColorDarkRed, - "darksalmon": ColorDarkSalmon, - "darkseagreen": ColorDarkSeaGreen, - "darkslateblue": ColorDarkSlateBlue, - "darkslategray": ColorDarkSlateGray, - "darkturquoise": ColorDarkTurquoise, - "darkviolet": ColorDarkViolet, - "deeppink": ColorDeepPink, - "deepskyblue": ColorDeepSkyBlue, - "dimgray": ColorDimGray, - "dodgerblue": ColorDodgerBlue, - "firebrick": ColorFireBrick, - "floralwhite": ColorFloralWhite, - "forestgreen": ColorForestGreen, - "gainsboro": ColorGainsboro, - "ghostwhite": ColorGhostWhite, - "gold": ColorGold, - "goldenrod": ColorGoldenrod, - "greenyellow": ColorGreenYellow, - "honeydew": ColorHoneydew, - "hotpink": ColorHotPink, - "indianred": ColorIndianRed, - "indigo": ColorIndigo, - "ivory": ColorIvory, - "khaki": ColorKhaki, - "lavender": ColorLavender, - "lavenderblush": ColorLavenderBlush, - "lawngreen": ColorLawnGreen, - "lemonchiffon": ColorLemonChiffon, - "lightblue": ColorLightBlue, - "lightcoral": ColorLightCoral, - "lightcyan": ColorLightCyan, - "lightgoldenrodyellow": ColorLightGoldenrodYellow, - "lightgray": ColorLightGray, - "lightgreen": ColorLightGreen, - "lightpink": ColorLightPink, - "lightsalmon": ColorLightSalmon, - "lightseagreen": ColorLightSeaGreen, - "lightskyblue": ColorLightSkyBlue, - "lightslategray": ColorLightSlateGray, - "lightsteelblue": ColorLightSteelBlue, - "lightyellow": ColorLightYellow, - "limegreen": ColorLimeGreen, - "linen": ColorLinen, - "mediumaquamarine": ColorMediumAquamarine, - "mediumblue": ColorMediumBlue, - "mediumorchid": ColorMediumOrchid, - "mediumpurple": ColorMediumPurple, - "mediumseagreen": ColorMediumSeaGreen, - "mediumslateblue": ColorMediumSlateBlue, - "mediumspringgreen": ColorMediumSpringGreen, - "mediumturquoise": ColorMediumTurquoise, - "mediumvioletred": ColorMediumVioletRed, - "midnightblue": ColorMidnightBlue, - "mintcream": ColorMintCream, - "mistyrose": ColorMistyRose, - "moccasin": ColorMoccasin, - "navajowhite": ColorNavajoWhite, - "oldlace": ColorOldLace, - "olivedrab": ColorOliveDrab, - "orange": ColorOrange, - "orangered": ColorOrangeRed, - "orchid": ColorOrchid, - "palegoldenrod": ColorPaleGoldenrod, - "palegreen": ColorPaleGreen, - "paleturquoise": ColorPaleTurquoise, - "palevioletred": ColorPaleVioletRed, - "papayawhip": ColorPapayaWhip, - "peachpuff": ColorPeachPuff, - "peru": ColorPeru, - "pink": ColorPink, - "plum": ColorPlum, - "powderblue": ColorPowderBlue, - "rebeccapurple": ColorRebeccaPurple, - "rosybrown": ColorRosyBrown, - "royalblue": ColorRoyalBlue, - "saddlebrown": ColorSaddleBrown, - "salmon": ColorSalmon, - "sandybrown": ColorSandyBrown, - "seagreen": ColorSeaGreen, - "seashell": ColorSeashell, - "sienna": ColorSienna, - "skyblue": ColorSkyblue, - "slateblue": ColorSlateBlue, - "slategray": ColorSlateGray, - "snow": ColorSnow, - "springgreen": ColorSpringGreen, - "steelblue": ColorSteelBlue, - "tan": ColorTan, - "thistle": ColorThistle, - "tomato": ColorTomato, - "turquoise": ColorTurquoise, - "violet": ColorViolet, - "wheat": ColorWheat, - "whitesmoke": ColorWhiteSmoke, - "yellowgreen": ColorYellowGreen, - "grey": ColorGray, - "dimgrey": ColorDimGray, - "darkgrey": ColorDarkGray, - "darkslategrey": ColorDarkSlateGray, - "lightgrey": ColorLightGray, - "lightslategrey": ColorLightSlateGray, - "slategrey": ColorSlateGray, -} - -// Hex returns the color's hexadecimal RGB 24-bit value with each component -// consisting of a single byte, ala R << 16 | G << 8 | B. If the color -// is unknown or unset, -1 is returned. -func (c Color) Hex() int32 { - if c&ColorIsRGB != 0 { - return (int32(c) & 0xffffff) - } - if v, ok := ColorValues[c]; ok { - return v - } - return -1 -} - -// RGB returns the red, green, and blue components of the color, with -// each component represented as a value 0-255. In the event that the -// color cannot be broken up (not set usually), -1 is returned for each value. -func (c Color) RGB() (int32, int32, int32) { - v := c.Hex() - if v < 0 { - return -1, -1, -1 - } - return (v >> 16) & 0xff, (v >> 8) & 0xff, v & 0xff -} - -// NewRGBColor returns a new color with the given red, green, and blue values. -// Each value must be represented in the range 0-255. -func NewRGBColor(r, g, b int32) Color { - return NewHexColor(((r & 0xff) << 16) | ((g & 0xff) << 8) | (b & 0xff)) -} - -// NewHexColor returns a color using the given 24-bit RGB value. -func NewHexColor(v int32) Color { - return ColorIsRGB | Color(v) -} - -// GetColor creates a Color from a color name (W3C name). A hex value may -// be supplied as a string in the format "#ffffff". -func GetColor(name string) Color { - if c, ok := ColorNames[name]; ok { - return c - } - if len(name) == 7 && name[0] == '#' { - if v, e := strconv.ParseInt(name[1:], 16, 32); e == nil { - return NewHexColor(int32(v)) - } - } - return ColorDefault -} diff --git a/vendor/github.com/gdamore/tcell/colorfit.go b/vendor/github.com/gdamore/tcell/colorfit.go deleted file mode 100644 index b7740b8a..00000000 --- a/vendor/github.com/gdamore/tcell/colorfit.go +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2016 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tcell - -import ( - "github.com/lucasb-eyer/go-colorful" - "math" -) - -// FindColor attempts to find a given color, or the best match possible for it, -// from the palette given. This is an expensive operation, so results should -// be cached by the caller. -func FindColor(c Color, palette []Color) Color { - match := ColorDefault - dist := float64(0) - r, g, b := c.RGB() - c1 := colorful.Color{ - R: float64(r) / 255.0, - G: float64(g) / 255.0, - B: float64(b) / 255.0, - } - for _, d := range palette { - r, g, b = d.RGB() - c2 := colorful.Color{ - R: float64(r) / 255.0, - G: float64(g) / 255.0, - B: float64(b) / 255.0, - } - // CIE94 is more accurate, but really really expensive. - nd := c1.DistanceCIE76(c2) - if math.IsNaN(nd) { - nd = math.Inf(1) - } - if match == ColorDefault || nd < dist { - match = d - dist = nd - } - } - return match -} diff --git a/vendor/github.com/gdamore/tcell/console_stub.go b/vendor/github.com/gdamore/tcell/console_stub.go deleted file mode 100644 index fda2f092..00000000 --- a/vendor/github.com/gdamore/tcell/console_stub.go +++ /dev/null @@ -1,23 +0,0 @@ -// +build !windows - -// Copyright 2015 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tcell - -// NewConsoleScreen returns a console based screen. This platform -// doesn't have support for any, so it returns nil and a suitable error. -func NewConsoleScreen() (Screen, error) { - return nil, ErrNoScreen -} diff --git a/vendor/github.com/gdamore/tcell/console_win.go b/vendor/github.com/gdamore/tcell/console_win.go deleted file mode 100644 index 3ebcc713..00000000 --- a/vendor/github.com/gdamore/tcell/console_win.go +++ /dev/null @@ -1,1033 +0,0 @@ -// +build windows - -// Copyright 2019 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tcell - -import ( - "errors" - "sync" - "syscall" - "unicode/utf16" - "unsafe" -) - -type cScreen struct { - in syscall.Handle - out syscall.Handle - cancelflag syscall.Handle - scandone chan struct{} - evch chan Event - quit chan struct{} - curx int - cury int - style Style - clear bool - fini bool - - w int - h int - - oscreen consoleInfo - ocursor cursorInfo - oimode uint32 - oomode uint32 - cells CellBuffer - colors map[Color]Color - - sync.Mutex -} - -var winLock sync.Mutex - -var winPalette = []Color{ - ColorBlack, - ColorMaroon, - ColorGreen, - ColorNavy, - ColorOlive, - ColorPurple, - ColorTeal, - ColorSilver, - ColorGray, - ColorRed, - ColorLime, - ColorBlue, - ColorYellow, - ColorFuchsia, - ColorAqua, - ColorWhite, -} - -var winColors = map[Color]Color{ - ColorBlack: ColorBlack, - ColorMaroon: ColorMaroon, - ColorGreen: ColorGreen, - ColorNavy: ColorNavy, - ColorOlive: ColorOlive, - ColorPurple: ColorPurple, - ColorTeal: ColorTeal, - ColorSilver: ColorSilver, - ColorGray: ColorGray, - ColorRed: ColorRed, - ColorLime: ColorLime, - ColorBlue: ColorBlue, - ColorYellow: ColorYellow, - ColorFuchsia: ColorFuchsia, - ColorAqua: ColorAqua, - ColorWhite: ColorWhite, -} - -var k32 = syscall.NewLazyDLL("kernel32.dll") - -// We have to bring in the kernel32.dll directly, so we can get access to some -// system calls that the core Go API lacks. -// -// Note that Windows appends some functions with W to indicate that wide -// characters (Unicode) are in use. The documentation refers to them -// without this suffix, as the resolution is made via preprocessor. -var ( - procReadConsoleInput = k32.NewProc("ReadConsoleInputW") - procWaitForMultipleObjects = k32.NewProc("WaitForMultipleObjects") - procCreateEvent = k32.NewProc("CreateEventW") - procSetEvent = k32.NewProc("SetEvent") - procGetConsoleCursorInfo = k32.NewProc("GetConsoleCursorInfo") - procSetConsoleCursorInfo = k32.NewProc("SetConsoleCursorInfo") - procSetConsoleCursorPosition = k32.NewProc("SetConsoleCursorPosition") - procSetConsoleMode = k32.NewProc("SetConsoleMode") - procGetConsoleMode = k32.NewProc("GetConsoleMode") - procGetConsoleScreenBufferInfo = k32.NewProc("GetConsoleScreenBufferInfo") - procFillConsoleOutputAttribute = k32.NewProc("FillConsoleOutputAttribute") - procFillConsoleOutputCharacter = k32.NewProc("FillConsoleOutputCharacterW") - procSetConsoleWindowInfo = k32.NewProc("SetConsoleWindowInfo") - procSetConsoleScreenBufferSize = k32.NewProc("SetConsoleScreenBufferSize") - procSetConsoleTextAttribute = k32.NewProc("SetConsoleTextAttribute") -) - -const ( - w32Infinite = ^uintptr(0) - w32WaitObject0 = uintptr(0) -) - -// NewConsoleScreen returns a Screen for the Windows console associated -// with the current process. The Screen makes use of the Windows Console -// API to display content and read events. -func NewConsoleScreen() (Screen, error) { - return &cScreen{}, nil -} - -func (s *cScreen) Init() error { - s.evch = make(chan Event, 10) - s.quit = make(chan struct{}) - s.scandone = make(chan struct{}) - - in, e := syscall.Open("CONIN$", syscall.O_RDWR, 0) - if e != nil { - return e - } - s.in = in - out, e := syscall.Open("CONOUT$", syscall.O_RDWR, 0) - if e != nil { - syscall.Close(s.in) - return e - } - s.out = out - - cf, _, e := procCreateEvent.Call( - uintptr(0), - uintptr(1), - uintptr(0), - uintptr(0)) - if cf == uintptr(0) { - return e - } - s.cancelflag = syscall.Handle(cf) - - s.Lock() - - s.curx = -1 - s.cury = -1 - s.style = StyleDefault - s.getCursorInfo(&s.ocursor) - s.getConsoleInfo(&s.oscreen) - s.getOutMode(&s.oomode) - s.getInMode(&s.oimode) - s.resize() - - s.fini = false - s.setInMode(modeResizeEn) - s.setOutMode(0) - s.clearScreen(s.style) - s.hideCursor() - s.Unlock() - go s.scanInput() - - return nil -} - -func (s *cScreen) CharacterSet() string { - // We are always UTF-16LE on Windows - return "UTF-16LE" -} - -func (s *cScreen) EnableMouse() { - s.setInMode(modeResizeEn | modeMouseEn | modeExtndFlg) -} - -func (s *cScreen) DisableMouse() { - s.setInMode(modeResizeEn) -} - -func (s *cScreen) Fini() { - s.Lock() - s.style = StyleDefault - s.curx = -1 - s.cury = -1 - s.fini = true - s.Unlock() - - s.setCursorInfo(&s.ocursor) - s.setInMode(s.oimode) - s.setOutMode(s.oomode) - s.setBufferSize(int(s.oscreen.size.x), int(s.oscreen.size.y)) - s.clearScreen(StyleDefault) - s.setCursorPos(0, 0) - procSetConsoleTextAttribute.Call( - uintptr(s.out), - uintptr(s.mapStyle(StyleDefault))) - - close(s.quit) - procSetEvent.Call(uintptr(s.cancelflag)) - // Block until scanInput returns; this prevents a race condition on Win 8+ - // which causes syscall.Close to block until another keypress is read. - <-s.scandone - syscall.Close(s.in) - syscall.Close(s.out) -} - -func (s *cScreen) PostEventWait(ev Event) { - s.evch <- ev -} - -func (s *cScreen) PostEvent(ev Event) error { - select { - case s.evch <- ev: - return nil - default: - return ErrEventQFull - } -} - -func (s *cScreen) PollEvent() Event { - select { - case <-s.quit: - return nil - case ev := <-s.evch: - return ev - } -} - -type cursorInfo struct { - size uint32 - visible uint32 -} - -type coord struct { - x int16 - y int16 -} - -func (c coord) uintptr() uintptr { - // little endian, put x first - return uintptr(c.x) | (uintptr(c.y) << 16) -} - -type rect struct { - left int16 - top int16 - right int16 - bottom int16 -} - -func (s *cScreen) showCursor() { - s.setCursorInfo(&cursorInfo{size: 100, visible: 1}) -} - -func (s *cScreen) hideCursor() { - s.setCursorInfo(&cursorInfo{size: 1, visible: 0}) -} - -func (s *cScreen) ShowCursor(x, y int) { - s.Lock() - if !s.fini { - s.curx = x - s.cury = y - } - s.doCursor() - s.Unlock() -} - -func (s *cScreen) doCursor() { - x, y := s.curx, s.cury - - if x < 0 || y < 0 || x >= s.w || y >= s.h { - s.hideCursor() - } else { - s.setCursorPos(x, y) - s.showCursor() - } -} - -func (s *cScreen) HideCursor() { - s.ShowCursor(-1, -1) -} - -type charInfo struct { - ch uint16 - attr uint16 -} - -type inputRecord struct { - typ uint16 - _ uint16 - data [16]byte -} - -const ( - keyEvent uint16 = 1 - mouseEvent uint16 = 2 - resizeEvent uint16 = 4 - menuEvent uint16 = 8 // don't use - focusEvent uint16 = 16 // don't use -) - -type mouseRecord struct { - x int16 - y int16 - btns uint32 - mod uint32 - flags uint32 -} - -const ( - mouseDoubleClick uint32 = 0x2 - mouseHWheeled uint32 = 0x8 - mouseVWheeled uint32 = 0x4 - mouseMoved uint32 = 0x1 -) - -type resizeRecord struct { - x int16 - y int16 -} - -type keyRecord struct { - isdown int32 - repeat uint16 - kcode uint16 - scode uint16 - ch uint16 - mod uint32 -} - -const ( - // Constants per Microsoft. We don't put the modifiers - // here. - vkCancel = 0x03 - vkBack = 0x08 // Backspace - vkTab = 0x09 - vkClear = 0x0c - vkReturn = 0x0d - vkPause = 0x13 - vkEscape = 0x1b - vkSpace = 0x20 - vkPrior = 0x21 // PgUp - vkNext = 0x22 // PgDn - vkEnd = 0x23 - vkHome = 0x24 - vkLeft = 0x25 - vkUp = 0x26 - vkRight = 0x27 - vkDown = 0x28 - vkPrint = 0x2a - vkPrtScr = 0x2c - vkInsert = 0x2d - vkDelete = 0x2e - vkHelp = 0x2f - vkF1 = 0x70 - vkF2 = 0x71 - vkF3 = 0x72 - vkF4 = 0x73 - vkF5 = 0x74 - vkF6 = 0x75 - vkF7 = 0x76 - vkF8 = 0x77 - vkF9 = 0x78 - vkF10 = 0x79 - vkF11 = 0x7a - vkF12 = 0x7b - vkF13 = 0x7c - vkF14 = 0x7d - vkF15 = 0x7e - vkF16 = 0x7f - vkF17 = 0x80 - vkF18 = 0x81 - vkF19 = 0x82 - vkF20 = 0x83 - vkF21 = 0x84 - vkF22 = 0x85 - vkF23 = 0x86 - vkF24 = 0x87 -) - -var vkKeys = map[uint16]Key{ - vkCancel: KeyCancel, - vkBack: KeyBackspace, - vkTab: KeyTab, - vkClear: KeyClear, - vkPause: KeyPause, - vkPrint: KeyPrint, - vkPrtScr: KeyPrint, - vkPrior: KeyPgUp, - vkNext: KeyPgDn, - vkReturn: KeyEnter, - vkEnd: KeyEnd, - vkHome: KeyHome, - vkLeft: KeyLeft, - vkUp: KeyUp, - vkRight: KeyRight, - vkDown: KeyDown, - vkInsert: KeyInsert, - vkDelete: KeyDelete, - vkHelp: KeyHelp, - vkF1: KeyF1, - vkF2: KeyF2, - vkF3: KeyF3, - vkF4: KeyF4, - vkF5: KeyF5, - vkF6: KeyF6, - vkF7: KeyF7, - vkF8: KeyF8, - vkF9: KeyF9, - vkF10: KeyF10, - vkF11: KeyF11, - vkF12: KeyF12, - vkF13: KeyF13, - vkF14: KeyF14, - vkF15: KeyF15, - vkF16: KeyF16, - vkF17: KeyF17, - vkF18: KeyF18, - vkF19: KeyF19, - vkF20: KeyF20, - vkF21: KeyF21, - vkF22: KeyF22, - vkF23: KeyF23, - vkF24: KeyF24, -} - -// NB: All Windows platforms are little endian. We assume this -// never, ever change. The following code is endian safe. and does -// not use unsafe pointers. -func getu32(v []byte) uint32 { - return uint32(v[0]) + (uint32(v[1]) << 8) + (uint32(v[2]) << 16) + (uint32(v[3]) << 24) -} -func geti32(v []byte) int32 { - return int32(getu32(v)) -} -func getu16(v []byte) uint16 { - return uint16(v[0]) + (uint16(v[1]) << 8) -} -func geti16(v []byte) int16 { - return int16(getu16(v)) -} - -// Convert windows dwControlKeyState to modifier mask -func mod2mask(cks uint32) ModMask { - mm := ModNone - // Left or right control - if (cks & (0x0008 | 0x0004)) != 0 { - mm |= ModCtrl - } - // Left or right alt - if (cks & (0x0002 | 0x0001)) != 0 { - mm |= ModAlt - } - // Any shift - if (cks & 0x0010) != 0 { - mm |= ModShift - } - return mm -} - -func mrec2btns(mbtns, flags uint32) ButtonMask { - btns := ButtonNone - if mbtns&0x1 != 0 { - btns |= Button1 - } - if mbtns&0x2 != 0 { - btns |= Button2 - } - if mbtns&0x4 != 0 { - btns |= Button3 - } - if mbtns&0x8 != 0 { - btns |= Button4 - } - if mbtns&0x10 != 0 { - btns |= Button5 - } - if mbtns&0x20 != 0 { - btns |= Button6 - } - if mbtns&0x40 != 0 { - btns |= Button7 - } - if mbtns&0x80 != 0 { - btns |= Button8 - } - - if flags&mouseVWheeled != 0 { - if mbtns&0x80000000 == 0 { - btns |= WheelUp - } else { - btns |= WheelDown - } - } - if flags&mouseHWheeled != 0 { - if mbtns&0x80000000 == 0 { - btns |= WheelRight - } else { - btns |= WheelLeft - } - } - return btns -} - -func (s *cScreen) getConsoleInput() error { - // cancelFlag comes first as WaitForMultipleObjects returns the lowest index - // in the event that both events are signalled. - waitObjects := []syscall.Handle{s.cancelflag, s.in} - // As arrays are contiguous in memory, a pointer to the first object is the - // same as a pointer to the array itself. - pWaitObjects := unsafe.Pointer(&waitObjects[0]) - - rv, _, er := procWaitForMultipleObjects.Call( - uintptr(len(waitObjects)), - uintptr(pWaitObjects), - uintptr(0), - w32Infinite) - // WaitForMultipleObjects returns WAIT_OBJECT_0 + the index. - switch rv { - case w32WaitObject0: // s.cancelFlag - return errors.New("cancelled") - case w32WaitObject0 + 1: // s.in - rec := &inputRecord{} - var nrec int32 - rv, _, er := procReadConsoleInput.Call( - uintptr(s.in), - uintptr(unsafe.Pointer(rec)), - uintptr(1), - uintptr(unsafe.Pointer(&nrec))) - if rv == 0 { - return er - } - if nrec != 1 { - return nil - } - switch rec.typ { - case keyEvent: - krec := &keyRecord{} - krec.isdown = geti32(rec.data[0:]) - krec.repeat = getu16(rec.data[4:]) - krec.kcode = getu16(rec.data[6:]) - krec.scode = getu16(rec.data[8:]) - krec.ch = getu16(rec.data[10:]) - krec.mod = getu32(rec.data[12:]) - - if krec.isdown == 0 || krec.repeat < 1 { - // its a key release event, ignore it - return nil - } - if krec.ch != 0 { - // synthesized key code - for krec.repeat > 0 { - // convert shift+tab to backtab - if mod2mask(krec.mod) == ModShift && krec.ch == vkTab { - s.PostEvent(NewEventKey(KeyBacktab, 0, - ModNone)) - } else { - s.PostEvent(NewEventKey(KeyRune, rune(krec.ch), - mod2mask(krec.mod))) - } - krec.repeat-- - } - return nil - } - key := KeyNUL // impossible on Windows - ok := false - if key, ok = vkKeys[krec.kcode]; !ok { - return nil - } - for krec.repeat > 0 { - s.PostEvent(NewEventKey(key, rune(krec.ch), - mod2mask(krec.mod))) - krec.repeat-- - } - - case mouseEvent: - var mrec mouseRecord - mrec.x = geti16(rec.data[0:]) - mrec.y = geti16(rec.data[2:]) - mrec.btns = getu32(rec.data[4:]) - mrec.mod = getu32(rec.data[8:]) - mrec.flags = getu32(rec.data[12:]) - btns := mrec2btns(mrec.btns, mrec.flags) - // we ignore double click, events are delivered normally - s.PostEvent(NewEventMouse(int(mrec.x), int(mrec.y), btns, - mod2mask(mrec.mod))) - - case resizeEvent: - var rrec resizeRecord - rrec.x = geti16(rec.data[0:]) - rrec.y = geti16(rec.data[2:]) - s.PostEvent(NewEventResize(int(rrec.x), int(rrec.y))) - - default: - } - default: - return er - } - - return nil -} - -func (s *cScreen) scanInput() { - for { - if e := s.getConsoleInput(); e != nil { - close(s.scandone) - return - } - } -} - -// Windows console can display 8 characters, in either low or high intensity -func (s *cScreen) Colors() int { - return 16 -} - -var vgaColors = map[Color]uint16{ - ColorBlack: 0, - ColorMaroon: 0x4, - ColorGreen: 0x2, - ColorNavy: 0x1, - ColorOlive: 0x6, - ColorPurple: 0x5, - ColorTeal: 0x3, - ColorSilver: 0x7, - ColorGrey: 0x8, - ColorRed: 0xc, - ColorLime: 0xa, - ColorBlue: 0x9, - ColorYellow: 0xe, - ColorFuchsia: 0xd, - ColorAqua: 0xb, - ColorWhite: 0xf, -} - -// Windows uses RGB signals -func mapColor2RGB(c Color) uint16 { - winLock.Lock() - if v, ok := winColors[c]; ok { - c = v - } else { - v = FindColor(c, winPalette) - winColors[c] = v - c = v - } - winLock.Unlock() - - if vc, ok := vgaColors[c]; ok { - return vc - } - return 0 -} - -// Map a tcell style to Windows attributes -func (s *cScreen) mapStyle(style Style) uint16 { - f, b, a := style.Decompose() - fa := s.oscreen.attrs & 0xf - ba := (s.oscreen.attrs) >> 4 & 0xf - if f != ColorDefault { - fa = mapColor2RGB(f) - } - if b != ColorDefault { - ba = mapColor2RGB(b) - } - var attr uint16 - // We simulate reverse by doing the color swap ourselves. - // Apparently windows cannot really do this except in DBCS - // views. - if a&AttrReverse != 0 { - attr = ba - attr |= (fa << 4) - } else { - attr = fa - attr |= (ba << 4) - } - if a&AttrBold != 0 { - attr |= 0x8 - } - if a&AttrDim != 0 { - attr &^= 0x8 - } - if a&AttrUnderline != 0 { - // Best effort -- doesn't seem to work though. - attr |= 0x8000 - } - // Blink is unsupported - return attr -} - -func (s *cScreen) SetCell(x, y int, style Style, ch ...rune) { - if len(ch) > 0 { - s.SetContent(x, y, ch[0], ch[1:], style) - } else { - s.SetContent(x, y, ' ', nil, style) - } -} - -func (s *cScreen) SetContent(x, y int, mainc rune, combc []rune, style Style) { - s.Lock() - if !s.fini { - s.cells.SetContent(x, y, mainc, combc, style) - } - s.Unlock() -} - -func (s *cScreen) GetContent(x, y int) (rune, []rune, Style, int) { - s.Lock() - mainc, combc, style, width := s.cells.GetContent(x, y) - s.Unlock() - return mainc, combc, style, width -} - -func (s *cScreen) writeString(x, y int, style Style, ch []uint16) { - // we assume the caller has hidden the cursor - if len(ch) == 0 { - return - } - nw := uint32(len(ch)) - procSetConsoleTextAttribute.Call( - uintptr(s.out), - uintptr(s.mapStyle(style))) - s.setCursorPos(x, y) - syscall.WriteConsole(s.out, &ch[0], nw, &nw, nil) -} - -func (s *cScreen) draw() { - // allocate a scratch line bit enough for no combining chars. - // if you have combining characters, you may pay for extra allocs. - if s.clear { - s.clearScreen(s.style) - s.clear = false - s.cells.Invalidate() - } - buf := make([]uint16, 0, s.w) - wcs := buf[:] - lstyle := Style(-1) // invalid attribute - - lx, ly := -1, -1 - ra := make([]rune, 1) - - for y := 0; y < int(s.h); y++ { - for x := 0; x < int(s.w); x++ { - mainc, combc, style, width := s.cells.GetContent(x, y) - dirty := s.cells.Dirty(x, y) - if style == StyleDefault { - style = s.style - } - - if !dirty || style != lstyle { - // write out any data queued thus far - // because we are going to skip over some - // cells, or because we need to change styles - s.writeString(lx, ly, lstyle, wcs) - wcs = buf[0:0] - lstyle = Style(-1) - if !dirty { - continue - } - } - if x > s.w-width { - mainc = ' ' - combc = nil - width = 1 - } - if len(wcs) == 0 { - lstyle = style - lx = x - ly = y - } - ra[0] = mainc - wcs = append(wcs, utf16.Encode(ra)...) - if len(combc) != 0 { - wcs = append(wcs, utf16.Encode(combc)...) - } - for dx := 0; dx < width; dx++ { - s.cells.SetDirty(x+dx, y, false) - } - x += width - 1 - } - s.writeString(lx, ly, lstyle, wcs) - wcs = buf[0:0] - lstyle = Style(-1) - } -} - -func (s *cScreen) Show() { - s.Lock() - if !s.fini { - s.hideCursor() - s.resize() - s.draw() - s.doCursor() - } - s.Unlock() -} - -func (s *cScreen) Sync() { - s.Lock() - if !s.fini { - s.cells.Invalidate() - s.hideCursor() - s.resize() - s.draw() - s.doCursor() - } - s.Unlock() -} - -type consoleInfo struct { - size coord - pos coord - attrs uint16 - win rect - maxsz coord -} - -func (s *cScreen) getConsoleInfo(info *consoleInfo) { - procGetConsoleScreenBufferInfo.Call( - uintptr(s.out), - uintptr(unsafe.Pointer(info))) -} - -func (s *cScreen) getCursorInfo(info *cursorInfo) { - procGetConsoleCursorInfo.Call( - uintptr(s.out), - uintptr(unsafe.Pointer(info))) -} - -func (s *cScreen) setCursorInfo(info *cursorInfo) { - procSetConsoleCursorInfo.Call( - uintptr(s.out), - uintptr(unsafe.Pointer(info))) -} - -func (s *cScreen) setCursorPos(x, y int) { - procSetConsoleCursorPosition.Call( - uintptr(s.out), - coord{int16(x), int16(y)}.uintptr()) -} - -func (s *cScreen) setBufferSize(x, y int) { - procSetConsoleScreenBufferSize.Call( - uintptr(s.out), - coord{int16(x), int16(y)}.uintptr()) -} - -func (s *cScreen) Size() (int, int) { - s.Lock() - w, h := s.w, s.h - s.Unlock() - - return w, h -} - -func (s *cScreen) resize() { - info := consoleInfo{} - s.getConsoleInfo(&info) - - w := int((info.win.right - info.win.left) + 1) - h := int((info.win.bottom - info.win.top) + 1) - - if s.w == w && s.h == h { - return - } - - s.cells.Resize(w, h) - s.w = w - s.h = h - - s.setBufferSize(w, h) - - r := rect{0, 0, int16(w - 1), int16(h - 1)} - procSetConsoleWindowInfo.Call( - uintptr(s.out), - uintptr(1), - uintptr(unsafe.Pointer(&r))) - - s.PostEvent(NewEventResize(w, h)) -} - -func (s *cScreen) Clear() { - s.Fill(' ', s.style) -} - -func (s *cScreen) Fill(r rune, style Style) { - s.Lock() - if !s.fini { - s.cells.Fill(r, style) - s.clear = true - } - s.Unlock() -} - -func (s *cScreen) clearScreen(style Style) { - pos := coord{0, 0} - attr := s.mapStyle(style) - x, y := s.w, s.h - scratch := uint32(0) - count := uint32(x * y) - - procFillConsoleOutputAttribute.Call( - uintptr(s.out), - uintptr(attr), - uintptr(count), - pos.uintptr(), - uintptr(unsafe.Pointer(&scratch))) - procFillConsoleOutputCharacter.Call( - uintptr(s.out), - uintptr(' '), - uintptr(count), - pos.uintptr(), - uintptr(unsafe.Pointer(&scratch))) -} - -const ( - modeExtndFlg uint32 = 0x0080 - modeMouseEn uint32 = 0x0010 - modeResizeEn uint32 = 0x0008 - modeWrapEOL uint32 = 0x0002 - modeCooked uint32 = 0x0001 -) - -func (s *cScreen) setInMode(mode uint32) error { - rv, _, err := procSetConsoleMode.Call( - uintptr(s.in), - uintptr(mode)) - if rv == 0 { - return err - } - return nil -} - -func (s *cScreen) setOutMode(mode uint32) error { - rv, _, err := procSetConsoleMode.Call( - uintptr(s.out), - uintptr(mode)) - if rv == 0 { - return err - } - return nil -} - -func (s *cScreen) getInMode(v *uint32) { - procGetConsoleMode.Call( - uintptr(s.in), - uintptr(unsafe.Pointer(v))) -} - -func (s *cScreen) getOutMode(v *uint32) { - procGetConsoleMode.Call( - uintptr(s.out), - uintptr(unsafe.Pointer(v))) -} - -func (s *cScreen) SetStyle(style Style) { - s.Lock() - s.style = style - s.Unlock() -} - -// No fallback rune support, since we have Unicode. Yay! - -func (s *cScreen) RegisterRuneFallback(r rune, subst string) { -} - -func (s *cScreen) UnregisterRuneFallback(r rune) { -} - -func (s *cScreen) CanDisplay(r rune, checkFallbacks bool) bool { - // We presume we can display anything -- we're Unicode. - // (Sadly this not precisely true. Combinings are especially - // poorly supported under Windows.) - return true -} - -func (s *cScreen) HasMouse() bool { - return true -} - -func (s *cScreen) Resize(int, int, int, int) {} - -func (s *cScreen) HasKey(k Key) bool { - // Microsoft has codes for some keys, but they are unusual, - // so we don't include them. We include all the typical - // 101, 105 key layout keys. - valid := map[Key]bool{ - KeyBackspace: true, - KeyTab: true, - KeyEscape: true, - KeyPause: true, - KeyPrint: true, - KeyPgUp: true, - KeyPgDn: true, - KeyEnter: true, - KeyEnd: true, - KeyHome: true, - KeyLeft: true, - KeyUp: true, - KeyRight: true, - KeyDown: true, - KeyInsert: true, - KeyDelete: true, - KeyF1: true, - KeyF2: true, - KeyF3: true, - KeyF4: true, - KeyF5: true, - KeyF6: true, - KeyF7: true, - KeyF8: true, - KeyF9: true, - KeyF10: true, - KeyF11: true, - KeyF12: true, - KeyRune: true, - } - - return valid[k] -} diff --git a/vendor/github.com/gdamore/tcell/doc.go b/vendor/github.com/gdamore/tcell/doc.go deleted file mode 100644 index b6719613..00000000 --- a/vendor/github.com/gdamore/tcell/doc.go +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2018 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package tcell provides a lower-level, portable API for building -// programs that interact with terminals or consoles. It works with -// both common (and many uncommon!) terminals or terminal emulators, -// and Windows console implementations. -// -// It provides support for up to 256 colors, text attributes, and box drawing -// elements. A database of terminals built from a real terminfo database -// is provided, along with code to generate new database entries. -// -// Tcell offers very rich support for mice, dependent upon the terminal -// of course. (Windows, XTerm, and iTerm 2 are known to work very well.) -// -// If the environment is not Unicode by default, such as an ISO8859 based -// locale or GB18030, Tcell can convert input and output, so that your -// terminal can operate in whatever locale is most convenient, while the -// application program can just assume "everything is UTF-8". Reasonable -// defaults are used for updating characters to something suitable for -// display. Unicode box drawing characters will be converted to use the -// alternate character set of your terminal, if native conversions are -// not available. If no ACS is available, then some ASCII fallbacks will -// be used. -// -// Note that support for non-UTF-8 locales (other than C) must be enabled -// by the application using RegisterEncoding() -- we don't have them all -// enabled by default to avoid bloating the application unneccessarily. -// (These days UTF-8 is good enough for almost everyone, and nobody should -// be using legacy locales anymore.) Also, actual glyphs for various code -// point will only be displayed if your terminal or emulator (or the font -// the emulator is using) supports them. -// -// A rich set of keycodes is supported, with support for up to 65 function -// keys, and various other special keys. -// -package tcell diff --git a/vendor/github.com/gdamore/tcell/encoding.go b/vendor/github.com/gdamore/tcell/encoding.go deleted file mode 100644 index 596a6e80..00000000 --- a/vendor/github.com/gdamore/tcell/encoding.go +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright 2015 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tcell - -import ( - "strings" - "sync" - - "golang.org/x/text/encoding" - - gencoding "github.com/gdamore/encoding" -) - -var encodings map[string]encoding.Encoding -var encodingLk sync.Mutex -var encodingFallback EncodingFallback = EncodingFallbackFail - -// RegisterEncoding may be called by the application to register an encoding. -// The presence of additional encodings will facilitate application usage with -// terminal environments where the I/O subsystem does not support Unicode. -// -// Windows systems use Unicode natively, and do not need any of the encoding -// subsystem when using Windows Console screens. -// -// Please see the Go documentation for golang.org/x/text/encoding -- most of -// the common ones exist already as stock variables. For example, ISO8859-15 -// can be registered using the following code: -// -// import "golang.org/x/text/encoding/charmap" -// -// ... -// RegisterEncoding("ISO8859-15", charmap.ISO8859_15) -// -// Aliases can be registered as well, for example "8859-15" could be an alias -// for "ISO8859-15". -// -// For POSIX systems, the tcell package will check the environment variables -// LC_ALL, LC_CTYPE, and LANG (in that order) to determine the character set. -// These are expected to have the following pattern: -// -// $language[.$codeset[@$variant] -// -// We extract only the $codeset part, which will usually be something like -// UTF-8 or ISO8859-15 or KOI8-R. Note that if the locale is either "POSIX" -// or "C", then we assume US-ASCII (the POSIX 'portable character set' -// and assume all other characters are somehow invalid.) -// -// Modern POSIX systems and terminal emulators may use UTF-8, and for those -// systems, this API is also unnecessary. For example, Darwin (MacOS X) and -// modern Linux running modern xterm generally will out of the box without -// any of this. Use of UTF-8 is recommended when possible, as it saves -// quite a lot processing overhead. -// -// Note that some encodings are quite large (for example GB18030 which is a -// superset of Unicode) and so the application size can be expected ot -// increase quite a bit as each encoding is added. The East Asian encodings -// have been seen to add 100-200K per encoding to the application size. -// -func RegisterEncoding(charset string, enc encoding.Encoding) { - encodingLk.Lock() - charset = strings.ToLower(charset) - encodings[charset] = enc - encodingLk.Unlock() -} - -// EncodingFallback describes how the system behavees when the locale -// requires a character set that we do not support. The system always -// supports UTF-8 and US-ASCII. On Windows consoles, UTF-16LE is also -// supported automatically. Other character sets must be added using the -// RegisterEncoding API. (A large group of nearly all of them can be -// added using the RegisterAll function in the encoding sub package.) -type EncodingFallback int - -const ( - // EncodingFallbackFail behavior causes GetEncoding to fail - // when it cannot find an encoding. - EncodingFallbackFail = iota - - // EncodingFallbackASCII behaviore causes GetEncoding to fall back - // to a 7-bit ASCII encoding, if no other encoding can be found. - EncodingFallbackASCII - - // EncodingFallbackUTF8 behavior causes GetEncoding to assume - // UTF8 can pass unmodified upon failure. Note that this behavior - // is not recommended, unless you are sure your terminal can cope - // with real UTF8 sequences. - EncodingFallbackUTF8 -) - -// SetEncodingFallback changes the behavior of GetEncoding when a suitable -// encoding is not found. The default is EncodingFallbackFail, which -// causes GetEncoding to simply return nil. -func SetEncodingFallback(fb EncodingFallback) { - encodingLk.Lock() - encodingFallback = fb - encodingLk.Unlock() -} - -// GetEncoding is used by Screen implementors who want to locate an encoding -// for the given character set name. Note that this will return nil for -// either the Unicode (UTF-8) or ASCII encodings, since we don't use -// encodings for them but instead have our own native methods. -func GetEncoding(charset string) encoding.Encoding { - charset = strings.ToLower(charset) - encodingLk.Lock() - defer encodingLk.Unlock() - if enc, ok := encodings[charset]; ok { - return enc - } - switch encodingFallback { - case EncodingFallbackASCII: - return gencoding.ASCII - case EncodingFallbackUTF8: - return encoding.Nop - } - return nil -} - -func init() { - // We always support UTF-8 and ASCII. - encodings = make(map[string]encoding.Encoding) - encodings["utf-8"] = gencoding.UTF8 - encodings["utf8"] = gencoding.UTF8 - encodings["us-ascii"] = gencoding.ASCII - encodings["ascii"] = gencoding.ASCII - encodings["iso646"] = gencoding.ASCII -} diff --git a/vendor/github.com/gdamore/tcell/errors.go b/vendor/github.com/gdamore/tcell/errors.go deleted file mode 100644 index 920b64b2..00000000 --- a/vendor/github.com/gdamore/tcell/errors.go +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2015 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tcell - -import ( - "errors" - "time" - - "github.com/gdamore/tcell/terminfo" -) - -var ( - // ErrTermNotFound indicates that a suitable terminal entry could - // not be found. This can result from either not having TERM set, - // or from the TERM failing to support certain minimal functionality, - // in particular absolute cursor addressability (the cup capability) - // is required. For example, legacy "adm3" lacks this capability, - // whereas the slightly newer "adm3a" supports it. This failure - // occurs most often with "dumb". - ErrTermNotFound = terminfo.ErrTermNotFound - - // ErrNoScreen indicates that no suitable screen could be found. - // This may result from attempting to run on a platform where there - // is no support for either termios or console I/O (such as nacl), - // or from running in an environment where there is no access to - // a suitable console/terminal device. (For example, running on - // without a controlling TTY or with no /dev/tty on POSIX platforms.) - ErrNoScreen = errors.New("no suitable screen available") - - // ErrNoCharset indicates that the locale environment the - // program is not supported by the program, because no suitable - // encoding was found for it. This problem never occurs if - // the environment is UTF-8 or UTF-16. - ErrNoCharset = errors.New("character set not supported") - - // ErrEventQFull indicates that the event queue is full, and - // cannot accept more events. - ErrEventQFull = errors.New("event queue full") -) - -// An EventError is an event representing some sort of error, and carries -// an error payload. -type EventError struct { - t time.Time - err error -} - -// When returns the time when the event was created. -func (ev *EventError) When() time.Time { - return ev.t -} - -// Error implements the error. -func (ev *EventError) Error() string { - return ev.err.Error() -} - -// NewEventError creates an ErrorEvent with the given error payload. -func NewEventError(err error) *EventError { - return &EventError{t: time.Now(), err: err} -} diff --git a/vendor/github.com/gdamore/tcell/event.go b/vendor/github.com/gdamore/tcell/event.go deleted file mode 100644 index a3b77006..00000000 --- a/vendor/github.com/gdamore/tcell/event.go +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2015 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tcell - -import ( - "time" -) - -// Event is a generic interface used for passing around Events. -// Concrete types follow. -type Event interface { - // When reports the time when the event was generated. - When() time.Time -} - -// EventTime is a simple base event class, suitable for easy reuse. -// It can be used to deliver actual timer events as well. -type EventTime struct { - when time.Time -} - -// When returns the time stamp when the event occurred. -func (e *EventTime) When() time.Time { - return e.when -} - -// SetEventTime sets the time of occurrence for the event. -func (e *EventTime) SetEventTime(t time.Time) { - e.when = t -} - -// SetEventNow sets the time of occurrence for the event to the current time. -func (e *EventTime) SetEventNow() { - e.SetEventTime(time.Now()) -} - -// EventHandler is anything that handles events. If the handler has -// consumed the event, it should return true. False otherwise. -type EventHandler interface { - HandleEvent(Event) bool -} diff --git a/vendor/github.com/gdamore/tcell/interrupt.go b/vendor/github.com/gdamore/tcell/interrupt.go deleted file mode 100644 index 70dddfce..00000000 --- a/vendor/github.com/gdamore/tcell/interrupt.go +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2015 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tcell - -import ( - "time" -) - -// EventInterrupt is a generic wakeup event. Its can be used to -// to request a redraw. It can carry an arbitrary payload, as well. -type EventInterrupt struct { - t time.Time - v interface{} -} - -// When returns the time when this event was created. -func (ev *EventInterrupt) When() time.Time { - return ev.t -} - -// Data is used to obtain the opaque event payload. -func (ev *EventInterrupt) Data() interface{} { - return ev.v -} - -// NewEventInterrupt creates an EventInterrupt with the given payload. -func NewEventInterrupt(data interface{}) *EventInterrupt { - return &EventInterrupt{t: time.Now(), v: data} -} diff --git a/vendor/github.com/gdamore/tcell/key.go b/vendor/github.com/gdamore/tcell/key.go deleted file mode 100644 index 3545215a..00000000 --- a/vendor/github.com/gdamore/tcell/key.go +++ /dev/null @@ -1,464 +0,0 @@ -// Copyright 2016 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tcell - -import ( - "fmt" - "strings" - "time" -) - -// EventKey represents a key press. Usually this is a key press followed -// by a key release, but since terminal programs don't have a way to report -// key release events, we usually get just one event. If a key is held down -// then the terminal may synthesize repeated key presses at some predefined -// rate. We have no control over that, nor visibility into it. -// -// In some cases, we can have a modifier key, such as ModAlt, that can be -// generated with a key press. (This usually is represented by having the -// high bit set, or in some cases, by sending an ESC prior to the rune.) -// -// If the value of Key() is KeyRune, then the actual key value will be -// available with the Rune() method. This will be the case for most keys. -// In most situations, the modifiers will not be set. For example, if the -// rune is 'A', this will be reported without the ModShift bit set, since -// really can't tell if the Shift key was pressed (it might have been CAPSLOCK, -// or a terminal that only can send capitals, or keyboard with separate -// capital letters from lower case letters). -// -// Generally, terminal applications have far less visibility into keyboard -// activity than graphical applications. Hence, they should avoid depending -// overly much on availability of modifiers, or the availability of any -// specific keys. -type EventKey struct { - t time.Time - mod ModMask - key Key - ch rune -} - -// When returns the time when this Event was created, which should closely -// match the time when the key was pressed. -func (ev *EventKey) When() time.Time { - return ev.t -} - -// Rune returns the rune corresponding to the key press, if it makes sense. -// The result is only defined if the value of Key() is KeyRune. -func (ev *EventKey) Rune() rune { - return ev.ch -} - -// Key returns a virtual key code. We use this to identify specific key -// codes, such as KeyEnter, etc. Most control and function keys are reported -// with unique Key values. Normal alphanumeric and punctuation keys will -// generally return KeyRune here; the specific key can be further decoded -// using the Rune() function. -func (ev *EventKey) Key() Key { - return ev.key -} - -// Modifiers returns the modifiers that were present with the key press. Note -// that not all platforms and terminals support this equally well, and some -// cases we will not not know for sure. Hence, applications should avoid -// using this in most circumstances. -func (ev *EventKey) Modifiers() ModMask { - return ev.mod -} - -// KeyNames holds the written names of special keys. Useful to echo back a key -// name, or to look up a key from a string value. -var KeyNames = map[Key]string{ - KeyEnter: "Enter", - KeyBackspace: "Backspace", - KeyTab: "Tab", - KeyBacktab: "Backtab", - KeyEsc: "Esc", - KeyBackspace2: "Backspace2", - KeyDelete: "Delete", - KeyInsert: "Insert", - KeyUp: "Up", - KeyDown: "Down", - KeyLeft: "Left", - KeyRight: "Right", - KeyHome: "Home", - KeyEnd: "End", - KeyUpLeft: "UpLeft", - KeyUpRight: "UpRight", - KeyDownLeft: "DownLeft", - KeyDownRight: "DownRight", - KeyCenter: "Center", - KeyPgDn: "PgDn", - KeyPgUp: "PgUp", - KeyClear: "Clear", - KeyExit: "Exit", - KeyCancel: "Cancel", - KeyPause: "Pause", - KeyPrint: "Print", - KeyF1: "F1", - KeyF2: "F2", - KeyF3: "F3", - KeyF4: "F4", - KeyF5: "F5", - KeyF6: "F6", - KeyF7: "F7", - KeyF8: "F8", - KeyF9: "F9", - KeyF10: "F10", - KeyF11: "F11", - KeyF12: "F12", - KeyF13: "F13", - KeyF14: "F14", - KeyF15: "F15", - KeyF16: "F16", - KeyF17: "F17", - KeyF18: "F18", - KeyF19: "F19", - KeyF20: "F20", - KeyF21: "F21", - KeyF22: "F22", - KeyF23: "F23", - KeyF24: "F24", - KeyF25: "F25", - KeyF26: "F26", - KeyF27: "F27", - KeyF28: "F28", - KeyF29: "F29", - KeyF30: "F30", - KeyF31: "F31", - KeyF32: "F32", - KeyF33: "F33", - KeyF34: "F34", - KeyF35: "F35", - KeyF36: "F36", - KeyF37: "F37", - KeyF38: "F38", - KeyF39: "F39", - KeyF40: "F40", - KeyF41: "F41", - KeyF42: "F42", - KeyF43: "F43", - KeyF44: "F44", - KeyF45: "F45", - KeyF46: "F46", - KeyF47: "F47", - KeyF48: "F48", - KeyF49: "F49", - KeyF50: "F50", - KeyF51: "F51", - KeyF52: "F52", - KeyF53: "F53", - KeyF54: "F54", - KeyF55: "F55", - KeyF56: "F56", - KeyF57: "F57", - KeyF58: "F58", - KeyF59: "F59", - KeyF60: "F60", - KeyF61: "F61", - KeyF62: "F62", - KeyF63: "F63", - KeyF64: "F64", - KeyCtrlA: "Ctrl-A", - KeyCtrlB: "Ctrl-B", - KeyCtrlC: "Ctrl-C", - KeyCtrlD: "Ctrl-D", - KeyCtrlE: "Ctrl-E", - KeyCtrlF: "Ctrl-F", - KeyCtrlG: "Ctrl-G", - KeyCtrlJ: "Ctrl-J", - KeyCtrlK: "Ctrl-K", - KeyCtrlL: "Ctrl-L", - KeyCtrlN: "Ctrl-N", - KeyCtrlO: "Ctrl-O", - KeyCtrlP: "Ctrl-P", - KeyCtrlQ: "Ctrl-Q", - KeyCtrlR: "Ctrl-R", - KeyCtrlS: "Ctrl-S", - KeyCtrlT: "Ctrl-T", - KeyCtrlU: "Ctrl-U", - KeyCtrlV: "Ctrl-V", - KeyCtrlW: "Ctrl-W", - KeyCtrlX: "Ctrl-X", - KeyCtrlY: "Ctrl-Y", - KeyCtrlZ: "Ctrl-Z", - KeyCtrlSpace: "Ctrl-Space", - KeyCtrlUnderscore: "Ctrl-_", - KeyCtrlRightSq: "Ctrl-]", - KeyCtrlBackslash: "Ctrl-\\", - KeyCtrlCarat: "Ctrl-^", -} - -// Name returns a printable value or the key stroke. This can be used -// when printing the event, for example. -func (ev *EventKey) Name() string { - s := "" - m := []string{} - if ev.mod&ModShift != 0 { - m = append(m, "Shift") - } - if ev.mod&ModAlt != 0 { - m = append(m, "Alt") - } - if ev.mod&ModMeta != 0 { - m = append(m, "Meta") - } - if ev.mod&ModCtrl != 0 { - m = append(m, "Ctrl") - } - - ok := false - if s, ok = KeyNames[ev.key]; !ok { - if ev.key == KeyRune { - s = "Rune[" + string(ev.ch) + "]" - } else { - s = fmt.Sprintf("Key[%d,%d]", ev.key, int(ev.ch)) - } - } - if len(m) != 0 { - if ev.mod&ModCtrl != 0 && strings.HasPrefix(s, "Ctrl-") { - s = s[5:] - } - return fmt.Sprintf("%s+%s", strings.Join(m, "+"), s) - } - return s -} - -// NewEventKey attempts to create a suitable event. It parses the various -// ASCII control sequences if KeyRune is passed for Key, but if the caller -// has more precise information it should set that specifically. Callers -// that aren't sure about modifier state (most) should just pass ModNone. -func NewEventKey(k Key, ch rune, mod ModMask) *EventKey { - if k == KeyRune && (ch < ' ' || ch == 0x7f) { - // Turn specials into proper key codes. This is for - // control characters and the DEL. - k = Key(ch) - if mod == ModNone && ch < ' ' { - switch Key(ch) { - case KeyBackspace, KeyTab, KeyEsc, KeyEnter: - // these keys are directly typeable without CTRL - default: - // most likely entered with a CTRL keypress - mod = ModCtrl - } - } - } - return &EventKey{t: time.Now(), key: k, ch: ch, mod: mod} -} - -// ModMask is a mask of modifier keys. Note that it will not always be -// possible to report modifier keys. -type ModMask int16 - -// These are the modifiers keys that can be sent either with a key press, -// or a mouse event. Note that as of now, due to the confusion associated -// with Meta, and the lack of support for it on many/most platforms, the -// current implementations never use it. Instead, they use ModAlt, even for -// events that could possibly have been distinguished from ModAlt. -const ( - ModShift ModMask = 1 << iota - ModCtrl - ModAlt - ModMeta - ModNone ModMask = 0 -) - -// Key is a generic value for representing keys, and especially special -// keys (function keys, cursor movement keys, etc.) For normal keys, like -// ASCII letters, we use KeyRune, and then expect the application to -// inspect the Rune() member of the EventKey. -type Key int16 - -// This is the list of named keys. KeyRune is special however, in that it is -// a place holder key indicating that a printable character was sent. The -// actual value of the rune will be transported in the Rune of the associated -// EventKey. -const ( - KeyRune Key = iota + 256 - KeyUp - KeyDown - KeyRight - KeyLeft - KeyUpLeft - KeyUpRight - KeyDownLeft - KeyDownRight - KeyCenter - KeyPgUp - KeyPgDn - KeyHome - KeyEnd - KeyInsert - KeyDelete - KeyHelp - KeyExit - KeyClear - KeyCancel - KeyPrint - KeyPause - KeyBacktab - KeyF1 - KeyF2 - KeyF3 - KeyF4 - KeyF5 - KeyF6 - KeyF7 - KeyF8 - KeyF9 - KeyF10 - KeyF11 - KeyF12 - KeyF13 - KeyF14 - KeyF15 - KeyF16 - KeyF17 - KeyF18 - KeyF19 - KeyF20 - KeyF21 - KeyF22 - KeyF23 - KeyF24 - KeyF25 - KeyF26 - KeyF27 - KeyF28 - KeyF29 - KeyF30 - KeyF31 - KeyF32 - KeyF33 - KeyF34 - KeyF35 - KeyF36 - KeyF37 - KeyF38 - KeyF39 - KeyF40 - KeyF41 - KeyF42 - KeyF43 - KeyF44 - KeyF45 - KeyF46 - KeyF47 - KeyF48 - KeyF49 - KeyF50 - KeyF51 - KeyF52 - KeyF53 - KeyF54 - KeyF55 - KeyF56 - KeyF57 - KeyF58 - KeyF59 - KeyF60 - KeyF61 - KeyF62 - KeyF63 - KeyF64 -) - -// These are the control keys. Note that they overlap with other keys, -// perhaps. For example, KeyCtrlH is the same as KeyBackspace. -const ( - KeyCtrlSpace Key = iota - KeyCtrlA - KeyCtrlB - KeyCtrlC - KeyCtrlD - KeyCtrlE - KeyCtrlF - KeyCtrlG - KeyCtrlH - KeyCtrlI - KeyCtrlJ - KeyCtrlK - KeyCtrlL - KeyCtrlM - KeyCtrlN - KeyCtrlO - KeyCtrlP - KeyCtrlQ - KeyCtrlR - KeyCtrlS - KeyCtrlT - KeyCtrlU - KeyCtrlV - KeyCtrlW - KeyCtrlX - KeyCtrlY - KeyCtrlZ - KeyCtrlLeftSq // Escape - KeyCtrlBackslash - KeyCtrlRightSq - KeyCtrlCarat - KeyCtrlUnderscore -) - -// Special values - these are fixed in an attempt to make it more likely -// that aliases will encode the same way. - -// These are the defined ASCII values for key codes. They generally match -// with KeyCtrl values. -const ( - KeyNUL Key = iota - KeySOH - KeySTX - KeyETX - KeyEOT - KeyENQ - KeyACK - KeyBEL - KeyBS - KeyTAB - KeyLF - KeyVT - KeyFF - KeyCR - KeySO - KeySI - KeyDLE - KeyDC1 - KeyDC2 - KeyDC3 - KeyDC4 - KeyNAK - KeySYN - KeyETB - KeyCAN - KeyEM - KeySUB - KeyESC - KeyFS - KeyGS - KeyRS - KeyUS - KeyDEL Key = 0x7F -) - -// These keys are aliases for other names. -const ( - KeyBackspace = KeyBS - KeyTab = KeyTAB - KeyEsc = KeyESC - KeyEscape = KeyESC - KeyEnter = KeyCR - KeyBackspace2 = KeyDEL -) diff --git a/vendor/github.com/gdamore/tcell/mouse.go b/vendor/github.com/gdamore/tcell/mouse.go deleted file mode 100644 index 8c51c98e..00000000 --- a/vendor/github.com/gdamore/tcell/mouse.go +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright 2015 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tcell - -import ( - "time" -) - -// EventMouse is a mouse event. It is sent on either mouse up or mouse down -// events. It is also sent on mouse motion events - if the terminal supports -// it. We make every effort to ensure that mouse release events are delivered. -// Hence, click drag can be identified by a motion event with the mouse down, -// without any intervening button release. On some terminals only the initiating -// press and terminating release event will be delivered. -// -// Mouse wheel events, when reported, may appear on their own as individual -// impulses; that is, there will normally not be a release event delivered -// for mouse wheel movements. -// -// Most terminals cannot report the state of more than one button at a time -- -// and some cannot report motion events unless a button is pressed. -// -// Applications can inspect the time between events to resolve double or -// triple clicks. -type EventMouse struct { - t time.Time - btn ButtonMask - mod ModMask - x int - y int -} - -// When returns the time when this EventMouse was created. -func (ev *EventMouse) When() time.Time { - return ev.t -} - -// Buttons returns the list of buttons that were pressed or wheel motions. -func (ev *EventMouse) Buttons() ButtonMask { - return ev.btn -} - -// Modifiers returns a list of keyboard modifiers that were pressed -// with the mouse button(s). -func (ev *EventMouse) Modifiers() ModMask { - return ev.mod -} - -// Position returns the mouse position in character cells. The origin -// 0, 0 is at the upper left corner. -func (ev *EventMouse) Position() (int, int) { - return ev.x, ev.y -} - -// NewEventMouse is used to create a new mouse event. Applications -// shouldn't need to use this; its mostly for screen implementors. -func NewEventMouse(x, y int, btn ButtonMask, mod ModMask) *EventMouse { - return &EventMouse{t: time.Now(), x: x, y: y, btn: btn, mod: mod} -} - -// ButtonMask is a mask of mouse buttons and wheel events. Mouse button presses -// are normally delivered as both press and release events. Mouse wheel events -// are normally just single impulse events. Windows supports up to eight -// separate buttons plus all four wheel directions, but XTerm can only support -// mouse buttons 1-3 and wheel up/down. Its not unheard of for terminals -// to support only one or two buttons (think Macs). Old terminals, and true -// emulations (such as vt100) won't support mice at all, of course. -type ButtonMask int16 - -// These are the actual button values. -const ( - Button1 ButtonMask = 1 << iota // Usually left mouse button. - Button2 // Usually the middle mouse button. - Button3 // Usually the right mouse button. - Button4 // Often a side button (thumb/next). - Button5 // Often a side button (thumb/prev). - Button6 - Button7 - Button8 - WheelUp // Wheel motion up/away from user. - WheelDown // Wheel motion down/towards user. - WheelLeft // Wheel motion to left. - WheelRight // Wheel motion to right. - ButtonNone ButtonMask = 0 // No button or wheel events. -) diff --git a/vendor/github.com/gdamore/tcell/resize.go b/vendor/github.com/gdamore/tcell/resize.go deleted file mode 100644 index 0385673c..00000000 --- a/vendor/github.com/gdamore/tcell/resize.go +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2015 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tcell - -import ( - "time" -) - -// EventResize is sent when the window size changes. -type EventResize struct { - t time.Time - w int - h int -} - -// NewEventResize creates an EventResize with the new updated window size, -// which is given in character cells. -func NewEventResize(width, height int) *EventResize { - return &EventResize{t: time.Now(), w: width, h: height} -} - -// When returns the time when the Event was created. -func (ev *EventResize) When() time.Time { - return ev.t -} - -// Size returns the new window size as width, height in character cells. -func (ev *EventResize) Size() (int, int) { - return ev.w, ev.h -} diff --git a/vendor/github.com/gdamore/tcell/runes.go b/vendor/github.com/gdamore/tcell/runes.go deleted file mode 100644 index ed9c63b5..00000000 --- a/vendor/github.com/gdamore/tcell/runes.go +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright 2015 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tcell - -// The names of these constants are chosen to match Terminfo names, -// modulo case, and changing the prefix from ACS_ to Rune. These are -// the runes we provide extra special handling for, with ASCII fallbacks -// for terminals that lack them. -const ( - RuneSterling = '£' - RuneDArrow = '↓' - RuneLArrow = '←' - RuneRArrow = '→' - RuneUArrow = '↑' - RuneBullet = '·' - RuneBoard = '░' - RuneCkBoard = '▒' - RuneDegree = '°' - RuneDiamond = '◆' - RuneGEqual = '≥' - RunePi = 'π' - RuneHLine = '─' - RuneLantern = '§' - RunePlus = '┼' - RuneLEqual = '≤' - RuneLLCorner = '└' - RuneLRCorner = '┘' - RuneNEqual = '≠' - RunePlMinus = '±' - RuneS1 = '⎺' - RuneS3 = '⎻' - RuneS7 = '⎼' - RuneS9 = '⎽' - RuneBlock = '█' - RuneTTee = '┬' - RuneRTee = '┤' - RuneLTee = '├' - RuneBTee = '┴' - RuneULCorner = '┌' - RuneURCorner = '┐' - RuneVLine = '│' -) - -// RuneFallbacks is the default map of fallback strings that will be -// used to replace a rune when no other more appropriate transformation -// is available, and the rune cannot be displayed directly. -// -// New entries may be added to this map over time, as it becomes clear -// that such is desirable. Characters that represent either letters or -// numbers should not be added to this list unless it is certain that -// the meaning will still convey unambiguously. -// -// As an example, it would be appropriate to add an ASCII mapping for -// the full width form of the letter 'A', but it would not be appropriate -// to do so a glyph representing the country China. -// -// Programs that desire richer fallbacks may register additional ones, -// or change or even remove these mappings with Screen.RegisterRuneFallback -// Screen.UnregisterRuneFallback methods. -// -// Note that Unicode is presumed to be able to display all glyphs. -// This is a pretty poor assumption, but there is no easy way to -// figure out which glyphs are supported in a given font. Hence, -// some care in selecting the characters you support in your application -// is still appropriate. -var RuneFallbacks = map[rune]string{ - RuneSterling: "f", - RuneDArrow: "v", - RuneLArrow: "<", - RuneRArrow: ">", - RuneUArrow: "^", - RuneBullet: "o", - RuneBoard: "#", - RuneCkBoard: ":", - RuneDegree: "\\", - RuneDiamond: "+", - RuneGEqual: ">", - RunePi: "*", - RuneHLine: "-", - RuneLantern: "#", - RunePlus: "+", - RuneLEqual: "<", - RuneLLCorner: "+", - RuneLRCorner: "+", - RuneNEqual: "!", - RunePlMinus: "#", - RuneS1: "~", - RuneS3: "-", - RuneS7: "-", - RuneS9: "_", - RuneBlock: "#", - RuneTTee: "+", - RuneRTee: "+", - RuneLTee: "+", - RuneBTee: "+", - RuneULCorner: "+", - RuneURCorner: "+", - RuneVLine: "|", -} diff --git a/vendor/github.com/gdamore/tcell/screen.go b/vendor/github.com/gdamore/tcell/screen.go deleted file mode 100644 index 99816a01..00000000 --- a/vendor/github.com/gdamore/tcell/screen.go +++ /dev/null @@ -1,209 +0,0 @@ -// Copyright 2019 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tcell - -// Screen represents the physical (or emulated) screen. -// This can be a terminal window or a physical console. Platforms implement -// this differerently. -type Screen interface { - // Init initializes the screen for use. - Init() error - - // Fini finalizes the screen also releasing resources. - Fini() - - // Clear erases the screen. The contents of any screen buffers - // will also be cleared. This has the logical effect of - // filling the screen with spaces, using the global default style. - Clear() - - // Fill fills the screen with the given character and style. - Fill(rune, Style) - - // SetCell is an older API, and will be removed. Please use - // SetContent instead; SetCell is implemented in terms of SetContent. - SetCell(x int, y int, style Style, ch ...rune) - - // GetContent returns the contents at the given location. If the - // coordinates are out of range, then the values will be 0, nil, - // StyleDefault. Note that the contents returned are logical contents - // and may not actually be what is displayed, but rather are what will - // be displayed if Show() or Sync() is called. The width is the width - // in screen cells; most often this will be 1, but some East Asian - // characters require two cells. - GetContent(x, y int) (mainc rune, combc []rune, style Style, width int) - - // SetContent sets the contents of the given cell location. If - // the coordinates are out of range, then the operation is ignored. - // - // The first rune is the primary non-zero width rune. The array - // that follows is a possible list of combining characters to append, - // and will usually be nil (no combining characters.) - // - // The results are not displayd until Show() or Sync() is called. - // - // Note that wide (East Asian full width) runes occupy two cells, - // and attempts to place character at next cell to the right will have - // undefined effects. Wide runes that are printed in the - // last column will be replaced with a single width space on output. - SetContent(x int, y int, mainc rune, combc []rune, style Style) - - // SetStyle sets the default style to use when clearing the screen - // or when StyleDefault is specified. If it is also StyleDefault, - // then whatever system/terminal default is relevant will be used. - SetStyle(style Style) - - // ShowCursor is used to display the cursor at a given location. - // If the coordinates -1, -1 are given or are otherwise outside the - // dimensions of the screen, the cursor will be hidden. - ShowCursor(x int, y int) - - // HideCursor is used to hide the cursor. Its an alias for - // ShowCursor(-1, -1). - HideCursor() - - // Size returns the screen size as width, height. This changes in - // response to a call to Clear or Flush. - Size() (int, int) - - // PollEvent waits for events to arrive. Main application loops - // must spin on this to prevent the application from stalling. - // Furthermore, this will return nil if the Screen is finalized. - PollEvent() Event - - // PostEvent tries to post an event into the event stream. This - // can fail if the event queue is full. In that case, the event - // is dropped, and ErrEventQFull is returned. - PostEvent(ev Event) error - - // PostEventWait is like PostEvent, but if the queue is full, it - // blocks until there is space in the queue, making delivery - // reliable. However, it is VERY important that this function - // never be called from within whatever event loop is polling - // with PollEvent(), otherwise a deadlock may arise. - // - // For this reason, when using this function, the use of a - // Goroutine is recommended to ensure no deadlock can occur. - PostEventWait(ev Event) - - // EnableMouse enables the mouse. (If your terminal supports it.) - EnableMouse() - - // DisableMouse disables the mouse. - DisableMouse() - - // HasMouse returns true if the terminal (apparently) supports a - // mouse. Note that the a return value of true doesn't guarantee that - // a mouse/pointing device is present; a false return definitely - // indicates no mouse support is available. - HasMouse() bool - - // Colors returns the number of colors. All colors are assumed to - // use the ANSI color map. If a terminal is monochrome, it will - // return 0. - Colors() int - - // Show makes all the content changes made using SetContent() visible - // on the display. - // - // It does so in the most efficient and least visually disruptive - // manner possible. - Show() - - // Sync works like Show(), but it updates every visible cell on the - // physical display, assuming that it is not synchronized with any - // internal model. This may be both expensive and visually jarring, - // so it should only be used when believed to actually be necessary. - // - // Typically this is called as a result of a user-requested redraw - // (e.g. to clear up on screen corruption caused by some other program), - // or during a resize event. - Sync() - - // CharacterSet returns information about the character set. - // This isn't the full locale, but it does give us the input/output - // character set. Note that this is just for diagnostic purposes, - // we normally translate input/output to/from UTF-8, regardless of - // what the user's environment is. - CharacterSet() string - - // RegisterRuneFallback adds a fallback for runes that are not - // part of the character set -- for example one coudld register - // o as a fallback for ø. This should be done cautiously for - // characters that might be displayed ordinarily in language - // specific text -- characters that could change the meaning of - // of written text would be dangerous. The intention here is to - // facilitate fallback characters in pseudo-graphical applications. - // - // If the terminal has fallbacks already in place via an alternate - // character set, those are used in preference. Also, standard - // fallbacks for graphical characters in the ACSC terminfo string - // are registered implicitly. - - // The display string should be the same width as original rune. - // This makes it possible to register two character replacements - // for full width East Asian characters, for example. - // - // It is recommended that replacement strings consist only of - // 7-bit ASCII, since other characters may not display everywhere. - RegisterRuneFallback(r rune, subst string) - - // UnregisterRuneFallback unmaps a replacement. It will unmap - // the implicit ASCII replacements for alternate characters as well. - // When an unmapped char needs to be displayed, but no suitable - // glyph is available, '?' is emitted instead. It is not possible - // to "disable" the use of alternate characters that are supported - // by your terminal except by changing the terminal database. - UnregisterRuneFallback(r rune) - - // CanDisplay returns true if the given rune can be displayed on - // this screen. Note that this is a best guess effort -- whether - // your fonts support the character or not may be questionable. - // Mostly this is for folks who work outside of Unicode. - // - // If checkFallbacks is true, then if any (possibly imperfect) - // fallbacks are registered, this will return true. This will - // also return true if the terminal can replace the glyph with - // one that is visually indistinguishable from the one requested. - CanDisplay(r rune, checkFallbacks bool) bool - - // Resize does nothing, since its generally not possible to - // ask a screen to resize, but it allows the Screen to implement - // the View interface. - Resize(int, int, int, int) - - // HasKey returns true if the keyboard is believed to have the - // key. In some cases a keyboard may have keys with this name - // but no support for them, while in others a key may be reported - // as supported but not actually be usable (such as some emulators - // that hijack certain keys). Its best not to depend to strictly - // on this function, but it can be used for hinting when building - // menus, displayed hot-keys, etc. Note that KeyRune (literal - // runes) is always true. - HasKey(Key) bool -} - -// NewScreen returns a default Screen suitable for the user's terminal -// environment. -func NewScreen() (Screen, error) { - // Windows is happier if we try for a console screen first. - if s, _ := NewConsoleScreen(); s != nil { - return s, nil - } else if s, e := NewTerminfoScreen(); s != nil { - return s, nil - } else { - return nil, e - } -} diff --git a/vendor/github.com/gdamore/tcell/simulation.go b/vendor/github.com/gdamore/tcell/simulation.go deleted file mode 100644 index 850a7b3d..00000000 --- a/vendor/github.com/gdamore/tcell/simulation.go +++ /dev/null @@ -1,508 +0,0 @@ -// Copyright 2016 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tcell - -import ( - "sync" - "unicode/utf8" - - "golang.org/x/text/transform" -) - -// NewSimulationScreen returns a SimulationScreen. Note that -// SimulationScreen is also a Screen. -func NewSimulationScreen(charset string) SimulationScreen { - if charset == "" { - charset = "UTF-8" - } - s := &simscreen{charset: charset} - return s -} - -// SimulationScreen represents a screen simulation. This is intended to -// be a superset of normal Screens, but also adds some important interfaces -// for testing. -type SimulationScreen interface { - // InjectKeyBytes injects a stream of bytes corresponding to - // the native encoding (see charset). It turns true if the entire - // set of bytes were processed and delivered as KeyEvents, false - // if any bytes were not fully understood. Any bytes that are not - // fully converted are discarded. - InjectKeyBytes(buf []byte) bool - - // InjectKey injects a key event. The rune is a UTF-8 rune, post - // any translation. - InjectKey(key Key, r rune, mod ModMask) - - // InjectMouse injects a mouse event. - InjectMouse(x, y int, buttons ButtonMask, mod ModMask) - - // SetSize resizes the underlying physical screen. It also causes - // a resize event to be injected during the next Show() or Sync(). - // A new physical contents array will be allocated (with data from - // the old copied), so any prior value obtained with GetContents - // won't be used anymore - SetSize(width, height int) - - // GetContents returns screen contents as an array of - // cells, along with the physical width & height. Note that the - // physical contents will be used until the next time SetSize() - // is called. - GetContents() (cells []SimCell, width int, height int) - - // GetCursor returns the cursor details. - GetCursor() (x int, y int, visible bool) - - Screen -} - -// SimCell represents a simulated screen cell. The purpose of this -// is to track on screen content. -type SimCell struct { - // Bytes is the actual character bytes. Normally this is - // rune data, but it could be be data in another encoding system. - Bytes []byte - - // Style is the style used to display the data. - Style Style - - // Runes is the list of runes, unadulterated, in UTF-8. - Runes []rune -} - -type simscreen struct { - physw int - physh int - fini bool - style Style - evch chan Event - quit chan struct{} - - front []SimCell - back CellBuffer - clear bool - cursorx int - cursory int - cursorvis bool - mouse bool - charset string - encoder transform.Transformer - decoder transform.Transformer - fillchar rune - fillstyle Style - fallback map[rune]string - - sync.Mutex -} - -func (s *simscreen) Init() error { - s.evch = make(chan Event, 10) - s.quit = make(chan struct{}) - s.fillchar = 'X' - s.fillstyle = StyleDefault - s.mouse = false - s.physw = 80 - s.physh = 25 - s.cursorx = -1 - s.cursory = -1 - s.style = StyleDefault - - if enc := GetEncoding(s.charset); enc != nil { - s.encoder = enc.NewEncoder() - s.decoder = enc.NewDecoder() - } else { - return ErrNoCharset - } - - s.front = make([]SimCell, s.physw*s.physh) - s.back.Resize(80, 25) - - // default fallbacks - s.fallback = make(map[rune]string) - for k, v := range RuneFallbacks { - s.fallback[k] = v - } - return nil -} - -func (s *simscreen) Fini() { - s.Lock() - s.fini = true - s.back.Resize(0, 0) - s.Unlock() - if s.quit != nil { - close(s.quit) - } - s.physw = 0 - s.physh = 0 - s.front = nil -} - -func (s *simscreen) SetStyle(style Style) { - s.Lock() - s.style = style - s.Unlock() -} - -func (s *simscreen) Clear() { - s.Fill(' ', s.style) -} - -func (s *simscreen) Fill(r rune, style Style) { - s.Lock() - s.back.Fill(r, style) - s.Unlock() -} - -func (s *simscreen) SetCell(x, y int, style Style, ch ...rune) { - - if len(ch) > 0 { - s.SetContent(x, y, ch[0], ch[1:], style) - } else { - s.SetContent(x, y, ' ', nil, style) - } -} - -func (s *simscreen) SetContent(x, y int, mainc rune, combc []rune, st Style) { - - s.Lock() - s.back.SetContent(x, y, mainc, combc, st) - s.Unlock() -} - -func (s *simscreen) GetContent(x, y int) (rune, []rune, Style, int) { - var mainc rune - var combc []rune - var style Style - var width int - s.Lock() - mainc, combc, style, width = s.back.GetContent(x, y) - s.Unlock() - return mainc, combc, style, width -} - -func (s *simscreen) drawCell(x, y int) int { - - mainc, combc, style, width := s.back.GetContent(x, y) - if !s.back.Dirty(x, y) { - return width - } - if x >= s.physw || y >= s.physh || x < 0 || y < 0 { - return width - } - simc := &s.front[(y*s.physw)+x] - - if style == StyleDefault { - style = s.style - } - simc.Style = style - simc.Runes = append([]rune{mainc}, combc...) - - // now emit runes - taking care to not overrun width with a - // wide character, and to ensure that we emit exactly one regular - // character followed up by any residual combing characters - - simc.Bytes = nil - - if x > s.physw-width { - simc.Runes = []rune{' '} - simc.Bytes = []byte{' '} - return width - } - - lbuf := make([]byte, 12) - ubuf := make([]byte, 12) - nout := 0 - - for _, r := range simc.Runes { - - l := utf8.EncodeRune(ubuf, r) - - nout, _, _ = s.encoder.Transform(lbuf, ubuf[:l], true) - - if nout == 0 || lbuf[0] == '\x1a' { - - // skip combining - - if subst, ok := s.fallback[r]; ok { - simc.Bytes = append(simc.Bytes, - []byte(subst)...) - - } else if r >= ' ' && r <= '~' { - simc.Bytes = append(simc.Bytes, byte(r)) - - } else if simc.Bytes == nil { - simc.Bytes = append(simc.Bytes, '?') - } - } else { - simc.Bytes = append(simc.Bytes, lbuf[:nout]...) - } - } - s.back.SetDirty(x, y, false) - return width -} - -func (s *simscreen) ShowCursor(x, y int) { - s.Lock() - s.cursorx, s.cursory = x, y - s.showCursor() - s.Unlock() -} - -func (s *simscreen) HideCursor() { - s.ShowCursor(-1, -1) -} - -func (s *simscreen) showCursor() { - - x, y := s.cursorx, s.cursory - if x < 0 || y < 0 || x >= s.physw || y >= s.physh { - s.cursorvis = false - } else { - s.cursorvis = true - } -} - -func (s *simscreen) hideCursor() { - // does not update cursor position - s.cursorvis = false -} - -func (s *simscreen) Show() { - s.Lock() - s.resize() - s.draw() - s.Unlock() -} - -func (s *simscreen) clearScreen() { - // We emulate a hardware clear by filling with a specific pattern - for i := range s.front { - s.front[i].Style = s.fillstyle - s.front[i].Runes = []rune{s.fillchar} - s.front[i].Bytes = []byte{byte(s.fillchar)} - } - s.clear = false -} - -func (s *simscreen) draw() { - s.hideCursor() - if s.clear { - s.clearScreen() - } - - w, h := s.back.Size() - for y := 0; y < h; y++ { - for x := 0; x < w; x++ { - width := s.drawCell(x, y) - x += width - 1 - } - } - s.showCursor() -} - -func (s *simscreen) EnableMouse() { - s.mouse = true -} - -func (s *simscreen) DisableMouse() { - s.mouse = false -} - -func (s *simscreen) Size() (int, int) { - s.Lock() - w, h := s.back.Size() - s.Unlock() - return w, h -} - -func (s *simscreen) resize() { - w, h := s.physw, s.physh - ow, oh := s.back.Size() - if w != ow || h != oh { - s.back.Resize(w, h) - ev := NewEventResize(w, h) - s.PostEvent(ev) - } -} - -func (s *simscreen) Colors() int { - return 256 -} - -func (s *simscreen) PollEvent() Event { - select { - case <-s.quit: - return nil - case ev := <-s.evch: - return ev - } -} - -func (s *simscreen) PostEventWait(ev Event) { - s.evch <- ev -} - -func (s *simscreen) PostEvent(ev Event) error { - select { - case s.evch <- ev: - return nil - default: - return ErrEventQFull - } -} - -func (s *simscreen) InjectMouse(x, y int, buttons ButtonMask, mod ModMask) { - ev := NewEventMouse(x, y, buttons, mod) - s.PostEvent(ev) -} - -func (s *simscreen) InjectKey(key Key, r rune, mod ModMask) { - ev := NewEventKey(key, r, mod) - s.PostEvent(ev) -} - -func (s *simscreen) InjectKeyBytes(b []byte) bool { - failed := false - -outer: - for len(b) > 0 { - if b[0] >= ' ' && b[0] <= 0x7F { - // printable ASCII easy to deal with -- no encodings - ev := NewEventKey(KeyRune, rune(b[0]), ModNone) - s.PostEvent(ev) - b = b[1:] - continue - } - - if b[0] < 0x80 { - mod := ModNone - // No encodings start with low numbered values - if Key(b[0]) >= KeyCtrlA && Key(b[0]) <= KeyCtrlZ { - mod = ModCtrl - } - ev := NewEventKey(Key(b[0]), 0, mod) - s.PostEvent(ev) - continue - } - - utfb := make([]byte, len(b)*4) // worst case - for l := 1; l < len(b); l++ { - s.decoder.Reset() - nout, nin, _ := s.decoder.Transform(utfb, b[:l], true) - - if nout != 0 { - r, _ := utf8.DecodeRune(utfb[:nout]) - if r != utf8.RuneError { - ev := NewEventKey(KeyRune, r, ModNone) - s.PostEvent(ev) - } - b = b[nin:] - continue outer - } - } - failed = true - b = b[1:] - continue - } - - return !failed -} - -func (s *simscreen) Sync() { - s.Lock() - s.clear = true - s.resize() - s.back.Invalidate() - s.draw() - s.Unlock() -} - -func (s *simscreen) CharacterSet() string { - return s.charset -} - -func (s *simscreen) SetSize(w, h int) { - s.Lock() - newc := make([]SimCell, w*h) - for row := 0; row < h && row < s.physh; row++ { - for col := 0; col < w && col < s.physw; col++ { - newc[(row*w)+col] = s.front[(row*s.physw)+col] - } - } - s.cursorx, s.cursory = -1, -1 - s.physw, s.physh = w, h - s.front = newc - s.back.Resize(w, h) - s.Unlock() -} - -func (s *simscreen) GetContents() ([]SimCell, int, int) { - s.Lock() - cells, w, h := s.front, s.physw, s.physh - s.Unlock() - return cells, w, h -} - -func (s *simscreen) GetCursor() (int, int, bool) { - s.Lock() - x, y, vis := s.cursorx, s.cursory, s.cursorvis - s.Unlock() - return x, y, vis -} - -func (s *simscreen) RegisterRuneFallback(r rune, subst string) { - s.Lock() - s.fallback[r] = subst - s.Unlock() -} - -func (s *simscreen) UnregisterRuneFallback(r rune) { - s.Lock() - delete(s.fallback, r) - s.Unlock() -} - -func (s *simscreen) CanDisplay(r rune, checkFallbacks bool) bool { - - if enc := s.encoder; enc != nil { - nb := make([]byte, 6) - ob := make([]byte, 6) - num := utf8.EncodeRune(ob, r) - - enc.Reset() - dst, _, err := enc.Transform(nb, ob[:num], true) - if dst != 0 && err == nil && nb[0] != '\x1A' { - return true - } - } - if !checkFallbacks { - return false - } - if _, ok := s.fallback[r]; ok { - return true - } - return false -} - -func (s *simscreen) HasMouse() bool { - return false -} - -func (s *simscreen) Resize(int, int, int, int) {} - -func (s *simscreen) HasKey(Key) bool { - return true -} diff --git a/vendor/github.com/gdamore/tcell/style.go b/vendor/github.com/gdamore/tcell/style.go deleted file mode 100644 index c4ee9351..00000000 --- a/vendor/github.com/gdamore/tcell/style.go +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright 2015 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tcell - -// Style represents a complete text style, including both foreground -// and background color. We encode it in a 64-bit int for efficiency. -// The coding is (MSB): <7b flags><1b><24b fgcolor><7b attr><1b><24b bgcolor>. -// The <1b> is set true to indicate that the color is an RGB color, rather -// than a named index. -// -// This gives 24bit color options, if it ever becomes truly necessary. -// However, applications must not rely on this encoding. -// -// Note that not all terminals can display all colors or attributes, and -// many might have specific incompatibilities between specific attributes -// and color combinations. -// -// The intention is to extend styles to support paletting, in which case -// some flag bit(s) would be set, and the foreground and background colors -// would be replaced with a palette number and palette index. -// -// To use Style, just declare a variable of its type. -type Style int64 - -// StyleDefault represents a default style, based upon the context. -// It is the zero value. -const StyleDefault Style = 0 - -// styleFlags -- used internally for now. -const ( - styleBgSet = 1 << (iota + 57) - styleFgSet - stylePalette -) - -// Foreground returns a new style based on s, with the foreground color set -// as requested. ColorDefault can be used to select the global default. -func (s Style) Foreground(c Color) Style { - if c == ColorDefault { - return (s &^ (0x1ffffff00000000 | styleFgSet)) - } - return (s &^ Style(0x1ffffff00000000)) | - ((Style(c) & 0x1ffffff) << 32) | styleFgSet -} - -// Background returns a new style based on s, with the background color set -// as requested. ColorDefault can be used to select the global default. -func (s Style) Background(c Color) Style { - if c == ColorDefault { - return (s &^ (0x1ffffff | styleBgSet)) - } - return (s &^ (0x1ffffff)) | (Style(c) & 0x1ffffff) | styleBgSet -} - -// Decompose breaks a style up, returning the foreground, background, -// and other attributes. -func (s Style) Decompose() (fg Color, bg Color, attr AttrMask) { - if s&styleFgSet != 0 { - fg = Color(s>>32) & 0x1ffffff - } else { - fg = ColorDefault - } - if s&styleBgSet != 0 { - bg = Color(s & 0x1ffffff) - } else { - bg = ColorDefault - } - attr = AttrMask(s) & attrAll - - return fg, bg, attr -} - -func (s Style) setAttrs(attrs Style, on bool) Style { - if on { - return s | attrs - } - return s &^ attrs -} - -// Normal returns the style with all attributes disabled. -func (s Style) Normal() Style { - return s &^ Style(attrAll) -} - -// Bold returns a new style based on s, with the bold attribute set -// as requested. -func (s Style) Bold(on bool) Style { - return s.setAttrs(Style(AttrBold), on) -} - -// Blink returns a new style based on s, with the blink attribute set -// as requested. -func (s Style) Blink(on bool) Style { - return s.setAttrs(Style(AttrBlink), on) -} - -// Dim returns a new style based on s, with the dim attribute set -// as requested. -func (s Style) Dim(on bool) Style { - return s.setAttrs(Style(AttrDim), on) -} - -// Reverse returns a new style based on s, with the reverse attribute set -// as requested. (Reverse usually changes the foreground and background -// colors.) -func (s Style) Reverse(on bool) Style { - return s.setAttrs(Style(AttrReverse), on) -} - -// Underline returns a new style based on s, with the underline attribute set -// as requested. -func (s Style) Underline(on bool) Style { - return s.setAttrs(Style(AttrUnderline), on) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/.gitignore b/vendor/github.com/gdamore/tcell/terminfo/.gitignore deleted file mode 100644 index 74f3c04f..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/.gitignore +++ /dev/null @@ -1 +0,0 @@ -mkinfo diff --git a/vendor/github.com/gdamore/tcell/terminfo/README.md b/vendor/github.com/gdamore/tcell/terminfo/README.md deleted file mode 100644 index 20ae937f..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/README.md +++ /dev/null @@ -1,25 +0,0 @@ -This package represents the parent for all terminals. - -In older versions of tcell we had (a couple of) different -external file formats for the terminal database. Those are -now removed. All terminal definitions are supplied by -one of two methods: - -1. Compiled Go code - -2. For systems with terminfo and infocmp, dynamically - generated at runtime. - -The Go code can be generated using the mkinfo utility in -this directory. The database entry should be generated -into a package in a directory named as the first character -of the package name. (This permits us to group them all -without having a huge directory of little packages.) - -It may be desirable to add new packages to the extended -package, or -- rarely -- the base package. - -Applications which want to have the large set of terminal -descriptions built into the binary can simply import the -extended package. Otherwise a smaller reasonable default -set (the base package) will be included instead. diff --git a/vendor/github.com/gdamore/tcell/terminfo/TERMINALS.md b/vendor/github.com/gdamore/tcell/terminfo/TERMINALS.md deleted file mode 100644 index 85c1e61c..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/TERMINALS.md +++ /dev/null @@ -1,7 +0,0 @@ -TERMINALS -========= - -The best way to populate terminals on Debian is to install ncurses, -ncurses-term, screen, tmux, rxvt-unicode, and dvtm. This populates the -the terminfo database so that we can have a reasonable set of starting -terminals. diff --git a/vendor/github.com/gdamore/tcell/terminfo/a/adm3a/term.go b/vendor/github.com/gdamore/tcell/terminfo/a/adm3a/term.go deleted file mode 100644 index dd8cf0f4..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/a/adm3a/term.go +++ /dev/null @@ -1,25 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package adm3a - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // lsi adm3a - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "adm3a", - Columns: 80, - Lines: 24, - Bell: "\a", - Clear: "\x1a$<1/>", - PadChar: "\x00", - SetCursor: "\x1b=%p1%' '%+%c%p2%' '%+%c", - CursorBack1: "\b", - CursorUp1: "\v", - KeyUp: "\v", - KeyDown: "\n", - KeyRight: "\f", - KeyLeft: "\b", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/a/aixterm/term.go b/vendor/github.com/gdamore/tcell/terminfo/a/aixterm/term.go deleted file mode 100644 index 9dc082c8..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/a/aixterm/term.go +++ /dev/null @@ -1,81 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package aixterm - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // IBM Aixterm Terminal Emulator - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "aixterm", - Columns: 80, - Lines: 25, - Colors: 8, - Bell: "\a", - Clear: "\x1b[H\x1b[J", - AttrOff: "\x1b[0;10m\x1b(B", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Reverse: "\x1b[7m", - SetFg: "\x1b[3%p1%dm", - SetBg: "\x1b[4%p1%dm", - SetFgBg: "\x1b[3%p1%d;4%p2%dm", - PadChar: "\x00", - AltChars: "jjkkllmmnnqqttuuvvwwxx", - EnterAcs: "\x1b(0", - ExitAcs: "\x1b(B", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1b[A", - KeyDown: "\x1b[B", - KeyRight: "\x1b[C", - KeyLeft: "\x1b[D", - KeyInsert: "\x1b[139q", - KeyDelete: "\x1b[P", - KeyBackspace: "\b", - KeyHome: "\x1b[H", - KeyEnd: "\x1b[146q", - KeyPgUp: "\x1b[150q", - KeyPgDn: "\x1b[154q", - KeyF1: "\x1b[001q", - KeyF2: "\x1b[002q", - KeyF3: "\x1b[003q", - KeyF4: "\x1b[004q", - KeyF5: "\x1b[005q", - KeyF6: "\x1b[006q", - KeyF7: "\x1b[007q", - KeyF8: "\x1b[008q", - KeyF9: "\x1b[009q", - KeyF10: "\x1b[010q", - KeyF11: "\x1b[011q", - KeyF12: "\x1b[012q", - KeyF13: "\x1b[013q", - KeyF14: "\x1b[014q", - KeyF15: "\x1b[015q", - KeyF16: "\x1b[016q", - KeyF17: "\x1b[017q", - KeyF18: "\x1b[018q", - KeyF19: "\x1b[019q", - KeyF20: "\x1b[020q", - KeyF21: "\x1b[021q", - KeyF22: "\x1b[022q", - KeyF23: "\x1b[023q", - KeyF24: "\x1b[024q", - KeyF25: "\x1b[025q", - KeyF26: "\x1b[026q", - KeyF27: "\x1b[027q", - KeyF28: "\x1b[028q", - KeyF29: "\x1b[029q", - KeyF30: "\x1b[030q", - KeyF31: "\x1b[031q", - KeyF32: "\x1b[032q", - KeyF33: "\x1b[033q", - KeyF34: "\x1b[034q", - KeyF35: "\x1b[035q", - KeyF36: "\x1b[036q", - KeyClear: "\x1b[144q", - KeyBacktab: "\x1b[Z", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/a/alacritty/term.go b/vendor/github.com/gdamore/tcell/terminfo/a/alacritty/term.go deleted file mode 100644 index e65a8833..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/a/alacritty/term.go +++ /dev/null @@ -1,156 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package alacritty - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // alacritty terminal emulator - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "alacritty", - Columns: 80, - Lines: 24, - Colors: 256, - Bell: "\a", - Clear: "\x1b[H\x1b[2J", - EnterCA: "\x1b[?1049h\x1b[22;0;0t", - ExitCA: "\x1b[?1049l\x1b[23;0;0t", - ShowCursor: "\x1b[?12l\x1b[?25h", - HideCursor: "\x1b[?25l", - AttrOff: "\x1b(B\x1b[m", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Dim: "\x1b[2m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - EnterKeypad: "\x1b[?1h\x1b=", - ExitKeypad: "\x1b[?1l\x1b>", - SetFg: "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m", - SetBg: "\x1b[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m", - SetFgBg: "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;;%?%p2%{8}%<%t4%p2%d%e%p2%{16}%<%t10%p2%{8}%-%d%e48;5;%p2%d%;m", - AltChars: "``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x1b(0", - ExitAcs: "\x1b(B", - Mouse: "\x1b[M", - MouseMode: "%?%p1%{1}%=%t%'h'%Pa%e%'l'%Pa%;\x1b[?1000%ga%c\x1b[?1002%ga%c\x1b[?1003%ga%c\x1b[?1006%ga%c", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1bOA", - KeyDown: "\x1bOB", - KeyRight: "\x1bOC", - KeyLeft: "\x1bOD", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\b", - KeyHome: "\x1bOH", - KeyEnd: "\x1bOF", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1bOP", - KeyF2: "\x1bOQ", - KeyF3: "\x1bOR", - KeyF4: "\x1bOS", - KeyF5: "\x1b[15~", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyF13: "\x1b[1;2P", - KeyF14: "\x1b[1;2Q", - KeyF15: "\x1b[1;2R", - KeyF16: "\x1b[1;2S", - KeyF17: "\x1b[15;2~", - KeyF18: "\x1b[17;2~", - KeyF19: "\x1b[18;2~", - KeyF20: "\x1b[19;2~", - KeyF21: "\x1b[20;2~", - KeyF22: "\x1b[21;2~", - KeyF23: "\x1b[23;2~", - KeyF24: "\x1b[24;2~", - KeyF25: "\x1b[1;5P", - KeyF26: "\x1b[1;5Q", - KeyF27: "\x1b[1;5R", - KeyF28: "\x1b[1;5S", - KeyF29: "\x1b[15;5~", - KeyF30: "\x1b[17;5~", - KeyF31: "\x1b[18;5~", - KeyF32: "\x1b[19;5~", - KeyF33: "\x1b[20;5~", - KeyF34: "\x1b[21;5~", - KeyF35: "\x1b[23;5~", - KeyF36: "\x1b[24;5~", - KeyF37: "\x1b[1;6P", - KeyF38: "\x1b[1;6Q", - KeyF39: "\x1b[1;6R", - KeyF40: "\x1b[1;6S", - KeyF41: "\x1b[15;6~", - KeyF42: "\x1b[17;6~", - KeyF43: "\x1b[18;6~", - KeyF44: "\x1b[19;6~", - KeyF45: "\x1b[20;6~", - KeyF46: "\x1b[21;6~", - KeyF47: "\x1b[23;6~", - KeyF48: "\x1b[24;6~", - KeyF49: "\x1b[1;3P", - KeyF50: "\x1b[1;3Q", - KeyF51: "\x1b[1;3R", - KeyF52: "\x1b[1;3S", - KeyF53: "\x1b[15;3~", - KeyF54: "\x1b[17;3~", - KeyF55: "\x1b[18;3~", - KeyF56: "\x1b[19;3~", - KeyF57: "\x1b[20;3~", - KeyF58: "\x1b[21;3~", - KeyF59: "\x1b[23;3~", - KeyF60: "\x1b[24;3~", - KeyF61: "\x1b[1;4P", - KeyF62: "\x1b[1;4Q", - KeyF63: "\x1b[1;4R", - KeyBacktab: "\x1b[Z", - KeyShfLeft: "\x1b[1;2D", - KeyShfRight: "\x1b[1;2C", - KeyShfUp: "\x1b[1;2A", - KeyShfDown: "\x1b[1;2B", - KeyCtrlLeft: "\x1b[1;5D", - KeyCtrlRight: "\x1b[1;5C", - KeyCtrlUp: "\x1b[1;5A", - KeyCtrlDown: "\x1b[1;5B", - KeyMetaLeft: "\x1b[1;9D", - KeyMetaRight: "\x1b[1;9C", - KeyMetaUp: "\x1b[1;9A", - KeyMetaDown: "\x1b[1;9B", - KeyAltLeft: "\x1b[1;3D", - KeyAltRight: "\x1b[1;3C", - KeyAltUp: "\x1b[1;3A", - KeyAltDown: "\x1b[1;3B", - KeyAltShfLeft: "\x1b[1;4D", - KeyAltShfRight: "\x1b[1;4C", - KeyAltShfUp: "\x1b[1;4A", - KeyAltShfDown: "\x1b[1;4B", - KeyMetaShfLeft: "\x1b[1;10D", - KeyMetaShfRight: "\x1b[1;10C", - KeyMetaShfUp: "\x1b[1;10A", - KeyMetaShfDown: "\x1b[1;10B", - KeyCtrlShfLeft: "\x1b[1;6D", - KeyCtrlShfRight: "\x1b[1;6C", - KeyCtrlShfUp: "\x1b[1;6A", - KeyCtrlShfDown: "\x1b[1;6B", - KeyShfHome: "\x1b[1;2H", - KeyShfEnd: "\x1b[1;2F", - KeyCtrlHome: "\x1b[1;5H", - KeyCtrlEnd: "\x1b[1;5F", - KeyAltHome: "\x1b[1;9H", - KeyAltEnd: "\x1b[1;9F", - KeyCtrlShfHome: "\x1b[1;6H", - KeyCtrlShfEnd: "\x1b[1;6F", - KeyMetaShfHome: "\x1b[1;10H", - KeyMetaShfEnd: "\x1b[1;10F", - KeyAltShfHome: "\x1b[1;4H", - KeyAltShfEnd: "\x1b[1;4F", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/a/ansi/term.go b/vendor/github.com/gdamore/tcell/terminfo/a/ansi/term.go deleted file mode 100644 index 4500c17c..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/a/ansi/term.go +++ /dev/null @@ -1,41 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package ansi - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // ansi/pc-term compatible with color - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "ansi", - Columns: 80, - Lines: 24, - Colors: 8, - Bell: "\a", - Clear: "\x1b[H\x1b[J", - AttrOff: "\x1b[0;10m", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - SetFg: "\x1b[3%p1%dm", - SetBg: "\x1b[4%p1%dm", - SetFgBg: "\x1b[3%p1%d;4%p2%dm", - PadChar: "\x00", - AltChars: "+\x10,\x11-\x18.\x190\xdb`\x04a\xb1f\xf8g\xf1h\xb0j\xd9k\xbfl\xdam\xc0n\xc5o~p\xc4q\xc4r\xc4s_t\xc3u\xb4v\xc1w\xc2x\xb3y\xf3z\xf2{\xe3|\xd8}\x9c~\xfe", - EnterAcs: "\x1b[11m", - ExitAcs: "\x1b[10m", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\x1b[D", - CursorUp1: "\x1b[A", - KeyUp: "\x1b[A", - KeyDown: "\x1b[B", - KeyRight: "\x1b[C", - KeyLeft: "\x1b[D", - KeyInsert: "\x1b[L", - KeyBackspace: "\b", - KeyHome: "\x1b[H", - KeyBacktab: "\x1b[Z", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/a/aterm/term.go b/vendor/github.com/gdamore/tcell/terminfo/a/aterm/term.go deleted file mode 100644 index 429d29e6..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/a/aterm/term.go +++ /dev/null @@ -1,110 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package aterm - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // AfterStep terminal - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "aterm", - Columns: 80, - Lines: 24, - Colors: 8, - Bell: "\a", - Clear: "\x1b[H\x1b[2J", - EnterCA: "\x1b7\x1b[?47h", - ExitCA: "\x1b[2J\x1b[?47l\x1b8", - ShowCursor: "\x1b[?25h", - HideCursor: "\x1b[?25l", - AttrOff: "\x1b[m\x0f", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - EnterKeypad: "\x1b=", - ExitKeypad: "\x1b>", - SetFg: "\x1b[3%p1%dm", - SetBg: "\x1b[4%p1%dm", - SetFgBg: "\x1b[3%p1%d;4%p2%dm", - PadChar: "\x00", - AltChars: "``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x0e", - ExitAcs: "\x0f", - EnableAcs: "\x1b(B\x1b)0", - Mouse: "\x1b[M", - MouseMode: "%?%p1%{1}%=%t%'h'%Pa%e%'l'%Pa%;\x1b[?1000%ga%c\x1b[?1002%ga%c\x1b[?1003%ga%c\x1b[?1006%ga%c", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1b[A", - KeyDown: "\x1b[B", - KeyRight: "\x1b[C", - KeyLeft: "\x1b[D", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\xff", - KeyHome: "\x1b[7~", - KeyEnd: "\x1b[8~", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1bOP", - KeyF2: "\x1bOQ", - KeyF3: "\x1bOR", - KeyF4: "\x1bOS", - KeyF5: "\x1b[15~", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyF13: "\x1b[25~", - KeyF14: "\x1b[26~", - KeyF15: "\x1b[28~", - KeyF16: "\x1b[29~", - KeyF17: "\x1b[31~", - KeyF18: "\x1b[32~", - KeyF19: "\x1b[33~", - KeyF20: "\x1b[34~", - KeyF21: "\x1b[23$", - KeyF22: "\x1b[24$", - KeyF23: "\x1b[11^", - KeyF24: "\x1b[12^", - KeyF25: "\x1b[13^", - KeyF26: "\x1b[14^", - KeyF27: "\x1b[15^", - KeyF28: "\x1b[17^", - KeyF29: "\x1b[18^", - KeyF30: "\x1b[19^", - KeyF31: "\x1b[20^", - KeyF32: "\x1b[21^", - KeyF33: "\x1b[23^", - KeyF34: "\x1b[24^", - KeyF35: "\x1b[25^", - KeyF36: "\x1b[26^", - KeyF37: "\x1b[28^", - KeyF38: "\x1b[29^", - KeyF39: "\x1b[31^", - KeyF40: "\x1b[32^", - KeyF41: "\x1b[33^", - KeyF42: "\x1b[34^", - KeyF43: "\x1b[23@", - KeyF44: "\x1b[24@", - KeyBacktab: "\x1b[Z", - KeyShfLeft: "\x1b[d", - KeyShfRight: "\x1b[c", - KeyShfUp: "\x1b[a", - KeyShfDown: "\x1b[b", - KeyCtrlLeft: "\x1b[Od", - KeyCtrlRight: "\x1b[Oc", - KeyCtrlUp: "\x1b[Oa", - KeyCtrlDown: "\x1b[Ob", - KeyShfHome: "\x1b[7$", - KeyShfEnd: "\x1b[8$", - KeyCtrlHome: "\x1b[7^", - KeyCtrlEnd: "\x1b[8^", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/b/beterm/term.go b/vendor/github.com/gdamore/tcell/terminfo/b/beterm/term.go deleted file mode 100644 index 184d0467..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/b/beterm/term.go +++ /dev/null @@ -1,54 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package beterm - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // BeOS Terminal - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "beterm", - Columns: 80, - Lines: 25, - Colors: 8, - Bell: "\a", - Clear: "\x1b[H\x1b[J", - AttrOff: "\x1b[0;10m", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Reverse: "\x1b[7m", - EnterKeypad: "\x1b[?4h", - ExitKeypad: "\x1b[?4l", - SetFg: "\x1b[3%p1%dm", - SetBg: "\x1b[4%p1%dm", - SetFgBg: "\x1b[3%p1%d;4%p2%dm", - PadChar: "\x00", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1b[A", - KeyDown: "\x1b[B", - KeyRight: "\x1b[C", - KeyLeft: "\x1b[D", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\b", - KeyHome: "\x1b[1~", - KeyEnd: "\x1b[4~", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1b[11~", - KeyF2: "\x1b[12~", - KeyF3: "\x1b[13~", - KeyF4: "\x1b[14~", - KeyF5: "\x1b[15~", - KeyF6: "\x1b[16~", - KeyF7: "\x1b[17~", - KeyF8: "\x1b[18~", - KeyF9: "\x1b[19~", - KeyF10: "\x1b[20~", - KeyF11: "\x1b[21~", - KeyF12: "\x1b[22~", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/b/bsdos_pc/term.go b/vendor/github.com/gdamore/tcell/terminfo/b/bsdos_pc/term.go deleted file mode 100644 index 3174cc7d..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/b/bsdos_pc/term.go +++ /dev/null @@ -1,42 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package bsdos_pc - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // IBM PC BSD/OS Console - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "bsdos-pc", - Columns: 80, - Lines: 25, - Colors: 8, - Bell: "\a", - Clear: "\x1bc", - AttrOff: "\x1b[0;10m", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - SetFg: "\x1b[3%p1%dm", - SetBg: "\x1b[4%p1%dm", - SetFgBg: "\x1b[3%p1%d;4%p2%dm", - PadChar: "\x00", - AltChars: "+\x10,\x11-\x18.\x190\xdb`\x04a\xb1f\xf8g\xf1h\xb0j\xd9k\xbfl\xdam\xc0n\xc5o~p\xc4q\xc4r\xc4s_t\xc3u\xb4v\xc1w\xc2x\xb3y\xf3z\xf2{\xe3|\xd8}\x9c~\xfe", - EnterAcs: "\x1b[11m", - ExitAcs: "\x1b[10m", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1b[A", - KeyDown: "\x1b[B", - KeyRight: "\x1b[C", - KeyLeft: "\x1b[D", - KeyInsert: "\x1b[L", - KeyBackspace: "\b", - KeyHome: "\x1b[H", - KeyPgUp: "\x1b[I", - KeyPgDn: "\x1b[G", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/base/base.go b/vendor/github.com/gdamore/tcell/terminfo/base/base.go deleted file mode 100644 index 49e6c013..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/base/base.go +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2019 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// This is just a "minimalist" set of the base terminal descriptions. -// It should be sufficient for most applications. - -// Package base contains the base terminal descriptions that are likely -// to be needed by any stock application. It is imported by default in the -// terminfo package, so terminal types listed here will be available to any -// tcell application. -package base - -import ( - // The following imports just register themselves -- - // thse are the terminal types we aggregate in this package. - _ "github.com/gdamore/tcell/terminfo/a/ansi" - _ "github.com/gdamore/tcell/terminfo/v/vt100" - _ "github.com/gdamore/tcell/terminfo/v/vt102" - _ "github.com/gdamore/tcell/terminfo/v/vt220" - _ "github.com/gdamore/tcell/terminfo/x/xterm" -) diff --git a/vendor/github.com/gdamore/tcell/terminfo/c/cygwin/term.go b/vendor/github.com/gdamore/tcell/terminfo/c/cygwin/term.go deleted file mode 100644 index e734ef5c..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/c/cygwin/term.go +++ /dev/null @@ -1,63 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package cygwin - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // ansi emulation for Cygwin - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "cygwin", - Colors: 8, - Bell: "\a", - Clear: "\x1b[H\x1b[J", - EnterCA: "\x1b7\x1b[?47h", - ExitCA: "\x1b[2J\x1b[?47l\x1b8", - AttrOff: "\x1b[0;10m", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Reverse: "\x1b[7m", - SetFg: "\x1b[3%p1%dm", - SetBg: "\x1b[4%p1%dm", - SetFgBg: "\x1b[3%p1%d;4%p2%dm", - PadChar: "\x00", - AltChars: "+\x10,\x11-\x18.\x190\xdb`\x04a\xb1f\xf8g\xf1h\xb0j\xd9k\xbfl\xdam\xc0n\xc5o~p\xc4q\xc4r\xc4s_t\xc3u\xb4v\xc1w\xc2x\xb3y\xf3z\xf2{\xe3|\xd8}\x9c~\xfe", - EnterAcs: "\x1b[11m", - ExitAcs: "\x1b[10m", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1b[A", - KeyDown: "\x1b[B", - KeyRight: "\x1b[C", - KeyLeft: "\x1b[D", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\b", - KeyHome: "\x1b[1~", - KeyEnd: "\x1b[4~", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1b[[A", - KeyF2: "\x1b[[B", - KeyF3: "\x1b[[C", - KeyF4: "\x1b[[D", - KeyF5: "\x1b[[E", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyF13: "\x1b[25~", - KeyF14: "\x1b[26~", - KeyF15: "\x1b[28~", - KeyF16: "\x1b[29~", - KeyF17: "\x1b[31~", - KeyF18: "\x1b[32~", - KeyF19: "\x1b[33~", - KeyF20: "\x1b[34~", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/d/d200/term.go b/vendor/github.com/gdamore/tcell/terminfo/d/d200/term.go deleted file mode 100644 index 5950d5c8..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/d/d200/term.go +++ /dev/null @@ -1,97 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package d200 - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // Data General DASHER D200 - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "d200", - Aliases: []string{"d200-dg"}, - Columns: 80, - Lines: 24, - Bell: "\a", - Clear: "\f", - AttrOff: "\x0f\x15\x1d\x1eE", - Underline: "\x14", - Bold: "\x1eD\x14", - Dim: "\x1c", - Blink: "\x0e", - Reverse: "\x1eD", - PadChar: "\x00", - SetCursor: "\x10%p2%c%p1%c", - CursorBack1: "\x19", - CursorUp1: "\x17", - KeyUp: "\x17", - KeyDown: "\x1a", - KeyRight: "\x18", - KeyLeft: "\x19", - KeyHome: "\b", - KeyF1: "\x1eq", - KeyF2: "\x1er", - KeyF3: "\x1es", - KeyF4: "\x1et", - KeyF5: "\x1eu", - KeyF6: "\x1ev", - KeyF7: "\x1ew", - KeyF8: "\x1ex", - KeyF9: "\x1ey", - KeyF10: "\x1ez", - KeyF11: "\x1e{", - KeyF12: "\x1e|", - KeyF13: "\x1e}", - KeyF14: "\x1e~", - KeyF15: "\x1ep", - KeyF16: "\x1ea", - KeyF17: "\x1eb", - KeyF18: "\x1ec", - KeyF19: "\x1ed", - KeyF20: "\x1ee", - KeyF21: "\x1ef", - KeyF22: "\x1eg", - KeyF23: "\x1eh", - KeyF24: "\x1ei", - KeyF25: "\x1ej", - KeyF26: "\x1ek", - KeyF27: "\x1el", - KeyF28: "\x1em", - KeyF29: "\x1en", - KeyF30: "\x1e`", - KeyF31: "\x1e1", - KeyF32: "\x1e2", - KeyF33: "\x1e3", - KeyF34: "\x1e4", - KeyF35: "\x1e5", - KeyF36: "\x1e6", - KeyF37: "\x1e7", - KeyF38: "\x1e8", - KeyF39: "\x1e9", - KeyF40: "\x1e:", - KeyF41: "\x1e;", - KeyF42: "\x1e<", - KeyF43: "\x1e=", - KeyF44: "\x1e>", - KeyF45: "\x1e0", - KeyF46: "\x1e!", - KeyF47: "\x1e\"", - KeyF48: "\x1e#", - KeyF49: "\x1e$", - KeyF50: "\x1e%%", - KeyF51: "\x1e&", - KeyF52: "\x1e'", - KeyF53: "\x1e(", - KeyF54: "\x1e)", - KeyF55: "\x1e*", - KeyF56: "\x1e+", - KeyF57: "\x1e,", - KeyF58: "\x1e-", - KeyF59: "\x1e.", - KeyF60: "\x1e ", - KeyClear: "\f", - KeyShfLeft: "\x1e\x19", - KeyShfRight: "\x1e\x18", - KeyShfHome: "\x1e\b", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/d/d210/term.go b/vendor/github.com/gdamore/tcell/terminfo/d/d210/term.go deleted file mode 100644 index 13a56cce..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/d/d210/term.go +++ /dev/null @@ -1,95 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package d210 - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // Data General DASHER D210 series - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "d210", - Aliases: []string{"d214"}, - Columns: 80, - Lines: 24, - Bell: "\a", - Clear: "\x1b[2J", - AttrOff: "\x1b[m", - Underline: "\x1b[4m", - Bold: "\x1b[4;7m", - Dim: "\x1b[2m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - PadChar: "\x00", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1b[A", - KeyDown: "\x1b[B", - KeyRight: "\x1b[C", - KeyLeft: "\x1b[D", - KeyHome: "\x1b[H", - KeyF1: "\x1b[001z", - KeyF2: "\x1b[002z", - KeyF3: "\x1b[003z", - KeyF4: "\x1b[004z", - KeyF5: "\x1b[005z", - KeyF6: "\x1b[006z", - KeyF7: "\x1b[007z", - KeyF8: "\x1b[008z", - KeyF9: "\x1b[009z", - KeyF10: "\x1b[010z", - KeyF11: "\x1b[011z", - KeyF12: "\x1b[012z", - KeyF13: "\x1b[013z", - KeyF14: "\x1b[014z", - KeyF15: "\x1b[000z", - KeyF16: "\x1b[101z", - KeyF17: "\x1b[102z", - KeyF18: "\x1b[103z", - KeyF19: "\x1b[104z", - KeyF20: "\x1b[105z", - KeyF21: "\x1b[106z", - KeyF22: "\x1b[107z", - KeyF23: "\x1b[108z", - KeyF24: "\x1b[109z", - KeyF25: "\x1b[110z", - KeyF26: "\x1b[111z", - KeyF27: "\x1b[112z", - KeyF28: "\x1b[113z", - KeyF29: "\x1b[114z", - KeyF30: "\x1b[100z", - KeyF31: "\x1b[201z", - KeyF32: "\x1b[202z", - KeyF33: "\x1b[203z", - KeyF34: "\x1b[204z", - KeyF35: "\x1b[205z", - KeyF36: "\x1b[206z", - KeyF37: "\x1b[207z", - KeyF38: "\x1b[208z", - KeyF39: "\x1b[209z", - KeyF40: "\x1b[210z", - KeyF41: "\x1b[211z", - KeyF42: "\x1b[212z", - KeyF43: "\x1b[213z", - KeyF44: "\x1b[214z", - KeyF45: "\x1b[200z", - KeyF46: "\x1b[301z", - KeyF47: "\x1b[302z", - KeyF48: "\x1b[303z", - KeyF49: "\x1b[304z", - KeyF50: "\x1b[305z", - KeyF51: "\x1b[306z", - KeyF52: "\x1b[307z", - KeyF53: "\x1b[308z", - KeyF54: "\x1b[309z", - KeyF55: "\x1b[310z", - KeyF56: "\x1b[311z", - KeyF57: "\x1b[312z", - KeyF58: "\x1b[313z", - KeyF59: "\x1b[314z", - KeyF60: "\x1b[300z", - KeyPrint: "\x1b[i", - KeyClear: "\x1b[2J", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/d/dtterm/term.go b/vendor/github.com/gdamore/tcell/terminfo/d/dtterm/term.go deleted file mode 100644 index a6366f22..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/d/dtterm/term.go +++ /dev/null @@ -1,67 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package dtterm - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // CDE desktop terminal - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "dtterm", - Columns: 80, - Lines: 24, - Colors: 8, - Bell: "\a", - Clear: "\x1b[H\x1b[J", - ShowCursor: "\x1b[?25h", - HideCursor: "\x1b[?25l", - AttrOff: "\x1b[m\x0f", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Dim: "\x1b[2m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - SetFg: "\x1b[3%p1%dm", - SetBg: "\x1b[4%p1%dm", - SetFgBg: "\x1b[3%p1%d;4%p2%dm", - PadChar: "\x00", - AltChars: "``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x0e", - ExitAcs: "\x0f", - EnableAcs: "\x1b(B\x1b)0", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1b[A", - KeyDown: "\x1b[B", - KeyRight: "\x1b[C", - KeyLeft: "\x1b[D", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\b", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1b[11~", - KeyF2: "\x1b[12~", - KeyF3: "\x1b[13~", - KeyF4: "\x1b[14~", - KeyF5: "\x1b[15~", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyF13: "\x1b[25~", - KeyF14: "\x1b[26~", - KeyF15: "\x1b[28~", - KeyF16: "\x1b[29~", - KeyF17: "\x1b[31~", - KeyF18: "\x1b[32~", - KeyF19: "\x1b[33~", - KeyF20: "\x1b[34~", - KeyHelp: "\x1b[28~", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/dynamic/dynamic.go b/vendor/github.com/gdamore/tcell/terminfo/dynamic/dynamic.go deleted file mode 100644 index 71de2080..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/dynamic/dynamic.go +++ /dev/null @@ -1,425 +0,0 @@ -// Copyright 2019 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// The dynamic package is used to generate a terminal description dynamically, -// using infocmp. This is really a method of last resort, as the performance -// will be slow, and it requires a working infocmp. But, the hope is that it -// will assist folks who have to deal with a terminal description that isn't -// already built in. This requires infocmp to be in the user's path, and to -// support reasonably the -1 option. - -package dynamic - -import ( - "bytes" - "errors" - "os/exec" - "regexp" - "strconv" - "strings" - - "github.com/gdamore/tcell/terminfo" -) - -type termcap struct { - name string - desc string - aliases []string - bools map[string]bool - nums map[string]int - strs map[string]string -} - -func (tc *termcap) getnum(s string) int { - return (tc.nums[s]) -} - -func (tc *termcap) getflag(s string) bool { - return (tc.bools[s]) -} - -func (tc *termcap) getstr(s string) string { - return (tc.strs[s]) -} - -const ( - none = iota - control - escaped -) - -var errNotAddressable = errors.New("terminal not cursor addressable") - -func unescape(s string) string { - // Various escapes are in \x format. Control codes are - // encoded as ^M (carat followed by ASCII equivalent). - // escapes are: \e, \E - escape - // \0 NULL, \n \l \r \t \b \f \s for equivalent C escape. - buf := &bytes.Buffer{} - esc := none - - for i := 0; i < len(s); i++ { - c := s[i] - switch esc { - case none: - switch c { - case '\\': - esc = escaped - case '^': - esc = control - default: - buf.WriteByte(c) - } - case control: - buf.WriteByte(c - 0x40) - esc = none - case escaped: - switch c { - case 'E', 'e': - buf.WriteByte(0x1b) - case '0', '1', '2', '3', '4', '5', '6', '7': - if i+2 < len(s) && s[i+1] >= '0' && s[i+1] <= '7' && s[i+2] >= '0' && s[i+2] <= '7' { - buf.WriteByte(((c - '0') * 64) + ((s[i+1] - '0') * 8) + (s[i+2] - '0')) - i = i + 2 - } else if c == '0' { - buf.WriteByte(0) - } - case 'n': - buf.WriteByte('\n') - case 'r': - buf.WriteByte('\r') - case 't': - buf.WriteByte('\t') - case 'b': - buf.WriteByte('\b') - case 'f': - buf.WriteByte('\f') - case 's': - buf.WriteByte(' ') - default: - buf.WriteByte(c) - } - esc = none - } - } - return (buf.String()) -} - -func (tc *termcap) setupterm(name string) error { - cmd := exec.Command("infocmp", "-1", name) - output := &bytes.Buffer{} - cmd.Stdout = output - - tc.strs = make(map[string]string) - tc.bools = make(map[string]bool) - tc.nums = make(map[string]int) - - if err := cmd.Run(); err != nil { - return err - } - - // Now parse the output. - // We get comment lines (starting with "#"), followed by - // a header line that looks like "||...|" - // then capabilities, one per line, starting with a tab and ending - // with a comma and newline. - lines := strings.Split(output.String(), "\n") - for len(lines) > 0 && strings.HasPrefix(lines[0], "#") { - lines = lines[1:] - } - - // Ditch trailing empty last line - if lines[len(lines)-1] == "" { - lines = lines[:len(lines)-1] - } - header := lines[0] - if strings.HasSuffix(header, ",") { - header = header[:len(header)-1] - } - names := strings.Split(header, "|") - tc.name = names[0] - names = names[1:] - if len(names) > 0 { - tc.desc = names[len(names)-1] - names = names[:len(names)-1] - } - tc.aliases = names - for _, val := range lines[1:] { - if (!strings.HasPrefix(val, "\t")) || - (!strings.HasSuffix(val, ",")) { - return (errors.New("malformed infocmp: " + val)) - } - - val = val[1:] - val = val[:len(val)-1] - - if k := strings.SplitN(val, "=", 2); len(k) == 2 { - tc.strs[k[0]] = unescape(k[1]) - } else if k := strings.SplitN(val, "#", 2); len(k) == 2 { - u, err := strconv.ParseUint(k[1], 0, 0) - if err != nil { - return (err) - } - tc.nums[k[0]] = int(u) - } else { - tc.bools[val] = true - } - } - return nil -} - -// LoadTerminfo creates a Terminfo by for named terminal by attempting to parse -// the output from infocmp. This returns the terminfo entry, a description of -// the terminal, and either nil or an error. -func LoadTerminfo(name string) (*terminfo.Terminfo, string, error) { - var tc termcap - if err := tc.setupterm(name); err != nil { - if err != nil { - return nil, "", err - } - } - t := &terminfo.Terminfo{} - // If this is an alias record, then just emit the alias - t.Name = tc.name - if t.Name != name { - return t, "", nil - } - t.Aliases = tc.aliases - t.Colors = tc.getnum("colors") - t.Columns = tc.getnum("cols") - t.Lines = tc.getnum("lines") - t.Bell = tc.getstr("bel") - t.Clear = tc.getstr("clear") - t.EnterCA = tc.getstr("smcup") - t.ExitCA = tc.getstr("rmcup") - t.ShowCursor = tc.getstr("cnorm") - t.HideCursor = tc.getstr("civis") - t.AttrOff = tc.getstr("sgr0") - t.Underline = tc.getstr("smul") - t.Bold = tc.getstr("bold") - t.Blink = tc.getstr("blink") - t.Dim = tc.getstr("dim") - t.Reverse = tc.getstr("rev") - t.EnterKeypad = tc.getstr("smkx") - t.ExitKeypad = tc.getstr("rmkx") - t.SetFg = tc.getstr("setaf") - t.SetBg = tc.getstr("setab") - t.SetCursor = tc.getstr("cup") - t.CursorBack1 = tc.getstr("cub1") - t.CursorUp1 = tc.getstr("cuu1") - t.KeyF1 = tc.getstr("kf1") - t.KeyF2 = tc.getstr("kf2") - t.KeyF3 = tc.getstr("kf3") - t.KeyF4 = tc.getstr("kf4") - t.KeyF5 = tc.getstr("kf5") - t.KeyF6 = tc.getstr("kf6") - t.KeyF7 = tc.getstr("kf7") - t.KeyF8 = tc.getstr("kf8") - t.KeyF9 = tc.getstr("kf9") - t.KeyF10 = tc.getstr("kf10") - t.KeyF11 = tc.getstr("kf11") - t.KeyF12 = tc.getstr("kf12") - t.KeyF13 = tc.getstr("kf13") - t.KeyF14 = tc.getstr("kf14") - t.KeyF15 = tc.getstr("kf15") - t.KeyF16 = tc.getstr("kf16") - t.KeyF17 = tc.getstr("kf17") - t.KeyF18 = tc.getstr("kf18") - t.KeyF19 = tc.getstr("kf19") - t.KeyF20 = tc.getstr("kf20") - t.KeyF21 = tc.getstr("kf21") - t.KeyF22 = tc.getstr("kf22") - t.KeyF23 = tc.getstr("kf23") - t.KeyF24 = tc.getstr("kf24") - t.KeyF25 = tc.getstr("kf25") - t.KeyF26 = tc.getstr("kf26") - t.KeyF27 = tc.getstr("kf27") - t.KeyF28 = tc.getstr("kf28") - t.KeyF29 = tc.getstr("kf29") - t.KeyF30 = tc.getstr("kf30") - t.KeyF31 = tc.getstr("kf31") - t.KeyF32 = tc.getstr("kf32") - t.KeyF33 = tc.getstr("kf33") - t.KeyF34 = tc.getstr("kf34") - t.KeyF35 = tc.getstr("kf35") - t.KeyF36 = tc.getstr("kf36") - t.KeyF37 = tc.getstr("kf37") - t.KeyF38 = tc.getstr("kf38") - t.KeyF39 = tc.getstr("kf39") - t.KeyF40 = tc.getstr("kf40") - t.KeyF41 = tc.getstr("kf41") - t.KeyF42 = tc.getstr("kf42") - t.KeyF43 = tc.getstr("kf43") - t.KeyF44 = tc.getstr("kf44") - t.KeyF45 = tc.getstr("kf45") - t.KeyF46 = tc.getstr("kf46") - t.KeyF47 = tc.getstr("kf47") - t.KeyF48 = tc.getstr("kf48") - t.KeyF49 = tc.getstr("kf49") - t.KeyF50 = tc.getstr("kf50") - t.KeyF51 = tc.getstr("kf51") - t.KeyF52 = tc.getstr("kf52") - t.KeyF53 = tc.getstr("kf53") - t.KeyF54 = tc.getstr("kf54") - t.KeyF55 = tc.getstr("kf55") - t.KeyF56 = tc.getstr("kf56") - t.KeyF57 = tc.getstr("kf57") - t.KeyF58 = tc.getstr("kf58") - t.KeyF59 = tc.getstr("kf59") - t.KeyF60 = tc.getstr("kf60") - t.KeyF61 = tc.getstr("kf61") - t.KeyF62 = tc.getstr("kf62") - t.KeyF63 = tc.getstr("kf63") - t.KeyF64 = tc.getstr("kf64") - t.KeyInsert = tc.getstr("kich1") - t.KeyDelete = tc.getstr("kdch1") - t.KeyBackspace = tc.getstr("kbs") - t.KeyHome = tc.getstr("khome") - t.KeyEnd = tc.getstr("kend") - t.KeyUp = tc.getstr("kcuu1") - t.KeyDown = tc.getstr("kcud1") - t.KeyRight = tc.getstr("kcuf1") - t.KeyLeft = tc.getstr("kcub1") - t.KeyPgDn = tc.getstr("knp") - t.KeyPgUp = tc.getstr("kpp") - t.KeyBacktab = tc.getstr("kcbt") - t.KeyExit = tc.getstr("kext") - t.KeyCancel = tc.getstr("kcan") - t.KeyPrint = tc.getstr("kprt") - t.KeyHelp = tc.getstr("khlp") - t.KeyClear = tc.getstr("kclr") - t.AltChars = tc.getstr("acsc") - t.EnterAcs = tc.getstr("smacs") - t.ExitAcs = tc.getstr("rmacs") - t.EnableAcs = tc.getstr("enacs") - t.Mouse = tc.getstr("kmous") - t.KeyShfRight = tc.getstr("kRIT") - t.KeyShfLeft = tc.getstr("kLFT") - t.KeyShfHome = tc.getstr("kHOM") - t.KeyShfEnd = tc.getstr("kEND") - - // Terminfo lacks descriptions for a bunch of modified keys, - // but modern XTerm and emulators often have them. Let's add them, - // if the shifted right and left arrows are defined. - if t.KeyShfRight == "\x1b[1;2C" && t.KeyShfLeft == "\x1b[1;2D" { - t.KeyShfUp = "\x1b[1;2A" - t.KeyShfDown = "\x1b[1;2B" - t.KeyMetaUp = "\x1b[1;9A" - t.KeyMetaDown = "\x1b[1;9B" - t.KeyMetaRight = "\x1b[1;9C" - t.KeyMetaLeft = "\x1b[1;9D" - t.KeyAltUp = "\x1b[1;3A" - t.KeyAltDown = "\x1b[1;3B" - t.KeyAltRight = "\x1b[1;3C" - t.KeyAltLeft = "\x1b[1;3D" - t.KeyCtrlUp = "\x1b[1;5A" - t.KeyCtrlDown = "\x1b[1;5B" - t.KeyCtrlRight = "\x1b[1;5C" - t.KeyCtrlLeft = "\x1b[1;5D" - t.KeyAltShfUp = "\x1b[1;4A" - t.KeyAltShfDown = "\x1b[1;4B" - t.KeyAltShfRight = "\x1b[1;4C" - t.KeyAltShfLeft = "\x1b[1;4D" - - t.KeyMetaShfUp = "\x1b[1;10A" - t.KeyMetaShfDown = "\x1b[1;10B" - t.KeyMetaShfRight = "\x1b[1;10C" - t.KeyMetaShfLeft = "\x1b[1;10D" - - t.KeyCtrlShfUp = "\x1b[1;6A" - t.KeyCtrlShfDown = "\x1b[1;6B" - t.KeyCtrlShfRight = "\x1b[1;6C" - t.KeyCtrlShfLeft = "\x1b[1;6D" - } - // And also for Home and End - if t.KeyShfHome == "\x1b[1;2H" && t.KeyShfEnd == "\x1b[1;2F" { - t.KeyCtrlHome = "\x1b[1;5H" - t.KeyCtrlEnd = "\x1b[1;5F" - t.KeyAltHome = "\x1b[1;9H" - t.KeyAltEnd = "\x1b[1;9F" - t.KeyCtrlShfHome = "\x1b[1;6H" - t.KeyCtrlShfEnd = "\x1b[1;6F" - t.KeyAltShfHome = "\x1b[1;4H" - t.KeyAltShfEnd = "\x1b[1;4F" - t.KeyMetaShfHome = "\x1b[1;10H" - t.KeyMetaShfEnd = "\x1b[1;10F" - } - - // And the same thing for rxvt and workalikes (Eterm, aterm, etc.) - // It seems that urxvt at least send escaped as ALT prefix for these, - // although some places seem to indicate a separate ALT key sesquence. - if t.KeyShfRight == "\x1b[c" && t.KeyShfLeft == "\x1b[d" { - t.KeyShfUp = "\x1b[a" - t.KeyShfDown = "\x1b[b" - t.KeyCtrlUp = "\x1b[Oa" - t.KeyCtrlDown = "\x1b[Ob" - t.KeyCtrlRight = "\x1b[Oc" - t.KeyCtrlLeft = "\x1b[Od" - } - if t.KeyShfHome == "\x1b[7$" && t.KeyShfEnd == "\x1b[8$" { - t.KeyCtrlHome = "\x1b[7^" - t.KeyCtrlEnd = "\x1b[8^" - } - - // If the kmous entry is present, then we need to record the - // the codes to enter and exit mouse mode. Sadly, this is not - // part of the terminfo databases anywhere that I've found, but - // is an extension. The escapedape codes are documented in the XTerm - // manual, and all terminals that have kmous are expected to - // use these same codes, unless explicitly configured otherwise - // vi XM. Note that in any event, we only known how to parse either - // x11 or SGR mouse events -- if your terminal doesn't support one - // of these two forms, you maybe out of luck. - t.MouseMode = tc.getstr("XM") - if t.Mouse != "" && t.MouseMode == "" { - // we anticipate that all xterm mouse tracking compatible - // terminals understand mouse tracking (1000), but we hope - // that those that don't understand any-event tracking (1003) - // will at least ignore it. Likewise we hope that terminals - // that don't understand SGR reporting (1006) just ignore it. - t.MouseMode = "%?%p1%{1}%=%t%'h'%Pa%e%'l'%Pa%;" + - "\x1b[?1000%ga%c\x1b[?1002%ga%c\x1b[?1003%ga%c\x1b[?1006%ga%c" - } - - // We only support colors in ANSI 8 or 256 color mode. - if t.Colors < 8 || t.SetFg == "" { - t.Colors = 0 - } - if t.SetCursor == "" { - return nil, "", errNotAddressable - } - - // For padding, we lookup the pad char. If that isn't present, - // and npc is *not* set, then we assume a null byte. - t.PadChar = tc.getstr("pad") - if t.PadChar == "" { - if !tc.getflag("npc") { - t.PadChar = "\u0000" - } - } - - // For terminals that use "standard" SGR sequences, lets combine the - // foreground and background together. - if strings.HasPrefix(t.SetFg, "\x1b[") && - strings.HasPrefix(t.SetBg, "\x1b[") && - strings.HasSuffix(t.SetFg, "m") && - strings.HasSuffix(t.SetBg, "m") { - fg := t.SetFg[:len(t.SetFg)-1] - r := regexp.MustCompile("%p1") - bg := r.ReplaceAllString(t.SetBg[2:], "%p2") - t.SetFgBg = fg + ";" + bg - } - - return t, tc.desc, nil -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/e/emacs/term.go b/vendor/github.com/gdamore/tcell/terminfo/e/emacs/term.go deleted file mode 100644 index 91418b64..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/e/emacs/term.go +++ /dev/null @@ -1,60 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package emacs - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // gnu emacs term.el terminal emulation - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "eterm", - Columns: 80, - Lines: 24, - Bell: "\a", - Clear: "\x1b[H\x1b[J", - EnterCA: "\x1b7\x1b[?47h", - ExitCA: "\x1b[2J\x1b[?47l\x1b8", - AttrOff: "\x1b[m", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Reverse: "\x1b[7m", - PadChar: "\x00", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - }) - - // Emacs term.el terminal emulator term-protocol-version 0.96 - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "eterm-color", - Columns: 80, - Lines: 24, - Colors: 8, - Bell: "\a", - Clear: "\x1b[H\x1b[J", - AttrOff: "\x1b[m", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - SetFg: "\x1b[%p1%{30}%+%dm", - SetBg: "\x1b[%p1%'('%+%dm", - SetFgBg: "\x1b[%p1%{30}%+%d;%p2%'('%+%dm", - PadChar: "\x00", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1bOA", - KeyDown: "\x1bOB", - KeyRight: "\x1bOC", - KeyLeft: "\x1bOD", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\xff", - KeyHome: "\x1b[1~", - KeyEnd: "\x1b[4~", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/e/eterm/term.go b/vendor/github.com/gdamore/tcell/terminfo/e/eterm/term.go deleted file mode 100644 index e5bd99fd..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/e/eterm/term.go +++ /dev/null @@ -1,309 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package eterm - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // Eterm with xterm-style color support (X Window System) - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "Eterm", - Aliases: []string{"Eterm-color"}, - Columns: 80, - Lines: 24, - Colors: 8, - Bell: "\a", - Clear: "\x1b[H\x1b[2J", - EnterCA: "\x1b7\x1b[?47h", - ExitCA: "\x1b[2J\x1b[?47l\x1b8", - ShowCursor: "\x1b[?25h", - HideCursor: "\x1b[?25l", - AttrOff: "\x1b[m\x0f", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - SetFg: "\x1b[3%p1%dm", - SetBg: "\x1b[4%p1%dm", - SetFgBg: "\x1b[3%p1%d;4%p2%dm", - PadChar: "\x00", - AltChars: "``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x0e", - ExitAcs: "\x0f", - EnableAcs: "\x1b)0", - Mouse: "\x1b[M", - MouseMode: "%?%p1%{1}%=%t%'h'%Pa%e%'l'%Pa%;\x1b[?1000%ga%c\x1b[?1002%ga%c\x1b[?1003%ga%c\x1b[?1006%ga%c", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1b[A", - KeyDown: "\x1b[B", - KeyRight: "\x1b[C", - KeyLeft: "\x1b[D", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\xff", - KeyHome: "\x1b[7~", - KeyEnd: "\x1b[8~", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1b[11~", - KeyF2: "\x1b[12~", - KeyF3: "\x1b[13~", - KeyF4: "\x1b[14~", - KeyF5: "\x1b[15~", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyF13: "\x1b[25~", - KeyF14: "\x1b[26~", - KeyF15: "\x1b[28~", - KeyF16: "\x1b[29~", - KeyF17: "\x1b[31~", - KeyF18: "\x1b[32~", - KeyF19: "\x1b[33~", - KeyF20: "\x1b[34~", - KeyF21: "\x1b[23$", - KeyF22: "\x1b[24$", - KeyF23: "\x1b[11^", - KeyF24: "\x1b[12^", - KeyF25: "\x1b[13^", - KeyF26: "\x1b[14^", - KeyF27: "\x1b[15^", - KeyF28: "\x1b[17^", - KeyF29: "\x1b[18^", - KeyF30: "\x1b[19^", - KeyF31: "\x1b[20^", - KeyF32: "\x1b[21^", - KeyF33: "\x1b[23^", - KeyF34: "\x1b[24^", - KeyF35: "\x1b[25^", - KeyF36: "\x1b[26^", - KeyF37: "\x1b[28^", - KeyF38: "\x1b[29^", - KeyF39: "\x1b[31^", - KeyF40: "\x1b[32^", - KeyF41: "\x1b[33^", - KeyF42: "\x1b[34^", - KeyF43: "\x1b[23@", - KeyF44: "\x1b[24@", - KeyHelp: "\x1b[28~", - KeyShfLeft: "\x1b[d", - KeyShfRight: "\x1b[c", - KeyShfUp: "\x1b[a", - KeyShfDown: "\x1b[b", - KeyCtrlLeft: "\x1b[Od", - KeyCtrlRight: "\x1b[Oc", - KeyCtrlUp: "\x1b[Oa", - KeyCtrlDown: "\x1b[Ob", - KeyShfHome: "\x1b[7$", - KeyShfEnd: "\x1b[8$", - KeyCtrlHome: "\x1b[7^", - KeyCtrlEnd: "\x1b[8^", - }) - - // Eterm with 88 colors - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "Eterm-88color", - Columns: 80, - Lines: 24, - Colors: 88, - Bell: "\a", - Clear: "\x1b[H\x1b[2J", - EnterCA: "\x1b7\x1b[?47h", - ExitCA: "\x1b[2J\x1b[?47l\x1b8", - ShowCursor: "\x1b[?25h", - HideCursor: "\x1b[?25l", - AttrOff: "\x1b[m\x0f", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - SetFg: "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m", - SetBg: "\x1b[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m", - SetFgBg: "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;;%?%p2%{8}%<%t4%p2%d%e%p2%{16}%<%t10%p2%{8}%-%d%e48;5;%p2%d%;m", - PadChar: "\x00", - AltChars: "``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x0e", - ExitAcs: "\x0f", - EnableAcs: "\x1b)0", - Mouse: "\x1b[M", - MouseMode: "%?%p1%{1}%=%t%'h'%Pa%e%'l'%Pa%;\x1b[?1000%ga%c\x1b[?1002%ga%c\x1b[?1003%ga%c\x1b[?1006%ga%c", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1b[A", - KeyDown: "\x1b[B", - KeyRight: "\x1b[C", - KeyLeft: "\x1b[D", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\xff", - KeyHome: "\x1b[7~", - KeyEnd: "\x1b[8~", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1b[11~", - KeyF2: "\x1b[12~", - KeyF3: "\x1b[13~", - KeyF4: "\x1b[14~", - KeyF5: "\x1b[15~", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyF13: "\x1b[25~", - KeyF14: "\x1b[26~", - KeyF15: "\x1b[28~", - KeyF16: "\x1b[29~", - KeyF17: "\x1b[31~", - KeyF18: "\x1b[32~", - KeyF19: "\x1b[33~", - KeyF20: "\x1b[34~", - KeyF21: "\x1b[23$", - KeyF22: "\x1b[24$", - KeyF23: "\x1b[11^", - KeyF24: "\x1b[12^", - KeyF25: "\x1b[13^", - KeyF26: "\x1b[14^", - KeyF27: "\x1b[15^", - KeyF28: "\x1b[17^", - KeyF29: "\x1b[18^", - KeyF30: "\x1b[19^", - KeyF31: "\x1b[20^", - KeyF32: "\x1b[21^", - KeyF33: "\x1b[23^", - KeyF34: "\x1b[24^", - KeyF35: "\x1b[25^", - KeyF36: "\x1b[26^", - KeyF37: "\x1b[28^", - KeyF38: "\x1b[29^", - KeyF39: "\x1b[31^", - KeyF40: "\x1b[32^", - KeyF41: "\x1b[33^", - KeyF42: "\x1b[34^", - KeyF43: "\x1b[23@", - KeyF44: "\x1b[24@", - KeyHelp: "\x1b[28~", - KeyShfLeft: "\x1b[d", - KeyShfRight: "\x1b[c", - KeyShfUp: "\x1b[a", - KeyShfDown: "\x1b[b", - KeyCtrlLeft: "\x1b[Od", - KeyCtrlRight: "\x1b[Oc", - KeyCtrlUp: "\x1b[Oa", - KeyCtrlDown: "\x1b[Ob", - KeyShfHome: "\x1b[7$", - KeyShfEnd: "\x1b[8$", - KeyCtrlHome: "\x1b[7^", - KeyCtrlEnd: "\x1b[8^", - }) - - // Eterm with xterm 256-colors - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "Eterm-256color", - Columns: 80, - Lines: 24, - Colors: 256, - Bell: "\a", - Clear: "\x1b[H\x1b[2J", - EnterCA: "\x1b7\x1b[?47h", - ExitCA: "\x1b[2J\x1b[?47l\x1b8", - ShowCursor: "\x1b[?25h", - HideCursor: "\x1b[?25l", - AttrOff: "\x1b[m\x0f", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - SetFg: "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m", - SetBg: "\x1b[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m", - SetFgBg: "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;;%?%p2%{8}%<%t4%p2%d%e%p2%{16}%<%t10%p2%{8}%-%d%e48;5;%p2%d%;m", - PadChar: "\x00", - AltChars: "``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x0e", - ExitAcs: "\x0f", - EnableAcs: "\x1b)0", - Mouse: "\x1b[M", - MouseMode: "%?%p1%{1}%=%t%'h'%Pa%e%'l'%Pa%;\x1b[?1000%ga%c\x1b[?1002%ga%c\x1b[?1003%ga%c\x1b[?1006%ga%c", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1b[A", - KeyDown: "\x1b[B", - KeyRight: "\x1b[C", - KeyLeft: "\x1b[D", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\xff", - KeyHome: "\x1b[7~", - KeyEnd: "\x1b[8~", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1b[11~", - KeyF2: "\x1b[12~", - KeyF3: "\x1b[13~", - KeyF4: "\x1b[14~", - KeyF5: "\x1b[15~", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyF13: "\x1b[25~", - KeyF14: "\x1b[26~", - KeyF15: "\x1b[28~", - KeyF16: "\x1b[29~", - KeyF17: "\x1b[31~", - KeyF18: "\x1b[32~", - KeyF19: "\x1b[33~", - KeyF20: "\x1b[34~", - KeyF21: "\x1b[23$", - KeyF22: "\x1b[24$", - KeyF23: "\x1b[11^", - KeyF24: "\x1b[12^", - KeyF25: "\x1b[13^", - KeyF26: "\x1b[14^", - KeyF27: "\x1b[15^", - KeyF28: "\x1b[17^", - KeyF29: "\x1b[18^", - KeyF30: "\x1b[19^", - KeyF31: "\x1b[20^", - KeyF32: "\x1b[21^", - KeyF33: "\x1b[23^", - KeyF34: "\x1b[24^", - KeyF35: "\x1b[25^", - KeyF36: "\x1b[26^", - KeyF37: "\x1b[28^", - KeyF38: "\x1b[29^", - KeyF39: "\x1b[31^", - KeyF40: "\x1b[32^", - KeyF41: "\x1b[33^", - KeyF42: "\x1b[34^", - KeyF43: "\x1b[23@", - KeyF44: "\x1b[24@", - KeyHelp: "\x1b[28~", - KeyShfLeft: "\x1b[d", - KeyShfRight: "\x1b[c", - KeyShfUp: "\x1b[a", - KeyShfDown: "\x1b[b", - KeyCtrlLeft: "\x1b[Od", - KeyCtrlRight: "\x1b[Oc", - KeyCtrlUp: "\x1b[Oa", - KeyCtrlDown: "\x1b[Ob", - KeyShfHome: "\x1b[7$", - KeyShfEnd: "\x1b[8$", - KeyCtrlHome: "\x1b[7^", - KeyCtrlEnd: "\x1b[8^", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/extended/extended.go b/vendor/github.com/gdamore/tcell/terminfo/extended/extended.go deleted file mode 100644 index cc0af120..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/extended/extended.go +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2019 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package extended contains an extended set of terminal descriptions. -// Applications desiring to have a better chance of Just Working by -// default should include this package. This will significantly increase -// the size of the program. -package extended - -import ( - // The following imports just register themselves -- - // these are the terminal types we aggregate in this package. - _ "github.com/gdamore/tcell/terminfo/a/adm3a" - _ "github.com/gdamore/tcell/terminfo/a/aixterm" - _ "github.com/gdamore/tcell/terminfo/a/alacritty" - _ "github.com/gdamore/tcell/terminfo/a/ansi" - _ "github.com/gdamore/tcell/terminfo/a/aterm" - _ "github.com/gdamore/tcell/terminfo/b/beterm" - _ "github.com/gdamore/tcell/terminfo/b/bsdos_pc" - _ "github.com/gdamore/tcell/terminfo/c/cygwin" - _ "github.com/gdamore/tcell/terminfo/d/d200" - _ "github.com/gdamore/tcell/terminfo/d/d210" - _ "github.com/gdamore/tcell/terminfo/d/dtterm" - _ "github.com/gdamore/tcell/terminfo/e/emacs" - _ "github.com/gdamore/tcell/terminfo/e/eterm" - _ "github.com/gdamore/tcell/terminfo/g/gnome" - _ "github.com/gdamore/tcell/terminfo/h/hpterm" - _ "github.com/gdamore/tcell/terminfo/h/hz1500" - _ "github.com/gdamore/tcell/terminfo/k/konsole" - _ "github.com/gdamore/tcell/terminfo/k/kterm" - _ "github.com/gdamore/tcell/terminfo/l/linux" - _ "github.com/gdamore/tcell/terminfo/p/pcansi" - _ "github.com/gdamore/tcell/terminfo/r/rxvt" - _ "github.com/gdamore/tcell/terminfo/s/screen" - _ "github.com/gdamore/tcell/terminfo/s/simpleterm" - _ "github.com/gdamore/tcell/terminfo/s/sun" - _ "github.com/gdamore/tcell/terminfo/t/termite" - _ "github.com/gdamore/tcell/terminfo/t/tvi910" - _ "github.com/gdamore/tcell/terminfo/t/tvi912" - _ "github.com/gdamore/tcell/terminfo/t/tvi921" - _ "github.com/gdamore/tcell/terminfo/t/tvi925" - _ "github.com/gdamore/tcell/terminfo/t/tvi950" - _ "github.com/gdamore/tcell/terminfo/t/tvi970" - _ "github.com/gdamore/tcell/terminfo/v/vt100" - _ "github.com/gdamore/tcell/terminfo/v/vt102" - _ "github.com/gdamore/tcell/terminfo/v/vt220" - _ "github.com/gdamore/tcell/terminfo/v/vt320" - _ "github.com/gdamore/tcell/terminfo/v/vt400" - _ "github.com/gdamore/tcell/terminfo/v/vt420" - _ "github.com/gdamore/tcell/terminfo/v/vt52" - _ "github.com/gdamore/tcell/terminfo/w/wy50" - _ "github.com/gdamore/tcell/terminfo/w/wy60" - _ "github.com/gdamore/tcell/terminfo/w/wy99_ansi" - _ "github.com/gdamore/tcell/terminfo/x/xfce" - _ "github.com/gdamore/tcell/terminfo/x/xnuppc" - _ "github.com/gdamore/tcell/terminfo/x/xterm" - _ "github.com/gdamore/tcell/terminfo/x/xterm_kitty" -) diff --git a/vendor/github.com/gdamore/tcell/terminfo/g/gnome/term.go b/vendor/github.com/gdamore/tcell/terminfo/g/gnome/term.go deleted file mode 100644 index 08b913eb..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/g/gnome/term.go +++ /dev/null @@ -1,306 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package gnome - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // GNOME Terminal - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "gnome", - Columns: 80, - Lines: 24, - Colors: 8, - Bell: "\a", - Clear: "\x1b[H\x1b[2J", - EnterCA: "\x1b7\x1b[?47h", - ExitCA: "\x1b[2J\x1b[?47l\x1b8", - ShowCursor: "\x1b[?25h", - HideCursor: "\x1b[?25l", - AttrOff: "\x1b[0m\x0f", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Dim: "\x1b[2m", - Reverse: "\x1b[7m", - EnterKeypad: "\x1b[?1h\x1b=", - ExitKeypad: "\x1b[?1l\x1b>", - SetFg: "\x1b[3%p1%dm", - SetBg: "\x1b[4%p1%dm", - SetFgBg: "\x1b[3%p1%d;4%p2%dm", - PadChar: "\x00", - AltChars: "``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x0e", - ExitAcs: "\x0f", - EnableAcs: "\x1b)0", - Mouse: "\x1b[M", - MouseMode: "%?%p1%{1}%=%t%'h'%Pa%e%'l'%Pa%;\x1b[?1000%ga%c\x1b[?1002%ga%c\x1b[?1003%ga%c\x1b[?1006%ga%c", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1bOA", - KeyDown: "\x1bOB", - KeyRight: "\x1bOC", - KeyLeft: "\x1bOD", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\xff", - KeyHome: "\x1bOH", - KeyEnd: "\x1bOF", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1bOP", - KeyF2: "\x1bOQ", - KeyF3: "\x1bOR", - KeyF4: "\x1bOS", - KeyF5: "\x1b[15~", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyF13: "\x1bO1;2P", - KeyF14: "\x1bO1;2Q", - KeyF15: "\x1bO1;2R", - KeyF16: "\x1bO1;2S", - KeyF17: "\x1b[15;2~", - KeyF18: "\x1b[17;2~", - KeyF19: "\x1b[18;2~", - KeyF20: "\x1b[19;2~", - KeyF21: "\x1b[20;2~", - KeyF22: "\x1b[21;2~", - KeyF23: "\x1b[23;2~", - KeyF24: "\x1b[24;2~", - KeyF25: "\x1bO1;5P", - KeyF26: "\x1bO1;5Q", - KeyF27: "\x1bO1;5R", - KeyF28: "\x1bO1;5S", - KeyF29: "\x1b[15;5~", - KeyF30: "\x1b[17;5~", - KeyF31: "\x1b[18;5~", - KeyF32: "\x1b[19;5~", - KeyF33: "\x1b[20;5~", - KeyF34: "\x1b[21;5~", - KeyF35: "\x1b[23;5~", - KeyF36: "\x1b[24;5~", - KeyF37: "\x1bO1;6P", - KeyF38: "\x1bO1;6Q", - KeyF39: "\x1bO1;6R", - KeyF40: "\x1bO1;6S", - KeyF41: "\x1b[15;6~", - KeyF42: "\x1b[17;6~", - KeyF43: "\x1b[18;6~", - KeyF44: "\x1b[19;6~", - KeyF45: "\x1b[20;6~", - KeyF46: "\x1b[21;6~", - KeyF47: "\x1b[23;6~", - KeyF48: "\x1b[24;6~", - KeyF49: "\x1bO1;3P", - KeyF50: "\x1bO1;3Q", - KeyF51: "\x1bO1;3R", - KeyF52: "\x1bO1;3S", - KeyF53: "\x1b[15;3~", - KeyF54: "\x1b[17;3~", - KeyF55: "\x1b[18;3~", - KeyF56: "\x1b[19;3~", - KeyF57: "\x1b[20;3~", - KeyF58: "\x1b[21;3~", - KeyF59: "\x1b[23;3~", - KeyF60: "\x1b[24;3~", - KeyF61: "\x1bO1;4P", - KeyF62: "\x1bO1;4Q", - KeyF63: "\x1bO1;4R", - KeyBacktab: "\x1b[Z", - KeyShfLeft: "\x1b[1;2D", - KeyShfRight: "\x1b[1;2C", - KeyShfUp: "\x1b[1;2A", - KeyShfDown: "\x1b[1;2B", - KeyCtrlLeft: "\x1b[1;5D", - KeyCtrlRight: "\x1b[1;5C", - KeyCtrlUp: "\x1b[1;5A", - KeyCtrlDown: "\x1b[1;5B", - KeyMetaLeft: "\x1b[1;9D", - KeyMetaRight: "\x1b[1;9C", - KeyMetaUp: "\x1b[1;9A", - KeyMetaDown: "\x1b[1;9B", - KeyAltLeft: "\x1b[1;3D", - KeyAltRight: "\x1b[1;3C", - KeyAltUp: "\x1b[1;3A", - KeyAltDown: "\x1b[1;3B", - KeyAltShfLeft: "\x1b[1;4D", - KeyAltShfRight: "\x1b[1;4C", - KeyAltShfUp: "\x1b[1;4A", - KeyAltShfDown: "\x1b[1;4B", - KeyMetaShfLeft: "\x1b[1;10D", - KeyMetaShfRight: "\x1b[1;10C", - KeyMetaShfUp: "\x1b[1;10A", - KeyMetaShfDown: "\x1b[1;10B", - KeyCtrlShfLeft: "\x1b[1;6D", - KeyCtrlShfRight: "\x1b[1;6C", - KeyCtrlShfUp: "\x1b[1;6A", - KeyCtrlShfDown: "\x1b[1;6B", - KeyShfHome: "\x1b[1;2H", - KeyShfEnd: "\x1b[1;2F", - KeyCtrlHome: "\x1b[1;5H", - KeyCtrlEnd: "\x1b[1;5F", - KeyAltHome: "\x1b[1;9H", - KeyAltEnd: "\x1b[1;9F", - KeyCtrlShfHome: "\x1b[1;6H", - KeyCtrlShfEnd: "\x1b[1;6F", - KeyMetaShfHome: "\x1b[1;10H", - KeyMetaShfEnd: "\x1b[1;10F", - KeyAltShfHome: "\x1b[1;4H", - KeyAltShfEnd: "\x1b[1;4F", - }) - - // GNOME Terminal with xterm 256-colors - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "gnome-256color", - Columns: 80, - Lines: 24, - Colors: 256, - Bell: "\a", - Clear: "\x1b[H\x1b[2J", - EnterCA: "\x1b7\x1b[?47h", - ExitCA: "\x1b[2J\x1b[?47l\x1b8", - ShowCursor: "\x1b[?25h", - HideCursor: "\x1b[?25l", - AttrOff: "\x1b[0m\x0f", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Dim: "\x1b[2m", - Reverse: "\x1b[7m", - EnterKeypad: "\x1b[?1h\x1b=", - ExitKeypad: "\x1b[?1l\x1b>", - SetFg: "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m", - SetBg: "\x1b[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m", - SetFgBg: "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;;%?%p2%{8}%<%t4%p2%d%e%p2%{16}%<%t10%p2%{8}%-%d%e48;5;%p2%d%;m", - PadChar: "\x00", - AltChars: "``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x0e", - ExitAcs: "\x0f", - EnableAcs: "\x1b)0", - Mouse: "\x1b[<", - MouseMode: "%?%p1%{1}%=%t%'h'%Pa%e%'l'%Pa%;\x1b[?1000%ga%c\x1b[?1002%ga%c\x1b[?1003%ga%c\x1b[?1006%ga%c", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1bOA", - KeyDown: "\x1bOB", - KeyRight: "\x1bOC", - KeyLeft: "\x1bOD", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\xff", - KeyHome: "\x1bOH", - KeyEnd: "\x1bOF", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1bOP", - KeyF2: "\x1bOQ", - KeyF3: "\x1bOR", - KeyF4: "\x1bOS", - KeyF5: "\x1b[15~", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyF13: "\x1b[1;2P", - KeyF14: "\x1b[1;2Q", - KeyF15: "\x1b[1;2R", - KeyF16: "\x1b[1;2S", - KeyF17: "\x1b[15;2~", - KeyF18: "\x1b[17;2~", - KeyF19: "\x1b[18;2~", - KeyF20: "\x1b[19;2~", - KeyF21: "\x1b[20;2~", - KeyF22: "\x1b[21;2~", - KeyF23: "\x1b[23;2~", - KeyF24: "\x1b[24;2~", - KeyF25: "\x1b[1;5P", - KeyF26: "\x1b[1;5Q", - KeyF27: "\x1b[1;5R", - KeyF28: "\x1b[1;5S", - KeyF29: "\x1b[15;5~", - KeyF30: "\x1b[17;5~", - KeyF31: "\x1b[18;5~", - KeyF32: "\x1b[19;5~", - KeyF33: "\x1b[20;5~", - KeyF34: "\x1b[21;5~", - KeyF35: "\x1b[23;5~", - KeyF36: "\x1b[24;5~", - KeyF37: "\x1b[1;6P", - KeyF38: "\x1b[1;6Q", - KeyF39: "\x1b[1;6R", - KeyF40: "\x1b[1;6S", - KeyF41: "\x1b[15;6~", - KeyF42: "\x1b[17;6~", - KeyF43: "\x1b[18;6~", - KeyF44: "\x1b[19;6~", - KeyF45: "\x1b[20;6~", - KeyF46: "\x1b[21;6~", - KeyF47: "\x1b[23;6~", - KeyF48: "\x1b[24;6~", - KeyF49: "\x1b[1;3P", - KeyF50: "\x1b[1;3Q", - KeyF51: "\x1b[1;3R", - KeyF52: "\x1b[1;3S", - KeyF53: "\x1b[15;3~", - KeyF54: "\x1b[17;3~", - KeyF55: "\x1b[18;3~", - KeyF56: "\x1b[19;3~", - KeyF57: "\x1b[20;3~", - KeyF58: "\x1b[21;3~", - KeyF59: "\x1b[23;3~", - KeyF60: "\x1b[24;3~", - KeyF61: "\x1b[1;4P", - KeyF62: "\x1b[1;4Q", - KeyF63: "\x1b[1;4R", - KeyBacktab: "\x1b[Z", - KeyShfLeft: "\x1b[1;2D", - KeyShfRight: "\x1b[1;2C", - KeyShfUp: "\x1b[1;2A", - KeyShfDown: "\x1b[1;2B", - KeyCtrlLeft: "\x1b[1;5D", - KeyCtrlRight: "\x1b[1;5C", - KeyCtrlUp: "\x1b[1;5A", - KeyCtrlDown: "\x1b[1;5B", - KeyMetaLeft: "\x1b[1;9D", - KeyMetaRight: "\x1b[1;9C", - KeyMetaUp: "\x1b[1;9A", - KeyMetaDown: "\x1b[1;9B", - KeyAltLeft: "\x1b[1;3D", - KeyAltRight: "\x1b[1;3C", - KeyAltUp: "\x1b[1;3A", - KeyAltDown: "\x1b[1;3B", - KeyAltShfLeft: "\x1b[1;4D", - KeyAltShfRight: "\x1b[1;4C", - KeyAltShfUp: "\x1b[1;4A", - KeyAltShfDown: "\x1b[1;4B", - KeyMetaShfLeft: "\x1b[1;10D", - KeyMetaShfRight: "\x1b[1;10C", - KeyMetaShfUp: "\x1b[1;10A", - KeyMetaShfDown: "\x1b[1;10B", - KeyCtrlShfLeft: "\x1b[1;6D", - KeyCtrlShfRight: "\x1b[1;6C", - KeyCtrlShfUp: "\x1b[1;6A", - KeyCtrlShfDown: "\x1b[1;6B", - KeyShfHome: "\x1b[1;2H", - KeyShfEnd: "\x1b[1;2F", - KeyCtrlHome: "\x1b[1;5H", - KeyCtrlEnd: "\x1b[1;5F", - KeyAltHome: "\x1b[1;9H", - KeyAltEnd: "\x1b[1;9F", - KeyCtrlShfHome: "\x1b[1;6H", - KeyCtrlShfEnd: "\x1b[1;6F", - KeyMetaShfHome: "\x1b[1;10H", - KeyMetaShfEnd: "\x1b[1;10F", - KeyAltShfHome: "\x1b[1;4H", - KeyAltShfEnd: "\x1b[1;4F", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/gen.sh b/vendor/github.com/gdamore/tcell/terminfo/gen.sh deleted file mode 100644 index 2fc06112..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/gen.sh +++ /dev/null @@ -1,18 +0,0 @@ -while read line -do - case "$line" in - *'|'*) - alias=${line#*|} - line=${line%|*} - ;; - *) - alias=${line%%,*} - ;; - esac - - alias=${alias//-/_} - direc=${alias:0:1} - - mkdir -p ${direc}/${alias} - go run mkinfo.go -P ${alias} -go ${direc}/${alias}/term.go ${line//,/ } -done < models.txt diff --git a/vendor/github.com/gdamore/tcell/terminfo/h/hpterm/term.go b/vendor/github.com/gdamore/tcell/terminfo/h/hpterm/term.go deleted file mode 100644 index 5e73e044..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/h/hpterm/term.go +++ /dev/null @@ -1,50 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package hpterm - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // hp X11 terminal emulator - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "hpterm", - Aliases: []string{"X-hpterm"}, - Columns: 80, - Lines: 24, - Bell: "\a", - Clear: "\x1b&a0y0C\x1bJ", - AttrOff: "\x1b&d@\x0f", - Underline: "\x1b&dD", - Bold: "\x1b&dB", - Dim: "\x1b&dH", - Reverse: "\x1b&dB", - EnterKeypad: "\x1b&s1A", - ExitKeypad: "\x1b&s0A", - PadChar: "\x00", - EnterAcs: "\x0e", - ExitAcs: "\x0f", - SetCursor: "\x1b&a%p1%dy%p2%dC", - CursorBack1: "\b", - CursorUp1: "\x1bA", - KeyUp: "\x1bA", - KeyDown: "\x1bB", - KeyRight: "\x1bC", - KeyLeft: "\x1bD", - KeyInsert: "\x1bQ", - KeyDelete: "\x1bP", - KeyBackspace: "\b", - KeyHome: "\x1bh", - KeyPgUp: "\x1bV", - KeyPgDn: "\x1bU", - KeyF1: "\x1bp", - KeyF2: "\x1bq", - KeyF3: "\x1br", - KeyF4: "\x1bs", - KeyF5: "\x1bt", - KeyF6: "\x1bu", - KeyF7: "\x1bv", - KeyF8: "\x1bw", - KeyClear: "\x1bJ", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/h/hz1500/term.go b/vendor/github.com/gdamore/tcell/terminfo/h/hz1500/term.go deleted file mode 100644 index 3ad18109..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/h/hz1500/term.go +++ /dev/null @@ -1,26 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package hz1500 - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // hazeltine 1500 - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "hz1500", - Columns: 80, - Lines: 24, - Bell: "\a", - Clear: "~\x1c", - PadChar: "\x00", - SetCursor: "~\x11%p2%p2%?%{30}%>%t%' '%+%;%'`'%+%c%p1%'`'%+%c", - CursorBack1: "\b", - CursorUp1: "~\f", - KeyUp: "~\f", - KeyDown: "\n", - KeyRight: "\x10", - KeyLeft: "\b", - KeyHome: "~\x12", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/k/konsole/term.go b/vendor/github.com/gdamore/tcell/terminfo/k/konsole/term.go deleted file mode 100644 index 21cd72ae..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/k/konsole/term.go +++ /dev/null @@ -1,304 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package konsole - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // KDE console window - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "konsole", - Columns: 80, - Lines: 24, - Colors: 8, - Clear: "\x1b[H\x1b[2J", - EnterCA: "\x1b7\x1b[?47h", - ExitCA: "\x1b[2J\x1b[?47l\x1b8", - ShowCursor: "\x1b[?25h", - HideCursor: "\x1b[?25l", - AttrOff: "\x1b[0m\x0f", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Dim: "\x1b[2m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - EnterKeypad: "\x1b[?1h\x1b=", - ExitKeypad: "\x1b[?1l\x1b>", - SetFg: "\x1b[3%p1%dm", - SetBg: "\x1b[4%p1%dm", - SetFgBg: "\x1b[3%p1%d;4%p2%dm", - AltChars: "``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x0e", - ExitAcs: "\x0f", - EnableAcs: "\x1b)0", - Mouse: "\x1b[M", - MouseMode: "%?%p1%{1}%=%t%'h'%Pa%e%'l'%Pa%;\x1b[?1000%ga%c\x1b[?1002%ga%c\x1b[?1003%ga%c\x1b[?1006%ga%c", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1bOA", - KeyDown: "\x1bOB", - KeyRight: "\x1bOC", - KeyLeft: "\x1bOD", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\xff", - KeyHome: "\x1bOH", - KeyEnd: "\x1bOF", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1bOP", - KeyF2: "\x1bOQ", - KeyF3: "\x1bOR", - KeyF4: "\x1bOS", - KeyF5: "\x1b[15~", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyF13: "\x1bO2P", - KeyF14: "\x1bO2Q", - KeyF15: "\x1bO2R", - KeyF16: "\x1bO2S", - KeyF17: "\x1b[15;2~", - KeyF18: "\x1b[17;2~", - KeyF19: "\x1b[18;2~", - KeyF20: "\x1b[19;2~", - KeyF21: "\x1b[20;2~", - KeyF22: "\x1b[21;2~", - KeyF23: "\x1b[23;2~", - KeyF24: "\x1b[24;2~", - KeyF25: "\x1bO5P", - KeyF26: "\x1bO5Q", - KeyF27: "\x1bO5R", - KeyF28: "\x1bO5S", - KeyF29: "\x1b[15;5~", - KeyF30: "\x1b[17;5~", - KeyF31: "\x1b[18;5~", - KeyF32: "\x1b[19;5~", - KeyF33: "\x1b[20;5~", - KeyF34: "\x1b[21;5~", - KeyF35: "\x1b[23;5~", - KeyF36: "\x1b[24;5~", - KeyF37: "\x1bO6P", - KeyF38: "\x1bO6Q", - KeyF39: "\x1bO6R", - KeyF40: "\x1bO6S", - KeyF41: "\x1b[15;6~", - KeyF42: "\x1b[17;6~", - KeyF43: "\x1b[18;6~", - KeyF44: "\x1b[19;6~", - KeyF45: "\x1b[20;6~", - KeyF46: "\x1b[21;6~", - KeyF47: "\x1b[23;6~", - KeyF48: "\x1b[24;6~", - KeyF49: "\x1bO3P", - KeyF50: "\x1bO3Q", - KeyF51: "\x1bO3R", - KeyF52: "\x1bO3S", - KeyF53: "\x1b[15;3~", - KeyF54: "\x1b[17;3~", - KeyF55: "\x1b[18;3~", - KeyF56: "\x1b[19;3~", - KeyF57: "\x1b[20;3~", - KeyF58: "\x1b[21;3~", - KeyF59: "\x1b[23;3~", - KeyF60: "\x1b[24;3~", - KeyF61: "\x1bO4P", - KeyF62: "\x1bO4Q", - KeyF63: "\x1bO4R", - KeyBacktab: "\x1b[Z", - KeyShfLeft: "\x1b[1;2D", - KeyShfRight: "\x1b[1;2C", - KeyShfUp: "\x1b[1;2A", - KeyShfDown: "\x1b[1;2B", - KeyCtrlLeft: "\x1b[1;5D", - KeyCtrlRight: "\x1b[1;5C", - KeyCtrlUp: "\x1b[1;5A", - KeyCtrlDown: "\x1b[1;5B", - KeyMetaLeft: "\x1b[1;9D", - KeyMetaRight: "\x1b[1;9C", - KeyMetaUp: "\x1b[1;9A", - KeyMetaDown: "\x1b[1;9B", - KeyAltLeft: "\x1b[1;3D", - KeyAltRight: "\x1b[1;3C", - KeyAltUp: "\x1b[1;3A", - KeyAltDown: "\x1b[1;3B", - KeyAltShfLeft: "\x1b[1;4D", - KeyAltShfRight: "\x1b[1;4C", - KeyAltShfUp: "\x1b[1;4A", - KeyAltShfDown: "\x1b[1;4B", - KeyMetaShfLeft: "\x1b[1;10D", - KeyMetaShfRight: "\x1b[1;10C", - KeyMetaShfUp: "\x1b[1;10A", - KeyMetaShfDown: "\x1b[1;10B", - KeyCtrlShfLeft: "\x1b[1;6D", - KeyCtrlShfRight: "\x1b[1;6C", - KeyCtrlShfUp: "\x1b[1;6A", - KeyCtrlShfDown: "\x1b[1;6B", - KeyShfHome: "\x1b[1;2H", - KeyShfEnd: "\x1b[1;2F", - KeyCtrlHome: "\x1b[1;5H", - KeyCtrlEnd: "\x1b[1;5F", - KeyAltHome: "\x1b[1;9H", - KeyAltEnd: "\x1b[1;9F", - KeyCtrlShfHome: "\x1b[1;6H", - KeyCtrlShfEnd: "\x1b[1;6F", - KeyMetaShfHome: "\x1b[1;10H", - KeyMetaShfEnd: "\x1b[1;10F", - KeyAltShfHome: "\x1b[1;4H", - KeyAltShfEnd: "\x1b[1;4F", - }) - - // KDE console window with xterm 256-colors - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "konsole-256color", - Columns: 80, - Lines: 24, - Colors: 256, - Clear: "\x1b[H\x1b[2J", - EnterCA: "\x1b7\x1b[?47h", - ExitCA: "\x1b[2J\x1b[?47l\x1b8", - ShowCursor: "\x1b[?25h", - HideCursor: "\x1b[?25l", - AttrOff: "\x1b[0m\x0f", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Dim: "\x1b[2m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - EnterKeypad: "\x1b[?1h\x1b=", - ExitKeypad: "\x1b[?1l\x1b>", - SetFg: "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m", - SetBg: "\x1b[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m", - SetFgBg: "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;;%?%p2%{8}%<%t4%p2%d%e%p2%{16}%<%t10%p2%{8}%-%d%e48;5;%p2%d%;m", - AltChars: "``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x0e", - ExitAcs: "\x0f", - EnableAcs: "\x1b)0", - Mouse: "\x1b[M", - MouseMode: "%?%p1%{1}%=%t%'h'%Pa%e%'l'%Pa%;\x1b[?1000%ga%c\x1b[?1002%ga%c\x1b[?1003%ga%c\x1b[?1006%ga%c", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1bOA", - KeyDown: "\x1bOB", - KeyRight: "\x1bOC", - KeyLeft: "\x1bOD", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\xff", - KeyHome: "\x1bOH", - KeyEnd: "\x1bOF", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1bOP", - KeyF2: "\x1bOQ", - KeyF3: "\x1bOR", - KeyF4: "\x1bOS", - KeyF5: "\x1b[15~", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyF13: "\x1bO2P", - KeyF14: "\x1bO2Q", - KeyF15: "\x1bO2R", - KeyF16: "\x1bO2S", - KeyF17: "\x1b[15;2~", - KeyF18: "\x1b[17;2~", - KeyF19: "\x1b[18;2~", - KeyF20: "\x1b[19;2~", - KeyF21: "\x1b[20;2~", - KeyF22: "\x1b[21;2~", - KeyF23: "\x1b[23;2~", - KeyF24: "\x1b[24;2~", - KeyF25: "\x1bO5P", - KeyF26: "\x1bO5Q", - KeyF27: "\x1bO5R", - KeyF28: "\x1bO5S", - KeyF29: "\x1b[15;5~", - KeyF30: "\x1b[17;5~", - KeyF31: "\x1b[18;5~", - KeyF32: "\x1b[19;5~", - KeyF33: "\x1b[20;5~", - KeyF34: "\x1b[21;5~", - KeyF35: "\x1b[23;5~", - KeyF36: "\x1b[24;5~", - KeyF37: "\x1bO6P", - KeyF38: "\x1bO6Q", - KeyF39: "\x1bO6R", - KeyF40: "\x1bO6S", - KeyF41: "\x1b[15;6~", - KeyF42: "\x1b[17;6~", - KeyF43: "\x1b[18;6~", - KeyF44: "\x1b[19;6~", - KeyF45: "\x1b[20;6~", - KeyF46: "\x1b[21;6~", - KeyF47: "\x1b[23;6~", - KeyF48: "\x1b[24;6~", - KeyF49: "\x1bO3P", - KeyF50: "\x1bO3Q", - KeyF51: "\x1bO3R", - KeyF52: "\x1bO3S", - KeyF53: "\x1b[15;3~", - KeyF54: "\x1b[17;3~", - KeyF55: "\x1b[18;3~", - KeyF56: "\x1b[19;3~", - KeyF57: "\x1b[20;3~", - KeyF58: "\x1b[21;3~", - KeyF59: "\x1b[23;3~", - KeyF60: "\x1b[24;3~", - KeyF61: "\x1bO4P", - KeyF62: "\x1bO4Q", - KeyF63: "\x1bO4R", - KeyBacktab: "\x1b[Z", - KeyShfLeft: "\x1b[1;2D", - KeyShfRight: "\x1b[1;2C", - KeyShfUp: "\x1b[1;2A", - KeyShfDown: "\x1b[1;2B", - KeyCtrlLeft: "\x1b[1;5D", - KeyCtrlRight: "\x1b[1;5C", - KeyCtrlUp: "\x1b[1;5A", - KeyCtrlDown: "\x1b[1;5B", - KeyMetaLeft: "\x1b[1;9D", - KeyMetaRight: "\x1b[1;9C", - KeyMetaUp: "\x1b[1;9A", - KeyMetaDown: "\x1b[1;9B", - KeyAltLeft: "\x1b[1;3D", - KeyAltRight: "\x1b[1;3C", - KeyAltUp: "\x1b[1;3A", - KeyAltDown: "\x1b[1;3B", - KeyAltShfLeft: "\x1b[1;4D", - KeyAltShfRight: "\x1b[1;4C", - KeyAltShfUp: "\x1b[1;4A", - KeyAltShfDown: "\x1b[1;4B", - KeyMetaShfLeft: "\x1b[1;10D", - KeyMetaShfRight: "\x1b[1;10C", - KeyMetaShfUp: "\x1b[1;10A", - KeyMetaShfDown: "\x1b[1;10B", - KeyCtrlShfLeft: "\x1b[1;6D", - KeyCtrlShfRight: "\x1b[1;6C", - KeyCtrlShfUp: "\x1b[1;6A", - KeyCtrlShfDown: "\x1b[1;6B", - KeyShfHome: "\x1b[1;2H", - KeyShfEnd: "\x1b[1;2F", - KeyCtrlHome: "\x1b[1;5H", - KeyCtrlEnd: "\x1b[1;5F", - KeyAltHome: "\x1b[1;9H", - KeyAltEnd: "\x1b[1;9F", - KeyCtrlShfHome: "\x1b[1;6H", - KeyCtrlShfEnd: "\x1b[1;6F", - KeyMetaShfHome: "\x1b[1;10H", - KeyMetaShfEnd: "\x1b[1;10F", - KeyAltShfHome: "\x1b[1;4H", - KeyAltShfEnd: "\x1b[1;4F", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/k/kterm/term.go b/vendor/github.com/gdamore/tcell/terminfo/k/kterm/term.go deleted file mode 100644 index f4478404..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/k/kterm/term.go +++ /dev/null @@ -1,67 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package kterm - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // kterm kanji terminal emulator (X window system) - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "kterm", - Columns: 80, - Lines: 24, - Colors: 8, - Bell: "\a", - Clear: "\x1b[H\x1b[2J", - EnterCA: "\x1b7\x1b[?47h", - ExitCA: "\x1b[2J\x1b[?47l\x1b8", - AttrOff: "\x1b[m\x1b(B", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Reverse: "\x1b[7m", - EnterKeypad: "\x1b[?1h\x1b=", - ExitKeypad: "\x1b[?1l\x1b>", - SetFg: "\x1b[3%p1%dm", - SetBg: "\x1b[4%p1%dm", - SetFgBg: "\x1b[3%p1%d;4%p2%dm", - PadChar: "\x00", - AltChars: "``aajjkkllmmnnooppqqrrssttuuvvwwxx~~", - EnterAcs: "\x1b(0", - ExitAcs: "\x1b(B", - Mouse: "\x1b[M", - MouseMode: "%?%p1%{1}%=%t%'h'%Pa%e%'l'%Pa%;\x1b[?1000%ga%c\x1b[?1002%ga%c\x1b[?1003%ga%c\x1b[?1006%ga%c", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1bOA", - KeyDown: "\x1bOB", - KeyRight: "\x1bOC", - KeyLeft: "\x1bOD", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\xff", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1b[11~", - KeyF2: "\x1b[12~", - KeyF3: "\x1b[13~", - KeyF4: "\x1b[14~", - KeyF5: "\x1b[15~", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyF13: "\x1b[25~", - KeyF14: "\x1b[26~", - KeyF15: "\x1b[28~", - KeyF16: "\x1b[29~", - KeyF17: "\x1b[31~", - KeyF18: "\x1b[32~", - KeyF19: "\x1b[33~", - KeyF20: "\x1b[34~", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/l/linux/term.go b/vendor/github.com/gdamore/tcell/terminfo/l/linux/term.go deleted file mode 100644 index 1702c363..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/l/linux/term.go +++ /dev/null @@ -1,69 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package linux - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // linux console - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "linux", - Colors: 8, - Bell: "\a", - Clear: "\x1b[H\x1b[J", - ShowCursor: "\x1b[?25h\x1b[?0c", - HideCursor: "\x1b[?25l\x1b[?1c", - AttrOff: "\x1b[m\x0f", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Dim: "\x1b[2m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - SetFg: "\x1b[3%p1%dm", - SetBg: "\x1b[4%p1%dm", - SetFgBg: "\x1b[3%p1%d;4%p2%dm", - PadChar: "\x00", - AltChars: "++,,--..00__``aaffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}c~~", - EnterAcs: "\x0e", - ExitAcs: "\x0f", - EnableAcs: "\x1b)0", - Mouse: "\x1b[M", - MouseMode: "%?%p1%{1}%=%t%'h'%Pa%e%'l'%Pa%;\x1b[?1000%ga%c\x1b[?1002%ga%c\x1b[?1003%ga%c\x1b[?1006%ga%c", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1b[A", - KeyDown: "\x1b[B", - KeyRight: "\x1b[C", - KeyLeft: "\x1b[D", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\xff", - KeyHome: "\x1b[1~", - KeyEnd: "\x1b[4~", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1b[[A", - KeyF2: "\x1b[[B", - KeyF3: "\x1b[[C", - KeyF4: "\x1b[[D", - KeyF5: "\x1b[[E", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyF13: "\x1b[25~", - KeyF14: "\x1b[26~", - KeyF15: "\x1b[28~", - KeyF16: "\x1b[29~", - KeyF17: "\x1b[31~", - KeyF18: "\x1b[32~", - KeyF19: "\x1b[33~", - KeyF20: "\x1b[34~", - KeyBacktab: "\x1b[Z", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/models.txt b/vendor/github.com/gdamore/tcell/terminfo/models.txt deleted file mode 100644 index 7ed2adb7..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/models.txt +++ /dev/null @@ -1,43 +0,0 @@ -adm3a -aixterm -ansi -aterm -beterm -bsdos-pc -cygwin -d200 -d210 -dtterm -eterm,eterm-color|emacs -Eterm,Eterm-88color,Eterm-256color|eterm -gnome,gnome-256color -hpterm -hz1500 -konsole,konsole-256color -kterm -linux -pcansi -rxvt,rxvt-256color,rxvt-88color,rxvt-unicode,rxvt-unicode-256color -screen,screen-256color -st,st-256color|simpleterm -sun,sun-color -termite -tvi910 -tvi912 -tvi921 -tvi925 -tvi950 -tvi970 -vt52 -vt100 -vt102 -vt220 -vt320 -vt400 -vt420 -wy50 -wy60 -wy99-ansi,wy99a-ansi -xfce -xnuppc -xterm,xterm-88color,xterm-256color diff --git a/vendor/github.com/gdamore/tcell/terminfo/p/pcansi/term.go b/vendor/github.com/gdamore/tcell/terminfo/p/pcansi/term.go deleted file mode 100644 index 84bc400b..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/p/pcansi/term.go +++ /dev/null @@ -1,39 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package pcansi - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // ibm-pc terminal programs claiming to be ansi - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "pcansi", - Columns: 80, - Lines: 24, - Colors: 8, - Bell: "\a", - Clear: "\x1b[H\x1b[J", - AttrOff: "\x1b[0;10m", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - SetFg: "\x1b[3%p1%dm", - SetBg: "\x1b[4%p1%dm", - SetFgBg: "\x1b[3%p1%d;4%p2%dm", - PadChar: "\x00", - AltChars: "+\x10,\x11-\x18.\x190\xdb`\x04a\xb1f\xf8g\xf1h\xb0j\xd9k\xbfl\xdam\xc0n\xc5o~p\xc4q\xc4r\xc4s_t\xc3u\xb4v\xc1w\xc2x\xb3y\xf3z\xf2{\xe3|\xd8}\x9c~\xfe", - EnterAcs: "\x1b[12m", - ExitAcs: "\x1b[10m", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\x1b[D", - CursorUp1: "\x1b[A", - KeyUp: "\x1b[A", - KeyDown: "\x1b[B", - KeyRight: "\x1b[C", - KeyLeft: "\x1b[D", - KeyBackspace: "\b", - KeyHome: "\x1b[H", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/r/rxvt/term.go b/vendor/github.com/gdamore/tcell/terminfo/r/rxvt/term.go deleted file mode 100644 index 776f750e..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/r/rxvt/term.go +++ /dev/null @@ -1,466 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package rxvt - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // rxvt terminal emulator (X Window System) - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "rxvt", - Columns: 80, - Lines: 24, - Colors: 8, - Bell: "\a", - Clear: "\x1b[H\x1b[2J", - EnterCA: "\x1b7\x1b[?47h", - ExitCA: "\x1b[2J\x1b[?47l\x1b8", - ShowCursor: "\x1b[?25h", - HideCursor: "\x1b[?25l", - AttrOff: "\x1b[m\x0f", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - EnterKeypad: "\x1b=", - ExitKeypad: "\x1b>", - SetFg: "\x1b[3%p1%dm", - SetBg: "\x1b[4%p1%dm", - SetFgBg: "\x1b[3%p1%d;4%p2%dm", - PadChar: "\x00", - AltChars: "``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x0e", - ExitAcs: "\x0f", - EnableAcs: "\x1b(B\x1b)0", - Mouse: "\x1b[M", - MouseMode: "%?%p1%{1}%=%t%'h'%Pa%e%'l'%Pa%;\x1b[?1000%ga%c\x1b[?1002%ga%c\x1b[?1003%ga%c\x1b[?1006%ga%c", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1b[A", - KeyDown: "\x1b[B", - KeyRight: "\x1b[C", - KeyLeft: "\x1b[D", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\xff", - KeyHome: "\x1b[7~", - KeyEnd: "\x1b[8~", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1b[11~", - KeyF2: "\x1b[12~", - KeyF3: "\x1b[13~", - KeyF4: "\x1b[14~", - KeyF5: "\x1b[15~", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyF13: "\x1b[25~", - KeyF14: "\x1b[26~", - KeyF15: "\x1b[28~", - KeyF16: "\x1b[29~", - KeyF17: "\x1b[31~", - KeyF18: "\x1b[32~", - KeyF19: "\x1b[33~", - KeyF20: "\x1b[34~", - KeyF21: "\x1b[23$", - KeyF22: "\x1b[24$", - KeyF23: "\x1b[11^", - KeyF24: "\x1b[12^", - KeyF25: "\x1b[13^", - KeyF26: "\x1b[14^", - KeyF27: "\x1b[15^", - KeyF28: "\x1b[17^", - KeyF29: "\x1b[18^", - KeyF30: "\x1b[19^", - KeyF31: "\x1b[20^", - KeyF32: "\x1b[21^", - KeyF33: "\x1b[23^", - KeyF34: "\x1b[24^", - KeyF35: "\x1b[25^", - KeyF36: "\x1b[26^", - KeyF37: "\x1b[28^", - KeyF38: "\x1b[29^", - KeyF39: "\x1b[31^", - KeyF40: "\x1b[32^", - KeyF41: "\x1b[33^", - KeyF42: "\x1b[34^", - KeyF43: "\x1b[23@", - KeyF44: "\x1b[24@", - KeyBacktab: "\x1b[Z", - KeyShfLeft: "\x1b[d", - KeyShfRight: "\x1b[c", - KeyShfUp: "\x1b[a", - KeyShfDown: "\x1b[b", - KeyCtrlLeft: "\x1b[Od", - KeyCtrlRight: "\x1b[Oc", - KeyCtrlUp: "\x1b[Oa", - KeyCtrlDown: "\x1b[Ob", - KeyShfHome: "\x1b[7$", - KeyShfEnd: "\x1b[8$", - KeyCtrlHome: "\x1b[7^", - KeyCtrlEnd: "\x1b[8^", - }) - - // rxvt 2.7.9 with xterm 256-colors - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "rxvt-256color", - Columns: 80, - Lines: 24, - Colors: 256, - Bell: "\a", - Clear: "\x1b[H\x1b[2J", - EnterCA: "\x1b7\x1b[?47h", - ExitCA: "\x1b[2J\x1b[?47l\x1b8", - ShowCursor: "\x1b[?25h", - HideCursor: "\x1b[?25l", - AttrOff: "\x1b[m\x0f", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - EnterKeypad: "\x1b=", - ExitKeypad: "\x1b>", - SetFg: "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m", - SetBg: "\x1b[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m", - SetFgBg: "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;;%?%p2%{8}%<%t4%p2%d%e%p2%{16}%<%t10%p2%{8}%-%d%e48;5;%p2%d%;m", - PadChar: "\x00", - AltChars: "``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x0e", - ExitAcs: "\x0f", - EnableAcs: "\x1b(B\x1b)0", - Mouse: "\x1b[M", - MouseMode: "%?%p1%{1}%=%t%'h'%Pa%e%'l'%Pa%;\x1b[?1000%ga%c\x1b[?1002%ga%c\x1b[?1003%ga%c\x1b[?1006%ga%c", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1b[A", - KeyDown: "\x1b[B", - KeyRight: "\x1b[C", - KeyLeft: "\x1b[D", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\xff", - KeyHome: "\x1b[7~", - KeyEnd: "\x1b[8~", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1b[11~", - KeyF2: "\x1b[12~", - KeyF3: "\x1b[13~", - KeyF4: "\x1b[14~", - KeyF5: "\x1b[15~", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyF13: "\x1b[25~", - KeyF14: "\x1b[26~", - KeyF15: "\x1b[28~", - KeyF16: "\x1b[29~", - KeyF17: "\x1b[31~", - KeyF18: "\x1b[32~", - KeyF19: "\x1b[33~", - KeyF20: "\x1b[34~", - KeyF21: "\x1b[23$", - KeyF22: "\x1b[24$", - KeyF23: "\x1b[11^", - KeyF24: "\x1b[12^", - KeyF25: "\x1b[13^", - KeyF26: "\x1b[14^", - KeyF27: "\x1b[15^", - KeyF28: "\x1b[17^", - KeyF29: "\x1b[18^", - KeyF30: "\x1b[19^", - KeyF31: "\x1b[20^", - KeyF32: "\x1b[21^", - KeyF33: "\x1b[23^", - KeyF34: "\x1b[24^", - KeyF35: "\x1b[25^", - KeyF36: "\x1b[26^", - KeyF37: "\x1b[28^", - KeyF38: "\x1b[29^", - KeyF39: "\x1b[31^", - KeyF40: "\x1b[32^", - KeyF41: "\x1b[33^", - KeyF42: "\x1b[34^", - KeyF43: "\x1b[23@", - KeyF44: "\x1b[24@", - KeyBacktab: "\x1b[Z", - KeyShfLeft: "\x1b[d", - KeyShfRight: "\x1b[c", - KeyShfUp: "\x1b[a", - KeyShfDown: "\x1b[b", - KeyCtrlLeft: "\x1b[Od", - KeyCtrlRight: "\x1b[Oc", - KeyCtrlUp: "\x1b[Oa", - KeyCtrlDown: "\x1b[Ob", - KeyShfHome: "\x1b[7$", - KeyShfEnd: "\x1b[8$", - KeyCtrlHome: "\x1b[7^", - KeyCtrlEnd: "\x1b[8^", - }) - - // rxvt 2.7.9 with xterm 88-colors - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "rxvt-88color", - Columns: 80, - Lines: 24, - Colors: 88, - Bell: "\a", - Clear: "\x1b[H\x1b[2J", - EnterCA: "\x1b7\x1b[?47h", - ExitCA: "\x1b[2J\x1b[?47l\x1b8", - ShowCursor: "\x1b[?25h", - HideCursor: "\x1b[?25l", - AttrOff: "\x1b[m\x0f", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - EnterKeypad: "\x1b=", - ExitKeypad: "\x1b>", - SetFg: "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m", - SetBg: "\x1b[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m", - SetFgBg: "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;;%?%p2%{8}%<%t4%p2%d%e%p2%{16}%<%t10%p2%{8}%-%d%e48;5;%p2%d%;m", - PadChar: "\x00", - AltChars: "``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x0e", - ExitAcs: "\x0f", - EnableAcs: "\x1b(B\x1b)0", - Mouse: "\x1b[M", - MouseMode: "%?%p1%{1}%=%t%'h'%Pa%e%'l'%Pa%;\x1b[?1000%ga%c\x1b[?1002%ga%c\x1b[?1003%ga%c\x1b[?1006%ga%c", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1b[A", - KeyDown: "\x1b[B", - KeyRight: "\x1b[C", - KeyLeft: "\x1b[D", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\xff", - KeyHome: "\x1b[7~", - KeyEnd: "\x1b[8~", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1b[11~", - KeyF2: "\x1b[12~", - KeyF3: "\x1b[13~", - KeyF4: "\x1b[14~", - KeyF5: "\x1b[15~", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyF13: "\x1b[25~", - KeyF14: "\x1b[26~", - KeyF15: "\x1b[28~", - KeyF16: "\x1b[29~", - KeyF17: "\x1b[31~", - KeyF18: "\x1b[32~", - KeyF19: "\x1b[33~", - KeyF20: "\x1b[34~", - KeyF21: "\x1b[23$", - KeyF22: "\x1b[24$", - KeyF23: "\x1b[11^", - KeyF24: "\x1b[12^", - KeyF25: "\x1b[13^", - KeyF26: "\x1b[14^", - KeyF27: "\x1b[15^", - KeyF28: "\x1b[17^", - KeyF29: "\x1b[18^", - KeyF30: "\x1b[19^", - KeyF31: "\x1b[20^", - KeyF32: "\x1b[21^", - KeyF33: "\x1b[23^", - KeyF34: "\x1b[24^", - KeyF35: "\x1b[25^", - KeyF36: "\x1b[26^", - KeyF37: "\x1b[28^", - KeyF38: "\x1b[29^", - KeyF39: "\x1b[31^", - KeyF40: "\x1b[32^", - KeyF41: "\x1b[33^", - KeyF42: "\x1b[34^", - KeyF43: "\x1b[23@", - KeyF44: "\x1b[24@", - KeyBacktab: "\x1b[Z", - KeyShfLeft: "\x1b[d", - KeyShfRight: "\x1b[c", - KeyShfUp: "\x1b[a", - KeyShfDown: "\x1b[b", - KeyCtrlLeft: "\x1b[Od", - KeyCtrlRight: "\x1b[Oc", - KeyCtrlUp: "\x1b[Oa", - KeyCtrlDown: "\x1b[Ob", - KeyShfHome: "\x1b[7$", - KeyShfEnd: "\x1b[8$", - KeyCtrlHome: "\x1b[7^", - KeyCtrlEnd: "\x1b[8^", - }) - - // rxvt-unicode terminal (X Window System) - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "rxvt-unicode", - Columns: 80, - Lines: 24, - Colors: 88, - Bell: "\a", - Clear: "\x1b[H\x1b[2J", - EnterCA: "\x1b[?1049h", - ExitCA: "\x1b[r\x1b[?1049l", - ShowCursor: "\x1b[?12l\x1b[?25h", - HideCursor: "\x1b[?25l", - AttrOff: "\x1b[m\x1b(B", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - EnterKeypad: "\x1b=", - ExitKeypad: "\x1b>", - SetFg: "\x1b[38;5;%p1%dm", - SetBg: "\x1b[48;5;%p1%dm", - SetFgBg: "\x1b[38;5;%p1%d;48;5;%p2%dm", - AltChars: "+C,D-A.B0E``aaffgghFiGjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x1b(0", - ExitAcs: "\x1b(B", - Mouse: "\x1b[M", - MouseMode: "%?%p1%{1}%=%t%'h'%Pa%e%'l'%Pa%;\x1b[?1000%ga%c\x1b[?1002%ga%c\x1b[?1003%ga%c\x1b[?1006%ga%c", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1b[A", - KeyDown: "\x1b[B", - KeyRight: "\x1b[C", - KeyLeft: "\x1b[D", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\xff", - KeyHome: "\x1b[7~", - KeyEnd: "\x1b[8~", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1b[11~", - KeyF2: "\x1b[12~", - KeyF3: "\x1b[13~", - KeyF4: "\x1b[14~", - KeyF5: "\x1b[15~", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyF13: "\x1b[25~", - KeyF14: "\x1b[26~", - KeyF15: "\x1b[28~", - KeyF16: "\x1b[29~", - KeyF17: "\x1b[31~", - KeyF18: "\x1b[32~", - KeyF19: "\x1b[33~", - KeyF20: "\x1b[34~", - KeyBacktab: "\x1b[Z", - KeyShfLeft: "\x1b[d", - KeyShfRight: "\x1b[c", - KeyShfUp: "\x1b[a", - KeyShfDown: "\x1b[b", - KeyCtrlLeft: "\x1b[Od", - KeyCtrlRight: "\x1b[Oc", - KeyCtrlUp: "\x1b[Oa", - KeyCtrlDown: "\x1b[Ob", - KeyShfHome: "\x1b[7$", - KeyShfEnd: "\x1b[8$", - KeyCtrlHome: "\x1b[7^", - KeyCtrlEnd: "\x1b[8^", - }) - - // rxvt-unicode terminal with 256 colors (X Window System) - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "rxvt-unicode-256color", - Columns: 80, - Lines: 24, - Colors: 256, - Bell: "\a", - Clear: "\x1b[H\x1b[2J", - EnterCA: "\x1b[?1049h", - ExitCA: "\x1b[r\x1b[?1049l", - ShowCursor: "\x1b[?12l\x1b[?25h", - HideCursor: "\x1b[?25l", - AttrOff: "\x1b[m\x1b(B", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - EnterKeypad: "\x1b=", - ExitKeypad: "\x1b>", - SetFg: "\x1b[38;5;%p1%dm", - SetBg: "\x1b[48;5;%p1%dm", - SetFgBg: "\x1b[38;5;%p1%d;48;5;%p2%dm", - AltChars: "+C,D-A.B0E``aaffgghFiGjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x1b(0", - ExitAcs: "\x1b(B", - Mouse: "\x1b[M", - MouseMode: "%?%p1%{1}%=%t%'h'%Pa%e%'l'%Pa%;\x1b[?1000%ga%c\x1b[?1002%ga%c\x1b[?1003%ga%c\x1b[?1006%ga%c", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1b[A", - KeyDown: "\x1b[B", - KeyRight: "\x1b[C", - KeyLeft: "\x1b[D", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\xff", - KeyHome: "\x1b[7~", - KeyEnd: "\x1b[8~", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1b[11~", - KeyF2: "\x1b[12~", - KeyF3: "\x1b[13~", - KeyF4: "\x1b[14~", - KeyF5: "\x1b[15~", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyF13: "\x1b[25~", - KeyF14: "\x1b[26~", - KeyF15: "\x1b[28~", - KeyF16: "\x1b[29~", - KeyF17: "\x1b[31~", - KeyF18: "\x1b[32~", - KeyF19: "\x1b[33~", - KeyF20: "\x1b[34~", - KeyBacktab: "\x1b[Z", - KeyShfLeft: "\x1b[d", - KeyShfRight: "\x1b[c", - KeyShfUp: "\x1b[a", - KeyShfDown: "\x1b[b", - KeyCtrlLeft: "\x1b[Od", - KeyCtrlRight: "\x1b[Oc", - KeyCtrlUp: "\x1b[Oa", - KeyCtrlDown: "\x1b[Ob", - KeyShfHome: "\x1b[7$", - KeyShfEnd: "\x1b[8$", - KeyCtrlHome: "\x1b[7^", - KeyCtrlEnd: "\x1b[8^", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/s/screen/term.go b/vendor/github.com/gdamore/tcell/terminfo/s/screen/term.go deleted file mode 100644 index ab0d8eed..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/s/screen/term.go +++ /dev/null @@ -1,126 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package screen - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // VT 100/ANSI X3.64 virtual terminal - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "screen", - Columns: 80, - Lines: 24, - Colors: 8, - Bell: "\a", - Clear: "\x1b[H\x1b[J", - EnterCA: "\x1b[?1049h", - ExitCA: "\x1b[?1049l", - ShowCursor: "\x1b[34h\x1b[?25h", - HideCursor: "\x1b[?25l", - AttrOff: "\x1b[m\x0f", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Dim: "\x1b[2m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - EnterKeypad: "\x1b[?1h\x1b=", - ExitKeypad: "\x1b[?1l\x1b>", - SetFg: "\x1b[3%p1%dm", - SetBg: "\x1b[4%p1%dm", - SetFgBg: "\x1b[3%p1%d;4%p2%dm", - PadChar: "\x00", - AltChars: "++,,--..00``aaffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x0e", - ExitAcs: "\x0f", - EnableAcs: "\x1b(B\x1b)0", - Mouse: "\x1b[M", - MouseMode: "%?%p1%{1}%=%t%'h'%Pa%e%'l'%Pa%;\x1b[?1000%ga%c\x1b[?1002%ga%c\x1b[?1003%ga%c\x1b[?1006%ga%c", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1bM", - KeyUp: "\x1bOA", - KeyDown: "\x1bOB", - KeyRight: "\x1bOC", - KeyLeft: "\x1bOD", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\xff", - KeyHome: "\x1b[1~", - KeyEnd: "\x1b[4~", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1bOP", - KeyF2: "\x1bOQ", - KeyF3: "\x1bOR", - KeyF4: "\x1bOS", - KeyF5: "\x1b[15~", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyBacktab: "\x1b[Z", - }) - - // GNU Screen with 256 colors - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "screen-256color", - Columns: 80, - Lines: 24, - Colors: 256, - Bell: "\a", - Clear: "\x1b[H\x1b[J", - EnterCA: "\x1b[?1049h", - ExitCA: "\x1b[?1049l", - ShowCursor: "\x1b[34h\x1b[?25h", - HideCursor: "\x1b[?25l", - AttrOff: "\x1b[m\x0f", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Dim: "\x1b[2m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - EnterKeypad: "\x1b[?1h\x1b=", - ExitKeypad: "\x1b[?1l\x1b>", - SetFg: "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m", - SetBg: "\x1b[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m", - SetFgBg: "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;;%?%p2%{8}%<%t4%p2%d%e%p2%{16}%<%t10%p2%{8}%-%d%e48;5;%p2%d%;m", - PadChar: "\x00", - AltChars: "++,,--..00``aaffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x0e", - ExitAcs: "\x0f", - EnableAcs: "\x1b(B\x1b)0", - Mouse: "\x1b[M", - MouseMode: "%?%p1%{1}%=%t%'h'%Pa%e%'l'%Pa%;\x1b[?1000%ga%c\x1b[?1002%ga%c\x1b[?1003%ga%c\x1b[?1006%ga%c", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1bM", - KeyUp: "\x1bOA", - KeyDown: "\x1bOB", - KeyRight: "\x1bOC", - KeyLeft: "\x1bOD", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\xff", - KeyHome: "\x1b[1~", - KeyEnd: "\x1b[4~", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1bOP", - KeyF2: "\x1bOQ", - KeyF3: "\x1bOR", - KeyF4: "\x1bOS", - KeyF5: "\x1b[15~", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyBacktab: "\x1b[Z", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/s/simpleterm/term.go b/vendor/github.com/gdamore/tcell/terminfo/s/simpleterm/term.go deleted file mode 100644 index ad7c1e81..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/s/simpleterm/term.go +++ /dev/null @@ -1,308 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package simpleterm - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // simpleterm - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "st", - Aliases: []string{"stterm"}, - Columns: 80, - Lines: 24, - Colors: 8, - Bell: "\a", - Clear: "\x1b[H\x1b[2J", - EnterCA: "\x1b[?1049h", - ExitCA: "\x1b[?1049l", - ShowCursor: "\x1b[?12l\x1b[?25h", - HideCursor: "\x1b[?25l", - AttrOff: "\x1b[0m", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Dim: "\x1b[2m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - EnterKeypad: "\x1b[?1h\x1b=", - ExitKeypad: "\x1b[?1l\x1b>", - SetFg: "\x1b[3%p1%dm", - SetBg: "\x1b[4%p1%dm", - SetFgBg: "\x1b[3%p1%d;4%p2%dm", - AltChars: "+C,D-A.B0E``aaffgghFiGjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x1b(0", - ExitAcs: "\x1b(B", - EnableAcs: "\x1b)0", - Mouse: "\x1b[M", - MouseMode: "%?%p1%{1}%=%t%'h'%Pa%e%'l'%Pa%;\x1b[?1000%ga%c\x1b[?1002%ga%c\x1b[?1003%ga%c\x1b[?1006%ga%c", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1bOA", - KeyDown: "\x1bOB", - KeyRight: "\x1bOC", - KeyLeft: "\x1bOD", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\xff", - KeyHome: "\x1b[1~", - KeyEnd: "\x1b[4~", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1bOP", - KeyF2: "\x1bOQ", - KeyF3: "\x1bOR", - KeyF4: "\x1bOS", - KeyF5: "\x1b[15~", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyF13: "\x1b[1;2P", - KeyF14: "\x1b[1;2Q", - KeyF15: "\x1b[1;2R", - KeyF16: "\x1b[1;2S", - KeyF17: "\x1b[15;2~", - KeyF18: "\x1b[17;2~", - KeyF19: "\x1b[18;2~", - KeyF20: "\x1b[19;2~", - KeyF21: "\x1b[20;2~", - KeyF22: "\x1b[21;2~", - KeyF23: "\x1b[23;2~", - KeyF24: "\x1b[24;2~", - KeyF25: "\x1b[1;5P", - KeyF26: "\x1b[1;5Q", - KeyF27: "\x1b[1;5R", - KeyF28: "\x1b[1;5S", - KeyF29: "\x1b[15;5~", - KeyF30: "\x1b[17;5~", - KeyF31: "\x1b[18;5~", - KeyF32: "\x1b[19;5~", - KeyF33: "\x1b[20;5~", - KeyF34: "\x1b[21;5~", - KeyF35: "\x1b[23;5~", - KeyF36: "\x1b[24;5~", - KeyF37: "\x1b[1;6P", - KeyF38: "\x1b[1;6Q", - KeyF39: "\x1b[1;6R", - KeyF40: "\x1b[1;6S", - KeyF41: "\x1b[15;6~", - KeyF42: "\x1b[17;6~", - KeyF43: "\x1b[18;6~", - KeyF44: "\x1b[19;6~", - KeyF45: "\x1b[20;6~", - KeyF46: "\x1b[21;6~", - KeyF47: "\x1b[23;6~", - KeyF48: "\x1b[24;6~", - KeyF49: "\x1b[1;3P", - KeyF50: "\x1b[1;3Q", - KeyF51: "\x1b[1;3R", - KeyF52: "\x1b[1;3S", - KeyF53: "\x1b[15;3~", - KeyF54: "\x1b[17;3~", - KeyF55: "\x1b[18;3~", - KeyF56: "\x1b[19;3~", - KeyF57: "\x1b[20;3~", - KeyF58: "\x1b[21;3~", - KeyF59: "\x1b[23;3~", - KeyF60: "\x1b[24;3~", - KeyF61: "\x1b[1;4P", - KeyF62: "\x1b[1;4Q", - KeyF63: "\x1b[1;4R", - KeyClear: "\x1b[3;5~", - KeyShfLeft: "\x1b[1;2D", - KeyShfRight: "\x1b[1;2C", - KeyShfUp: "\x1b[1;2A", - KeyShfDown: "\x1b[1;2B", - KeyCtrlLeft: "\x1b[1;5D", - KeyCtrlRight: "\x1b[1;5C", - KeyCtrlUp: "\x1b[1;5A", - KeyCtrlDown: "\x1b[1;5B", - KeyMetaLeft: "\x1b[1;9D", - KeyMetaRight: "\x1b[1;9C", - KeyMetaUp: "\x1b[1;9A", - KeyMetaDown: "\x1b[1;9B", - KeyAltLeft: "\x1b[1;3D", - KeyAltRight: "\x1b[1;3C", - KeyAltUp: "\x1b[1;3A", - KeyAltDown: "\x1b[1;3B", - KeyAltShfLeft: "\x1b[1;4D", - KeyAltShfRight: "\x1b[1;4C", - KeyAltShfUp: "\x1b[1;4A", - KeyAltShfDown: "\x1b[1;4B", - KeyMetaShfLeft: "\x1b[1;10D", - KeyMetaShfRight: "\x1b[1;10C", - KeyMetaShfUp: "\x1b[1;10A", - KeyMetaShfDown: "\x1b[1;10B", - KeyCtrlShfLeft: "\x1b[1;6D", - KeyCtrlShfRight: "\x1b[1;6C", - KeyCtrlShfUp: "\x1b[1;6A", - KeyCtrlShfDown: "\x1b[1;6B", - KeyShfHome: "\x1b[1;2H", - KeyShfEnd: "\x1b[1;2F", - KeyCtrlHome: "\x1b[1;5H", - KeyCtrlEnd: "\x1b[1;5F", - KeyAltHome: "\x1b[1;9H", - KeyAltEnd: "\x1b[1;9F", - KeyCtrlShfHome: "\x1b[1;6H", - KeyCtrlShfEnd: "\x1b[1;6F", - KeyMetaShfHome: "\x1b[1;10H", - KeyMetaShfEnd: "\x1b[1;10F", - KeyAltShfHome: "\x1b[1;4H", - KeyAltShfEnd: "\x1b[1;4F", - }) - - // simpleterm with 256 colors - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "st-256color", - Aliases: []string{"stterm-256color"}, - Columns: 80, - Lines: 24, - Colors: 256, - Bell: "\a", - Clear: "\x1b[H\x1b[2J", - EnterCA: "\x1b[?1049h", - ExitCA: "\x1b[?1049l", - ShowCursor: "\x1b[?12l\x1b[?25h", - HideCursor: "\x1b[?25l", - AttrOff: "\x1b[0m", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Dim: "\x1b[2m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - EnterKeypad: "\x1b[?1h\x1b=", - ExitKeypad: "\x1b[?1l\x1b>", - SetFg: "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m", - SetBg: "\x1b[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m", - SetFgBg: "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;;%?%p2%{8}%<%t4%p2%d%e%p2%{16}%<%t10%p2%{8}%-%d%e48;5;%p2%d%;m", - AltChars: "+C,D-A.B0E``aaffgghFiGjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x1b(0", - ExitAcs: "\x1b(B", - EnableAcs: "\x1b)0", - Mouse: "\x1b[M", - MouseMode: "%?%p1%{1}%=%t%'h'%Pa%e%'l'%Pa%;\x1b[?1000%ga%c\x1b[?1002%ga%c\x1b[?1003%ga%c\x1b[?1006%ga%c", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1bOA", - KeyDown: "\x1bOB", - KeyRight: "\x1bOC", - KeyLeft: "\x1bOD", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\xff", - KeyHome: "\x1b[1~", - KeyEnd: "\x1b[4~", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1bOP", - KeyF2: "\x1bOQ", - KeyF3: "\x1bOR", - KeyF4: "\x1bOS", - KeyF5: "\x1b[15~", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyF13: "\x1b[1;2P", - KeyF14: "\x1b[1;2Q", - KeyF15: "\x1b[1;2R", - KeyF16: "\x1b[1;2S", - KeyF17: "\x1b[15;2~", - KeyF18: "\x1b[17;2~", - KeyF19: "\x1b[18;2~", - KeyF20: "\x1b[19;2~", - KeyF21: "\x1b[20;2~", - KeyF22: "\x1b[21;2~", - KeyF23: "\x1b[23;2~", - KeyF24: "\x1b[24;2~", - KeyF25: "\x1b[1;5P", - KeyF26: "\x1b[1;5Q", - KeyF27: "\x1b[1;5R", - KeyF28: "\x1b[1;5S", - KeyF29: "\x1b[15;5~", - KeyF30: "\x1b[17;5~", - KeyF31: "\x1b[18;5~", - KeyF32: "\x1b[19;5~", - KeyF33: "\x1b[20;5~", - KeyF34: "\x1b[21;5~", - KeyF35: "\x1b[23;5~", - KeyF36: "\x1b[24;5~", - KeyF37: "\x1b[1;6P", - KeyF38: "\x1b[1;6Q", - KeyF39: "\x1b[1;6R", - KeyF40: "\x1b[1;6S", - KeyF41: "\x1b[15;6~", - KeyF42: "\x1b[17;6~", - KeyF43: "\x1b[18;6~", - KeyF44: "\x1b[19;6~", - KeyF45: "\x1b[20;6~", - KeyF46: "\x1b[21;6~", - KeyF47: "\x1b[23;6~", - KeyF48: "\x1b[24;6~", - KeyF49: "\x1b[1;3P", - KeyF50: "\x1b[1;3Q", - KeyF51: "\x1b[1;3R", - KeyF52: "\x1b[1;3S", - KeyF53: "\x1b[15;3~", - KeyF54: "\x1b[17;3~", - KeyF55: "\x1b[18;3~", - KeyF56: "\x1b[19;3~", - KeyF57: "\x1b[20;3~", - KeyF58: "\x1b[21;3~", - KeyF59: "\x1b[23;3~", - KeyF60: "\x1b[24;3~", - KeyF61: "\x1b[1;4P", - KeyF62: "\x1b[1;4Q", - KeyF63: "\x1b[1;4R", - KeyClear: "\x1b[3;5~", - KeyShfLeft: "\x1b[1;2D", - KeyShfRight: "\x1b[1;2C", - KeyShfUp: "\x1b[1;2A", - KeyShfDown: "\x1b[1;2B", - KeyCtrlLeft: "\x1b[1;5D", - KeyCtrlRight: "\x1b[1;5C", - KeyCtrlUp: "\x1b[1;5A", - KeyCtrlDown: "\x1b[1;5B", - KeyMetaLeft: "\x1b[1;9D", - KeyMetaRight: "\x1b[1;9C", - KeyMetaUp: "\x1b[1;9A", - KeyMetaDown: "\x1b[1;9B", - KeyAltLeft: "\x1b[1;3D", - KeyAltRight: "\x1b[1;3C", - KeyAltUp: "\x1b[1;3A", - KeyAltDown: "\x1b[1;3B", - KeyAltShfLeft: "\x1b[1;4D", - KeyAltShfRight: "\x1b[1;4C", - KeyAltShfUp: "\x1b[1;4A", - KeyAltShfDown: "\x1b[1;4B", - KeyMetaShfLeft: "\x1b[1;10D", - KeyMetaShfRight: "\x1b[1;10C", - KeyMetaShfUp: "\x1b[1;10A", - KeyMetaShfDown: "\x1b[1;10B", - KeyCtrlShfLeft: "\x1b[1;6D", - KeyCtrlShfRight: "\x1b[1;6C", - KeyCtrlShfUp: "\x1b[1;6A", - KeyCtrlShfDown: "\x1b[1;6B", - KeyShfHome: "\x1b[1;2H", - KeyShfEnd: "\x1b[1;2F", - KeyCtrlHome: "\x1b[1;5H", - KeyCtrlEnd: "\x1b[1;5F", - KeyAltHome: "\x1b[1;9H", - KeyAltEnd: "\x1b[1;9F", - KeyCtrlShfHome: "\x1b[1;6H", - KeyCtrlShfEnd: "\x1b[1;6F", - KeyMetaShfHome: "\x1b[1;10H", - KeyMetaShfEnd: "\x1b[1;10F", - KeyAltShfHome: "\x1b[1;4H", - KeyAltShfEnd: "\x1b[1;4F", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/s/sun/term.go b/vendor/github.com/gdamore/tcell/terminfo/s/sun/term.go deleted file mode 100644 index f83cf957..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/s/sun/term.go +++ /dev/null @@ -1,90 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package sun - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // Sun Microsystems Inc. workstation console - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "sun", - Aliases: []string{"sun1", "sun2"}, - Columns: 80, - Lines: 34, - Bell: "\a", - Clear: "\f", - AttrOff: "\x1b[m", - Reverse: "\x1b[7m", - PadChar: "\x00", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1b[A", - KeyDown: "\x1b[B", - KeyRight: "\x1b[C", - KeyLeft: "\x1b[D", - KeyInsert: "\x1b[247z", - KeyDelete: "\xff", - KeyBackspace: "\b", - KeyHome: "\x1b[214z", - KeyEnd: "\x1b[220z", - KeyPgUp: "\x1b[216z", - KeyPgDn: "\x1b[222z", - KeyF1: "\x1b[224z", - KeyF2: "\x1b[225z", - KeyF3: "\x1b[226z", - KeyF4: "\x1b[227z", - KeyF5: "\x1b[228z", - KeyF6: "\x1b[229z", - KeyF7: "\x1b[230z", - KeyF8: "\x1b[231z", - KeyF9: "\x1b[232z", - KeyF10: "\x1b[233z", - KeyF11: "\x1b[234z", - KeyF12: "\x1b[235z", - }) - - // Sun Microsystems Workstation console with color support (IA systems) - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "sun-color", - Columns: 80, - Lines: 34, - Colors: 8, - Bell: "\a", - Clear: "\f", - AttrOff: "\x1b[m", - Bold: "\x1b[1m", - Reverse: "\x1b[7m", - SetFg: "\x1b[3%p1%dm", - SetBg: "\x1b[4%p1%dm", - SetFgBg: "\x1b[3%p1%d;4%p2%dm", - PadChar: "\x00", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1b[A", - KeyDown: "\x1b[B", - KeyRight: "\x1b[C", - KeyLeft: "\x1b[D", - KeyInsert: "\x1b[247z", - KeyDelete: "\xff", - KeyBackspace: "\b", - KeyHome: "\x1b[214z", - KeyEnd: "\x1b[220z", - KeyPgUp: "\x1b[216z", - KeyPgDn: "\x1b[222z", - KeyF1: "\x1b[224z", - KeyF2: "\x1b[225z", - KeyF3: "\x1b[226z", - KeyF4: "\x1b[227z", - KeyF5: "\x1b[228z", - KeyF6: "\x1b[229z", - KeyF7: "\x1b[230z", - KeyF8: "\x1b[231z", - KeyF9: "\x1b[232z", - KeyF10: "\x1b[233z", - KeyF11: "\x1b[234z", - KeyF12: "\x1b[235z", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/t/termite/term.go b/vendor/github.com/gdamore/tcell/terminfo/t/termite/term.go deleted file mode 100644 index 62b1c5b8..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/t/termite/term.go +++ /dev/null @@ -1,154 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package termite - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // VTE-based terminal - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "termite", - Columns: 80, - Lines: 24, - Colors: 256, - Bell: "\a", - Clear: "\x1b[H\x1b[2J", - EnterCA: "\x1b[?1049h", - ExitCA: "\x1b[?1049l", - ShowCursor: "\x1b[?12l\x1b[?25h", - HideCursor: "\x1b[?25l", - AttrOff: "\x1b(B\x1b[m", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Reverse: "\x1b[7m", - EnterKeypad: "\x1b[?1h\x1b=", - ExitKeypad: "\x1b[?1l\x1b>", - SetFg: "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m", - SetBg: "\x1b[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m", - SetFgBg: "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;;%?%p2%{8}%<%t4%p2%d%e%p2%{16}%<%t10%p2%{8}%-%d%e48;5;%p2%d%;m", - AltChars: "++,,--..00``aaffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x1b(0", - ExitAcs: "\x1b(B", - Mouse: "\x1b[M", - MouseMode: "%?%p1%{1}%=%t%'h'%Pa%e%'l'%Pa%;\x1b[?1000%ga%c\x1b[?1002%ga%c\x1b[?1003%ga%c\x1b[?1006%ga%c", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1bOA", - KeyDown: "\x1bOB", - KeyRight: "\x1bOC", - KeyLeft: "\x1bOD", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\xff", - KeyHome: "\x1bOH", - KeyEnd: "\x1bOF", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1bOP", - KeyF2: "\x1bOQ", - KeyF3: "\x1bOR", - KeyF4: "\x1bOS", - KeyF5: "\x1b[15~", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyF13: "\x1b[1;2P", - KeyF14: "\x1b[1;2Q", - KeyF15: "\x1b[1;2R", - KeyF16: "\x1b[1;2S", - KeyF17: "\x1b[15;2~", - KeyF18: "\x1b[17;2~", - KeyF19: "\x1b[18;2~", - KeyF20: "\x1b[19;2~", - KeyF21: "\x1b[20;2~", - KeyF22: "\x1b[21;2~", - KeyF23: "\x1b[23;2~", - KeyF24: "\x1b[24;2~", - KeyF25: "\x1b[1;5P", - KeyF26: "\x1b[1;5Q", - KeyF27: "\x1b[1;5R", - KeyF28: "\x1b[1;5S", - KeyF29: "\x1b[15;5~", - KeyF30: "\x1b[17;5~", - KeyF31: "\x1b[18;5~", - KeyF32: "\x1b[19;5~", - KeyF33: "\x1b[20;5~", - KeyF34: "\x1b[21;5~", - KeyF35: "\x1b[23;5~", - KeyF36: "\x1b[24;5~", - KeyF37: "\x1b[1;6P", - KeyF38: "\x1b[1;6Q", - KeyF39: "\x1b[1;6R", - KeyF40: "\x1b[1;6S", - KeyF41: "\x1b[15;6~", - KeyF42: "\x1b[17;6~", - KeyF43: "\x1b[18;6~", - KeyF44: "\x1b[19;6~", - KeyF45: "\x1b[20;6~", - KeyF46: "\x1b[21;6~", - KeyF47: "\x1b[23;6~", - KeyF48: "\x1b[24;6~", - KeyF49: "\x1b[1;3P", - KeyF50: "\x1b[1;3Q", - KeyF51: "\x1b[1;3R", - KeyF52: "\x1b[1;3S", - KeyF53: "\x1b[15;3~", - KeyF54: "\x1b[17;3~", - KeyF55: "\x1b[18;3~", - KeyF56: "\x1b[19;3~", - KeyF57: "\x1b[20;3~", - KeyF58: "\x1b[21;3~", - KeyF59: "\x1b[23;3~", - KeyF60: "\x1b[24;3~", - KeyF61: "\x1b[1;4P", - KeyF62: "\x1b[1;4Q", - KeyF63: "\x1b[1;4R", - KeyBacktab: "\x1b[Z", - KeyShfLeft: "\x1b[1;2D", - KeyShfRight: "\x1b[1;2C", - KeyShfUp: "\x1b[1;2A", - KeyShfDown: "\x1b[1;2B", - KeyCtrlLeft: "\x1b[1;5D", - KeyCtrlRight: "\x1b[1;5C", - KeyCtrlUp: "\x1b[1;5A", - KeyCtrlDown: "\x1b[1;5B", - KeyMetaLeft: "\x1b[1;9D", - KeyMetaRight: "\x1b[1;9C", - KeyMetaUp: "\x1b[1;9A", - KeyMetaDown: "\x1b[1;9B", - KeyAltLeft: "\x1b[1;3D", - KeyAltRight: "\x1b[1;3C", - KeyAltUp: "\x1b[1;3A", - KeyAltDown: "\x1b[1;3B", - KeyAltShfLeft: "\x1b[1;4D", - KeyAltShfRight: "\x1b[1;4C", - KeyAltShfUp: "\x1b[1;4A", - KeyAltShfDown: "\x1b[1;4B", - KeyMetaShfLeft: "\x1b[1;10D", - KeyMetaShfRight: "\x1b[1;10C", - KeyMetaShfUp: "\x1b[1;10A", - KeyMetaShfDown: "\x1b[1;10B", - KeyCtrlShfLeft: "\x1b[1;6D", - KeyCtrlShfRight: "\x1b[1;6C", - KeyCtrlShfUp: "\x1b[1;6A", - KeyCtrlShfDown: "\x1b[1;6B", - KeyShfHome: "\x1b[1;2H", - KeyShfEnd: "\x1b[1;2F", - KeyCtrlHome: "\x1b[1;5H", - KeyCtrlEnd: "\x1b[1;5F", - KeyAltHome: "\x1b[1;9H", - KeyAltEnd: "\x1b[1;9F", - KeyCtrlShfHome: "\x1b[1;6H", - KeyCtrlShfEnd: "\x1b[1;6F", - KeyMetaShfHome: "\x1b[1;10H", - KeyMetaShfEnd: "\x1b[1;10F", - KeyAltShfHome: "\x1b[1;4H", - KeyAltShfEnd: "\x1b[1;4F", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/t/tvi910/term.go b/vendor/github.com/gdamore/tcell/terminfo/t/tvi910/term.go deleted file mode 100644 index 1c5f7a31..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/t/tvi910/term.go +++ /dev/null @@ -1,39 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package tvi910 - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // televideo model 910 - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "tvi910", - Columns: 80, - Lines: 24, - Bell: "\a", - Clear: "\x1a", - AttrOff: "\x1bG0", - Underline: "\x1bG8", - Reverse: "\x1bG4", - PadChar: "\x00", - SetCursor: "\x1b=%p1%' '%+%c%p2%' '%+%c", - CursorBack1: "\b", - CursorUp1: "\v", - KeyUp: "\v", - KeyDown: "\n", - KeyRight: "\f", - KeyLeft: "\b", - KeyBackspace: "\b", - KeyHome: "\x1e", - KeyF1: "\x01@\r", - KeyF2: "\x01A\r", - KeyF3: "\x01B\r", - KeyF4: "\x01C\r", - KeyF5: "\x01D\r", - KeyF6: "\x01E\r", - KeyF7: "\x01F\r", - KeyF8: "\x01G\r", - KeyF9: "\x01H\r", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/t/tvi912/term.go b/vendor/github.com/gdamore/tcell/terminfo/t/tvi912/term.go deleted file mode 100644 index 5e52f5ce..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/t/tvi912/term.go +++ /dev/null @@ -1,38 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package tvi912 - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // old televideo 912/914/920 - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "tvi912", - Aliases: []string{"tvi914", "tvi920"}, - Columns: 80, - Lines: 24, - Bell: "\a", - Clear: "\x1a", - Underline: "\x1bl", - PadChar: "\x00", - SetCursor: "\x1b=%p1%' '%+%c%p2%' '%+%c", - CursorBack1: "\b", - CursorUp1: "\v", - KeyUp: "\v", - KeyDown: "\n", - KeyRight: "\f", - KeyLeft: "\b", - KeyBackspace: "\b", - KeyHome: "\x1e", - KeyF1: "\x01@\r", - KeyF2: "\x01A\r", - KeyF3: "\x01B\r", - KeyF4: "\x01C\r", - KeyF5: "\x01D\r", - KeyF6: "\x01E\r", - KeyF7: "\x01F\r", - KeyF8: "\x01G\r", - KeyF9: "\x01H\r", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/t/tvi921/term.go b/vendor/github.com/gdamore/tcell/terminfo/t/tvi921/term.go deleted file mode 100644 index 1ec02879..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/t/tvi921/term.go +++ /dev/null @@ -1,34 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package tvi921 - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // televideo model 921 with sysline same as page & real vi function - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "tvi921", - Columns: 80, - Lines: 24, - Clear: "\x1a", - ShowCursor: "\x1b.3", - AttrOff: "\x1bG0", - Underline: "\x1bG8", - Reverse: "\x1bG4", - PadChar: "\x00", - EnterAcs: "\x1b$", - ExitAcs: "\x1b%%", - SetCursor: "\x1b=%p1%' '%+%c%p2%' '%+%c$<3/>", - CursorBack1: "\b", - CursorUp1: "\v", - KeyUp: "\v", - KeyDown: "\x16", - KeyRight: "\f", - KeyLeft: "\b", - KeyInsert: "\x1bQ", - KeyDelete: "\x1bW", - KeyBackspace: "\b", - KeyClear: "\x1a", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/t/tvi925/term.go b/vendor/github.com/gdamore/tcell/terminfo/t/tvi925/term.go deleted file mode 100644 index 2020ccb9..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/t/tvi925/term.go +++ /dev/null @@ -1,43 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package tvi925 - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // televideo 925 - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "tvi925", - Columns: 80, - Lines: 24, - Bell: "\a", - Clear: "\x1a", - ShowCursor: "\x1b.4", - AttrOff: "\x1bG0", - Underline: "\x1bG8", - Reverse: "\x1bG4", - PadChar: "\x00", - SetCursor: "\x1b=%p1%' '%+%c%p2%' '%+%c", - CursorBack1: "\b", - CursorUp1: "\v", - KeyUp: "\v", - KeyDown: "\x16", - KeyRight: "\f", - KeyLeft: "\b", - KeyInsert: "\x1bQ", - KeyDelete: "\x1bW", - KeyBackspace: "\b", - KeyHome: "\x1e", - KeyF1: "\x01@\r", - KeyF2: "\x01A\r", - KeyF3: "\x01B\r", - KeyF4: "\x01C\r", - KeyF5: "\x01D\r", - KeyF6: "\x01E\r", - KeyF7: "\x01F\r", - KeyF8: "\x01G\r", - KeyF9: "\x01H\r", - KeyClear: "\x1a", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/t/tvi950/term.go b/vendor/github.com/gdamore/tcell/terminfo/t/tvi950/term.go deleted file mode 100644 index fc6f2575..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/t/tvi950/term.go +++ /dev/null @@ -1,46 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package tvi950 - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // televideo 950 - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "tvi950", - Columns: 80, - Lines: 24, - Bell: "\a", - Clear: "\x1b*", - AttrOff: "\x1bG0", - Underline: "\x1bG8", - Reverse: "\x1bG4", - PadChar: "\x00", - AltChars: "b\tc\fd\re\ni\v", - EnterAcs: "\x15", - ExitAcs: "\x18", - SetCursor: "\x1b=%p1%' '%+%c%p2%' '%+%c", - CursorBack1: "\b", - CursorUp1: "\v", - KeyUp: "\v", - KeyDown: "\x16", - KeyRight: "\f", - KeyLeft: "\b", - KeyInsert: "\x1bQ", - KeyDelete: "\x1bW", - KeyBackspace: "\b", - KeyHome: "\x1e", - KeyF1: "\x01@\r", - KeyF2: "\x01A\r", - KeyF3: "\x01B\r", - KeyF4: "\x01C\r", - KeyF5: "\x01D\r", - KeyF6: "\x01E\r", - KeyF7: "\x01F\r", - KeyF8: "\x01G\r", - KeyF9: "\x01H\r", - KeyClear: "\x1b*", - KeyBacktab: "\x1bI", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/t/tvi970/term.go b/vendor/github.com/gdamore/tcell/terminfo/t/tvi970/term.go deleted file mode 100644 index e6a1dfb1..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/t/tvi970/term.go +++ /dev/null @@ -1,40 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package tvi970 - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // televideo 970 - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "tvi970", - Columns: 80, - Lines: 24, - Clear: "\x1b[H\x1b[2J", - EnterCA: "\x1b[?20l\x1b[?7h\x1b[1Q", - AttrOff: "\x1b[m", - Underline: "\x1b[4m", - PadChar: "\x00", - EnterAcs: "\x1b(B", - ExitAcs: "\x1b(B", - SetCursor: "\x1b[%i%p1%d;%p2%df", - CursorBack1: "\b", - CursorUp1: "\x1bM", - KeyUp: "\x1b[A", - KeyDown: "\x1b[B", - KeyRight: "\x1b[C", - KeyLeft: "\x1b[D", - KeyBackspace: "\b", - KeyHome: "\x1b[H", - KeyF1: "\x1b?a", - KeyF2: "\x1b?b", - KeyF3: "\x1b?c", - KeyF4: "\x1b?d", - KeyF5: "\x1b?e", - KeyF6: "\x1b?f", - KeyF7: "\x1b?g", - KeyF8: "\x1b?h", - KeyF9: "\x1b?i", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/terminfo.go b/vendor/github.com/gdamore/tcell/terminfo/terminfo.go deleted file mode 100644 index d0f46e93..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/terminfo.go +++ /dev/null @@ -1,781 +0,0 @@ -// Copyright 2019 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package terminfo - -import ( - "bytes" - "errors" - "fmt" - "io" - "os" - "strconv" - "strings" - "sync" - "time" -) - -var ( - // ErrTermNotFound indicates that a suitable terminal entry could - // not be found. This can result from either not having TERM set, - // or from the TERM failing to support certain minimal functionality, - // in particular absolute cursor addressability (the cup capability) - // is required. For example, legacy "adm3" lacks this capability, - // whereas the slightly newer "adm3a" supports it. This failure - // occurs most often with "dumb". - ErrTermNotFound = errors.New("terminal entry not found") -) - -// Terminfo represents a terminfo entry. Note that we use friendly names -// in Go, but when we write out JSON, we use the same names as terminfo. -// The name, aliases and smous, rmous fields do not come from terminfo directly. -type Terminfo struct { - Name string - Aliases []string - Columns int // cols - Lines int // lines - Colors int // colors - Bell string // bell - Clear string // clear - EnterCA string // smcup - ExitCA string // rmcup - ShowCursor string // cnorm - HideCursor string // civis - AttrOff string // sgr0 - Underline string // smul - Bold string // bold - Blink string // blink - Reverse string // rev - Dim string // dim - EnterKeypad string // smkx - ExitKeypad string // rmkx - SetFg string // setaf - SetBg string // setab - SetCursor string // cup - CursorBack1 string // cub1 - CursorUp1 string // cuu1 - PadChar string // pad - KeyBackspace string // kbs - KeyF1 string // kf1 - KeyF2 string // kf2 - KeyF3 string // kf3 - KeyF4 string // kf4 - KeyF5 string // kf5 - KeyF6 string // kf6 - KeyF7 string // kf7 - KeyF8 string // kf8 - KeyF9 string // kf9 - KeyF10 string // kf10 - KeyF11 string // kf11 - KeyF12 string // kf12 - KeyF13 string // kf13 - KeyF14 string // kf14 - KeyF15 string // kf15 - KeyF16 string // kf16 - KeyF17 string // kf17 - KeyF18 string // kf18 - KeyF19 string // kf19 - KeyF20 string // kf20 - KeyF21 string // kf21 - KeyF22 string // kf22 - KeyF23 string // kf23 - KeyF24 string // kf24 - KeyF25 string // kf25 - KeyF26 string // kf26 - KeyF27 string // kf27 - KeyF28 string // kf28 - KeyF29 string // kf29 - KeyF30 string // kf30 - KeyF31 string // kf31 - KeyF32 string // kf32 - KeyF33 string // kf33 - KeyF34 string // kf34 - KeyF35 string // kf35 - KeyF36 string // kf36 - KeyF37 string // kf37 - KeyF38 string // kf38 - KeyF39 string // kf39 - KeyF40 string // kf40 - KeyF41 string // kf41 - KeyF42 string // kf42 - KeyF43 string // kf43 - KeyF44 string // kf44 - KeyF45 string // kf45 - KeyF46 string // kf46 - KeyF47 string // kf47 - KeyF48 string // kf48 - KeyF49 string // kf49 - KeyF50 string // kf50 - KeyF51 string // kf51 - KeyF52 string // kf52 - KeyF53 string // kf53 - KeyF54 string // kf54 - KeyF55 string // kf55 - KeyF56 string // kf56 - KeyF57 string // kf57 - KeyF58 string // kf58 - KeyF59 string // kf59 - KeyF60 string // kf60 - KeyF61 string // kf61 - KeyF62 string // kf62 - KeyF63 string // kf63 - KeyF64 string // kf64 - KeyInsert string // kich1 - KeyDelete string // kdch1 - KeyHome string // khome - KeyEnd string // kend - KeyHelp string // khlp - KeyPgUp string // kpp - KeyPgDn string // knp - KeyUp string // kcuu1 - KeyDown string // kcud1 - KeyLeft string // kcub1 - KeyRight string // kcuf1 - KeyBacktab string // kcbt - KeyExit string // kext - KeyClear string // kclr - KeyPrint string // kprt - KeyCancel string // kcan - Mouse string // kmous - MouseMode string // XM - AltChars string // acsc - EnterAcs string // smacs - ExitAcs string // rmacs - EnableAcs string // enacs - KeyShfRight string // kRIT - KeyShfLeft string // kLFT - KeyShfHome string // kHOM - KeyShfEnd string // kEND - - // These are non-standard extensions to terminfo. This includes - // true color support, and some additional keys. Its kind of bizarre - // that shifted variants of left and right exist, but not up and down. - // Terminal support for these are going to vary amongst XTerm - // emulations, so don't depend too much on them in your application. - - SetFgBg string // setfgbg - SetFgBgRGB string // setfgbgrgb - SetFgRGB string // setfrgb - SetBgRGB string // setbrgb - KeyShfUp string // shift-up - KeyShfDown string // shift-down - KeyCtrlUp string // ctrl-up - KeyCtrlDown string // ctrl-left - KeyCtrlRight string // ctrl-right - KeyCtrlLeft string // ctrl-left - KeyMetaUp string // meta-up - KeyMetaDown string // meta-left - KeyMetaRight string // meta-right - KeyMetaLeft string // meta-left - KeyAltUp string // alt-up - KeyAltDown string // alt-left - KeyAltRight string // alt-right - KeyAltLeft string // alt-left - KeyCtrlHome string - KeyCtrlEnd string - KeyMetaHome string - KeyMetaEnd string - KeyAltHome string - KeyAltEnd string - KeyAltShfUp string - KeyAltShfDown string - KeyAltShfLeft string - KeyAltShfRight string - KeyMetaShfUp string - KeyMetaShfDown string - KeyMetaShfLeft string - KeyMetaShfRight string - KeyCtrlShfUp string - KeyCtrlShfDown string - KeyCtrlShfLeft string - KeyCtrlShfRight string - KeyCtrlShfHome string - KeyCtrlShfEnd string - KeyAltShfHome string - KeyAltShfEnd string - KeyMetaShfHome string - KeyMetaShfEnd string -} - -type stackElem struct { - s string - i int - isStr bool - isInt bool -} - -type stack []stackElem - -func (st stack) Push(v string) stack { - e := stackElem{ - s: v, - isStr: true, - } - return append(st, e) -} - -func (st stack) Pop() (string, stack) { - v := "" - if len(st) > 0 { - e := st[len(st)-1] - st = st[:len(st)-1] - if e.isStr { - v = e.s - } else { - v = strconv.Itoa(e.i) - } - } - return v, st -} - -func (st stack) PopInt() (int, stack) { - if len(st) > 0 { - e := st[len(st)-1] - st = st[:len(st)-1] - if e.isInt { - return e.i, st - } else if e.isStr { - i, _ := strconv.Atoi(e.s) - return i, st - } - } - return 0, st -} - -func (st stack) PopBool() (bool, stack) { - if len(st) > 0 { - e := st[len(st)-1] - st = st[:len(st)-1] - if e.isStr { - if e.s == "1" { - return true, st - } - return false, st - } else if e.i == 1 { - return true, st - } else { - return false, st - } - } - return false, st -} - -func (st stack) PushInt(i int) stack { - e := stackElem{ - i: i, - isInt: true, - } - return append(st, e) -} - -func (st stack) PushBool(i bool) stack { - if i { - return st.PushInt(1) - } - return st.PushInt(0) -} - -func nextch(s string, index int) (byte, int) { - if index < len(s) { - return s[index], index + 1 - } - return 0, index -} - -// static vars -var svars [26]string - -// paramsBuffer handles some persistent state for TParam. Technically we -// could probably dispense with this, but caching buffer arrays gives us -// a nice little performance boost. Furthermore, we know that TParam is -// rarely (never?) called re-entrantly, so we can just reuse the same -// buffers, making it thread-safe by stashing a lock. -type paramsBuffer struct { - out bytes.Buffer - buf bytes.Buffer - lk sync.Mutex -} - -// Start initializes the params buffer with the initial string data. -// It also locks the paramsBuffer. The caller must call End() when -// finished. -func (pb *paramsBuffer) Start(s string) { - pb.lk.Lock() - pb.out.Reset() - pb.buf.Reset() - pb.buf.WriteString(s) -} - -// End returns the final output from TParam, but it also releases the lock. -func (pb *paramsBuffer) End() string { - s := pb.out.String() - pb.lk.Unlock() - return s -} - -// NextCh returns the next input character to the expander. -func (pb *paramsBuffer) NextCh() (byte, error) { - return pb.buf.ReadByte() -} - -// PutCh "emits" (rather schedules for output) a single byte character. -func (pb *paramsBuffer) PutCh(ch byte) { - pb.out.WriteByte(ch) -} - -// PutString schedules a string for output. -func (pb *paramsBuffer) PutString(s string) { - pb.out.WriteString(s) -} - -var pb = ¶msBuffer{} - -// TParm takes a terminfo parameterized string, such as setaf or cup, and -// evaluates the string, and returns the result with the parameter -// applied. -func (t *Terminfo) TParm(s string, p ...int) string { - var stk stack - var a, b string - var ai, bi int - var ab bool - var dvars [26]string - var params [9]int - - pb.Start(s) - - // make sure we always have 9 parameters -- makes it easier - // later to skip checks - for i := 0; i < len(params) && i < len(p); i++ { - params[i] = p[i] - } - - nest := 0 - - for { - - ch, err := pb.NextCh() - if err != nil { - break - } - - if ch != '%' { - pb.PutCh(ch) - continue - } - - ch, err = pb.NextCh() - if err != nil { - // XXX Error - break - } - - switch ch { - case '%': // quoted % - pb.PutCh(ch) - - case 'i': // increment both parameters (ANSI cup support) - params[0]++ - params[1]++ - - case 'c', 's': - // NB: these, and 'd' below are special cased for - // efficiency. They could be handled by the richer - // format support below, less efficiently. - a, stk = stk.Pop() - pb.PutString(a) - - case 'd': - ai, stk = stk.PopInt() - pb.PutString(strconv.Itoa(ai)) - - case '0', '1', '2', '3', '4', 'x', 'X', 'o', ':': - // This is pretty suboptimal, but this is rarely used. - // None of the mainstream terminals use any of this, - // and it would surprise me if this code is ever - // executed outside of test cases. - f := "%" - if ch == ':' { - ch, _ = pb.NextCh() - } - f += string(ch) - for ch == '+' || ch == '-' || ch == '#' || ch == ' ' { - ch, _ = pb.NextCh() - f += string(ch) - } - for (ch >= '0' && ch <= '9') || ch == '.' { - ch, _ = pb.NextCh() - f += string(ch) - } - switch ch { - case 'd', 'x', 'X', 'o': - ai, stk = stk.PopInt() - pb.PutString(fmt.Sprintf(f, ai)) - case 'c', 's': - a, stk = stk.Pop() - pb.PutString(fmt.Sprintf(f, a)) - } - - case 'p': // push parameter - ch, _ = pb.NextCh() - ai = int(ch - '1') - if ai >= 0 && ai < len(params) { - stk = stk.PushInt(params[ai]) - } else { - stk = stk.PushInt(0) - } - - case 'P': // pop & store variable - ch, _ = pb.NextCh() - if ch >= 'A' && ch <= 'Z' { - svars[int(ch-'A')], stk = stk.Pop() - } else if ch >= 'a' && ch <= 'z' { - dvars[int(ch-'a')], stk = stk.Pop() - } - - case 'g': // recall & push variable - ch, _ = pb.NextCh() - if ch >= 'A' && ch <= 'Z' { - stk = stk.Push(svars[int(ch-'A')]) - } else if ch >= 'a' && ch <= 'z' { - stk = stk.Push(dvars[int(ch-'a')]) - } - - case '\'': // push(char) - ch, _ = pb.NextCh() - pb.NextCh() // must be ' but we don't check - stk = stk.Push(string(ch)) - - case '{': // push(int) - ai = 0 - ch, _ = pb.NextCh() - for ch >= '0' && ch <= '9' { - ai *= 10 - ai += int(ch - '0') - ch, _ = pb.NextCh() - } - // ch must be '}' but no verification - stk = stk.PushInt(ai) - - case 'l': // push(strlen(pop)) - a, stk = stk.Pop() - stk = stk.PushInt(len(a)) - - case '+': - bi, stk = stk.PopInt() - ai, stk = stk.PopInt() - stk = stk.PushInt(ai + bi) - - case '-': - bi, stk = stk.PopInt() - ai, stk = stk.PopInt() - stk = stk.PushInt(ai - bi) - - case '*': - bi, stk = stk.PopInt() - ai, stk = stk.PopInt() - stk = stk.PushInt(ai * bi) - - case '/': - bi, stk = stk.PopInt() - ai, stk = stk.PopInt() - if bi != 0 { - stk = stk.PushInt(ai / bi) - } else { - stk = stk.PushInt(0) - } - - case 'm': // push(pop mod pop) - bi, stk = stk.PopInt() - ai, stk = stk.PopInt() - if bi != 0 { - stk = stk.PushInt(ai % bi) - } else { - stk = stk.PushInt(0) - } - - case '&': // AND - bi, stk = stk.PopInt() - ai, stk = stk.PopInt() - stk = stk.PushInt(ai & bi) - - case '|': // OR - bi, stk = stk.PopInt() - ai, stk = stk.PopInt() - stk = stk.PushInt(ai | bi) - - case '^': // XOR - bi, stk = stk.PopInt() - ai, stk = stk.PopInt() - stk = stk.PushInt(ai ^ bi) - - case '~': // bit complement - ai, stk = stk.PopInt() - stk = stk.PushInt(ai ^ -1) - - case '!': // logical NOT - ai, stk = stk.PopInt() - stk = stk.PushBool(ai != 0) - - case '=': // numeric compare or string compare - b, stk = stk.Pop() - a, stk = stk.Pop() - stk = stk.PushBool(a == b) - - case '>': // greater than, numeric - bi, stk = stk.PopInt() - ai, stk = stk.PopInt() - stk = stk.PushBool(ai > bi) - - case '<': // less than, numeric - bi, stk = stk.PopInt() - ai, stk = stk.PopInt() - stk = stk.PushBool(ai < bi) - - case '?': // start conditional - - case 't': - ab, stk = stk.PopBool() - if ab { - // just keep going - break - } - nest = 0 - ifloop: - // this loop consumes everything until we hit our else, - // or the end of the conditional - for { - ch, err = pb.NextCh() - if err != nil { - break - } - if ch != '%' { - continue - } - ch, _ = pb.NextCh() - switch ch { - case ';': - if nest == 0 { - break ifloop - } - nest-- - case '?': - nest++ - case 'e': - if nest == 0 { - break ifloop - } - } - } - - case 'e': - // if we got here, it means we didn't use the else - // in the 't' case above, and we should skip until - // the end of the conditional - nest = 0 - elloop: - for { - ch, err = pb.NextCh() - if err != nil { - break - } - if ch != '%' { - continue - } - ch, _ = pb.NextCh() - switch ch { - case ';': - if nest == 0 { - break elloop - } - nest-- - case '?': - nest++ - } - } - - case ';': // endif - - } - } - - return pb.End() -} - -// TPuts emits the string to the writer, but expands inline padding -// indications (of the form $<[delay]> where [delay] is msec) to -// a suitable time (unless the terminfo string indicates this isn't needed -// by specifying npc - no padding). All Terminfo based strings should be -// emitted using this function. -func (t *Terminfo) TPuts(w io.Writer, s string) { - for { - beg := strings.Index(s, "$<") - if beg < 0 { - // Most strings don't need padding, which is good news! - io.WriteString(w, s) - return - } - io.WriteString(w, s[:beg]) - s = s[beg+2:] - end := strings.Index(s, ">") - if end < 0 { - // unterminated.. just emit bytes unadulterated - io.WriteString(w, "$<"+s) - return - } - val := s[:end] - s = s[end+1:] - padus := 0 - unit := time.Millisecond - dot := false - loop: - for i := range val { - switch val[i] { - case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': - padus *= 10 - padus += int(val[i] - '0') - if dot { - unit /= 10 - } - case '.': - if !dot { - dot = true - } else { - break loop - } - default: - break loop - } - } - - // Curses historically uses padding to achieve "fine grained" - // delays. We have much better clocks these days, and so we - // do not rely on padding but simply sleep a bit. - if len(t.PadChar) > 0 { - time.Sleep(unit * time.Duration(padus)) - } - } -} - -// TGoto returns a string suitable for addressing the cursor at the given -// row and column. The origin 0, 0 is in the upper left corner of the screen. -func (t *Terminfo) TGoto(col, row int) string { - return t.TParm(t.SetCursor, row, col) -} - -// TColor returns a string corresponding to the given foreground and background -// colors. Either fg or bg can be set to -1 to elide. -func (t *Terminfo) TColor(fi, bi int) string { - rv := "" - // As a special case, we map bright colors to lower versions if the - // color table only holds 8. For the remaining 240 colors, the user - // is out of luck. Someday we could create a mapping table, but its - // not worth it. - if t.Colors == 8 { - if fi > 7 && fi < 16 { - fi -= 8 - } - if bi > 7 && bi < 16 { - bi -= 8 - } - } - if t.Colors > fi && fi >= 0 { - rv += t.TParm(t.SetFg, fi) - } - if t.Colors > bi && bi >= 0 { - rv += t.TParm(t.SetBg, bi) - } - return rv -} - -var ( - dblock sync.Mutex - terminfos = make(map[string]*Terminfo) - aliases = make(map[string]string) -) - -// AddTerminfo can be called to register a new Terminfo entry. -func AddTerminfo(t *Terminfo) { - dblock.Lock() - terminfos[t.Name] = t - for _, x := range t.Aliases { - terminfos[x] = t - } - dblock.Unlock() -} - -// LookupTerminfo attempts to find a definition for the named $TERM. -func LookupTerminfo(name string) (*Terminfo, error) { - if name == "" { - // else on windows: index out of bounds - // on the name[0] reference below - return nil, ErrTermNotFound - } - - addtruecolor := false - switch os.Getenv("COLORTERM") { - case "truecolor", "24bit", "24-bit": - addtruecolor = true - } - dblock.Lock() - t := terminfos[name] - dblock.Unlock() - - // If the name ends in -truecolor, then fabricate an entry - // from the corresponding -256color, -color, or bare terminal. - if t == nil && strings.HasSuffix(name, "-truecolor") { - - suffixes := []string{ - "-256color", - "-88color", - "-color", - "", - } - base := name[:len(name)-len("-truecolor")] - for _, s := range suffixes { - if t, _ = LookupTerminfo(base + s); t != nil { - addtruecolor = true - break - } - } - } - - if t == nil { - return nil, ErrTermNotFound - } - - switch os.Getenv("TCELL_TRUECOLOR") { - case "": - case "disable": - addtruecolor = false - default: - addtruecolor = true - } - - // If the user has requested 24-bit color with $COLORTERM, then - // amend the value (unless already present). This means we don't - // need to have a value present. - if addtruecolor && - t.SetFgBgRGB == "" && - t.SetFgRGB == "" && - t.SetBgRGB == "" { - - // Supply vanilla ISO 8613-6:1994 24-bit color sequences. - t.SetFgRGB = "\x1b[38;2;%p1%d;%p2%d;%p3%dm" - t.SetBgRGB = "\x1b[48;2;%p1%d;%p2%d;%p3%dm" - t.SetFgBgRGB = "\x1b[38;2;%p1%d;%p2%d;%p3%d;" + - "48;2;%p4%d;%p5%d;%p6%dm" - } - - return t, nil -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/v/vt100/term.go b/vendor/github.com/gdamore/tcell/terminfo/v/vt100/term.go deleted file mode 100644 index 666e8b11..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/v/vt100/term.go +++ /dev/null @@ -1,48 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package vt100 - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // dec vt100 (w/advanced video) - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "vt100", - Aliases: []string{"vt100-am"}, - Columns: 80, - Lines: 24, - Bell: "\a", - Clear: "\x1b[H\x1b[J$<50>", - AttrOff: "\x1b[m\x0f$<2>", - Underline: "\x1b[4m$<2>", - Bold: "\x1b[1m$<2>", - Blink: "\x1b[5m$<2>", - Reverse: "\x1b[7m$<2>", - EnterKeypad: "\x1b[?1h\x1b=", - ExitKeypad: "\x1b[?1l\x1b>", - PadChar: "\x00", - AltChars: "``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x0e", - ExitAcs: "\x0f", - EnableAcs: "\x1b(B\x1b)0", - SetCursor: "\x1b[%i%p1%d;%p2%dH$<5>", - CursorBack1: "\b", - CursorUp1: "\x1b[A$<2>", - KeyUp: "\x1bOA", - KeyDown: "\x1bOB", - KeyRight: "\x1bOC", - KeyLeft: "\x1bOD", - KeyBackspace: "\b", - KeyF1: "\x1bOP", - KeyF2: "\x1bOQ", - KeyF3: "\x1bOR", - KeyF4: "\x1bOS", - KeyF5: "\x1bOt", - KeyF6: "\x1bOu", - KeyF7: "\x1bOv", - KeyF8: "\x1bOl", - KeyF9: "\x1bOw", - KeyF10: "\x1bOx", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/v/vt102/term.go b/vendor/github.com/gdamore/tcell/terminfo/v/vt102/term.go deleted file mode 100644 index 0dfbe61c..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/v/vt102/term.go +++ /dev/null @@ -1,47 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package vt102 - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // dec vt102 - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "vt102", - Columns: 80, - Lines: 24, - Bell: "\a", - Clear: "\x1b[H\x1b[J$<50>", - AttrOff: "\x1b[m\x0f$<2>", - Underline: "\x1b[4m$<2>", - Bold: "\x1b[1m$<2>", - Blink: "\x1b[5m$<2>", - Reverse: "\x1b[7m$<2>", - EnterKeypad: "\x1b[?1h\x1b=", - ExitKeypad: "\x1b[?1l\x1b>", - PadChar: "\x00", - AltChars: "``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x0e", - ExitAcs: "\x0f", - EnableAcs: "\x1b(B\x1b)0", - SetCursor: "\x1b[%i%p1%d;%p2%dH$<5>", - CursorBack1: "\b", - CursorUp1: "\x1b[A$<2>", - KeyUp: "\x1bOA", - KeyDown: "\x1bOB", - KeyRight: "\x1bOC", - KeyLeft: "\x1bOD", - KeyBackspace: "\b", - KeyF1: "\x1bOP", - KeyF2: "\x1bOQ", - KeyF3: "\x1bOR", - KeyF4: "\x1bOS", - KeyF5: "\x1bOt", - KeyF6: "\x1bOu", - KeyF7: "\x1bOv", - KeyF8: "\x1bOl", - KeyF9: "\x1bOw", - KeyF10: "\x1bOx", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/v/vt220/term.go b/vendor/github.com/gdamore/tcell/terminfo/v/vt220/term.go deleted file mode 100644 index 9104b173..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/v/vt220/term.go +++ /dev/null @@ -1,58 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package vt220 - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // dec vt220 - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "vt220", - Aliases: []string{"vt200"}, - Columns: 80, - Lines: 24, - Bell: "\a", - Clear: "\x1b[H\x1b[J", - AttrOff: "\x1b[m\x1b(B", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - PadChar: "\x00", - AltChars: "``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x1b(0$<2>", - ExitAcs: "\x1b(B$<4>", - EnableAcs: "\x1b)0", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1b[A", - KeyDown: "\x1b[B", - KeyRight: "\x1b[C", - KeyLeft: "\x1b[D", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\b", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1bOP", - KeyF2: "\x1bOQ", - KeyF3: "\x1bOR", - KeyF4: "\x1bOS", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyF13: "\x1b[25~", - KeyF14: "\x1b[26~", - KeyF17: "\x1b[31~", - KeyF18: "\x1b[32~", - KeyF19: "\x1b[33~", - KeyF20: "\x1b[34~", - KeyHelp: "\x1b[28~", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/v/vt320/term.go b/vendor/github.com/gdamore/tcell/terminfo/v/vt320/term.go deleted file mode 100644 index 29bd0d39..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/v/vt320/term.go +++ /dev/null @@ -1,63 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package vt320 - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // dec vt320 7 bit terminal - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "vt320", - Aliases: []string{"vt300"}, - Columns: 80, - Lines: 24, - Bell: "\a", - Clear: "\x1b[H\x1b[2J", - ShowCursor: "\x1b[?25h", - HideCursor: "\x1b[?25l", - AttrOff: "\x1b[m\x1b(B", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - EnterKeypad: "\x1b[?1h\x1b=", - ExitKeypad: "\x1b[?1l\x1b>", - PadChar: "\x00", - AltChars: "``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x1b(0", - ExitAcs: "\x1b(B", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1bOA", - KeyDown: "\x1bOB", - KeyRight: "\x1bOC", - KeyLeft: "\x1bOD", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\xff", - KeyHome: "\x1b[1~", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1bOP", - KeyF2: "\x1bOQ", - KeyF3: "\x1bOR", - KeyF4: "\x1bOS", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyF13: "\x1b[25~", - KeyF14: "\x1b[26~", - KeyF15: "\x1b[28~", - KeyF16: "\x1b[29~", - KeyF17: "\x1b[31~", - KeyF18: "\x1b[32~", - KeyF19: "\x1b[33~", - KeyF20: "\x1b[34~", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/v/vt400/term.go b/vendor/github.com/gdamore/tcell/terminfo/v/vt400/term.go deleted file mode 100644 index 4c7b8bc0..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/v/vt400/term.go +++ /dev/null @@ -1,46 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package vt400 - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // dec vt400 24x80 column autowrap - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "vt400", - Aliases: []string{"vt400-24", "dec-vt400"}, - Columns: 80, - Lines: 24, - Clear: "\x1b[H\x1b[J$<10/>", - ShowCursor: "\x1b[?25h", - HideCursor: "\x1b[?25l", - AttrOff: "\x1b[m\x1b(B", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - EnterKeypad: "\x1b[?1h\x1b=", - ExitKeypad: "\x1b[?1l\x1b>", - PadChar: "\x00", - AltChars: "``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x1b(0", - ExitAcs: "\x1b(B", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1bOA", - KeyDown: "\x1bOB", - KeyRight: "\x1bOC", - KeyLeft: "\x1bOD", - KeyBackspace: "\b", - KeyF1: "\x1bOP", - KeyF2: "\x1bOQ", - KeyF3: "\x1bOR", - KeyF4: "\x1bOS", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/v/vt420/term.go b/vendor/github.com/gdamore/tcell/terminfo/v/vt420/term.go deleted file mode 100644 index 5ec1cef7..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/v/vt420/term.go +++ /dev/null @@ -1,53 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package vt420 - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // DEC VT420 - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "vt420", - Columns: 80, - Lines: 24, - Bell: "\a", - Clear: "\x1b[H\x1b[2J$<50>", - ShowCursor: "\x1b[?25h", - HideCursor: "\x1b[?25l", - AttrOff: "\x1b[m\x1b(B$<2>", - Underline: "\x1b[4m", - Bold: "\x1b[1m$<2>", - Blink: "\x1b[5m$<2>", - Reverse: "\x1b[7m$<2>", - EnterKeypad: "\x1b=", - ExitKeypad: "\x1b>", - PadChar: "\x00", - AltChars: "``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x1b(0$<2>", - ExitAcs: "\x1b(B$<4>", - EnableAcs: "\x1b)0", - SetCursor: "\x1b[%i%p1%d;%p2%dH$<10>", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1b[A", - KeyDown: "\x1b[B", - KeyRight: "\x1b[C", - KeyLeft: "\x1b[D", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\b", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1bOP", - KeyF2: "\x1bOQ", - KeyF3: "\x1bOR", - KeyF4: "\x1bOS", - KeyF5: "\x1b[17~", - KeyF6: "\x1b[18~", - KeyF7: "\x1b[19~", - KeyF8: "\x1b[20~", - KeyF9: "\x1b[21~", - KeyF10: "\x1b[29~", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/v/vt52/term.go b/vendor/github.com/gdamore/tcell/terminfo/v/vt52/term.go deleted file mode 100644 index c9560aef..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/v/vt52/term.go +++ /dev/null @@ -1,29 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package vt52 - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // dec vt52 - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "vt52", - Columns: 80, - Lines: 24, - Bell: "\a", - Clear: "\x1bH\x1bJ", - PadChar: "\x00", - AltChars: "+h.k0affggolpnqprrss", - EnterAcs: "\x1bF", - ExitAcs: "\x1bG", - SetCursor: "\x1bY%p1%' '%+%c%p2%' '%+%c", - CursorBack1: "\x1bD", - CursorUp1: "\x1bA", - KeyUp: "\x1bA", - KeyDown: "\x1bB", - KeyRight: "\x1bC", - KeyLeft: "\x1bD", - KeyBackspace: "\b", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/w/wy50/term.go b/vendor/github.com/gdamore/tcell/terminfo/w/wy50/term.go deleted file mode 100644 index 4521932f..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/w/wy50/term.go +++ /dev/null @@ -1,59 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package wy50 - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // Wyse 50 - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "wy50", - Aliases: []string{"wyse50"}, - Columns: 80, - Lines: 24, - Bell: "\a", - Clear: "\x1b+$<20>", - ShowCursor: "\x1b`1", - HideCursor: "\x1b`0", - AttrOff: "\x1b(\x1bH\x03", - Dim: "\x1b`7\x1b)", - Reverse: "\x1b`6\x1b)", - PadChar: "\x00", - AltChars: "0wa_h[jukslrmqnxqzttuyv]wpxv", - EnterAcs: "\x1bH\x02", - ExitAcs: "\x1bH\x03", - SetCursor: "\x1b=%p1%' '%+%c%p2%' '%+%c", - CursorBack1: "\b", - CursorUp1: "\v", - KeyUp: "\v", - KeyDown: "\n", - KeyRight: "\f", - KeyLeft: "\b", - KeyInsert: "\x1bQ", - KeyDelete: "\x1bW", - KeyBackspace: "\b", - KeyHome: "\x1e", - KeyPgUp: "\x1bJ", - KeyPgDn: "\x1bK", - KeyF1: "\x01@\r", - KeyF2: "\x01A\r", - KeyF3: "\x01B\r", - KeyF4: "\x01C\r", - KeyF5: "\x01D\r", - KeyF6: "\x01E\r", - KeyF7: "\x01F\r", - KeyF8: "\x01G\r", - KeyF9: "\x01H\r", - KeyF10: "\x01I\r", - KeyF11: "\x01J\r", - KeyF12: "\x01K\r", - KeyF13: "\x01L\r", - KeyF14: "\x01M\r", - KeyF15: "\x01N\r", - KeyF16: "\x01O\r", - KeyPrint: "\x1bP", - KeyBacktab: "\x1bI", - KeyShfHome: "\x1b{", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/w/wy60/term.go b/vendor/github.com/gdamore/tcell/terminfo/w/wy60/term.go deleted file mode 100644 index ff519408..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/w/wy60/term.go +++ /dev/null @@ -1,63 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package wy60 - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // Wyse 60 - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "wy60", - Aliases: []string{"wyse60"}, - Columns: 80, - Lines: 24, - Bell: "\a", - Clear: "\x1b+$<100>", - EnterCA: "\x1bw0", - ExitCA: "\x1bw1", - ShowCursor: "\x1b`1", - HideCursor: "\x1b`0", - AttrOff: "\x1b(\x1bH\x03\x1bG0\x1bcD", - Underline: "\x1bG8", - Dim: "\x1bGp", - Blink: "\x1bG2", - Reverse: "\x1bG4", - PadChar: "\x00", - AltChars: "+/,.0[a2fxgqh1ihjYk?lZm@nEqDtCu4vAwBx3yszr{c~~", - EnterAcs: "\x1bcE", - ExitAcs: "\x1bcD", - SetCursor: "\x1b=%p1%' '%+%c%p2%' '%+%c", - CursorBack1: "\b", - CursorUp1: "\v", - KeyUp: "\v", - KeyDown: "\n", - KeyRight: "\f", - KeyLeft: "\b", - KeyInsert: "\x1bQ", - KeyDelete: "\x1bW", - KeyBackspace: "\b", - KeyHome: "\x1e", - KeyPgUp: "\x1bJ", - KeyPgDn: "\x1bK", - KeyF1: "\x01@\r", - KeyF2: "\x01A\r", - KeyF3: "\x01B\r", - KeyF4: "\x01C\r", - KeyF5: "\x01D\r", - KeyF6: "\x01E\r", - KeyF7: "\x01F\r", - KeyF8: "\x01G\r", - KeyF9: "\x01H\r", - KeyF10: "\x01I\r", - KeyF11: "\x01J\r", - KeyF12: "\x01K\r", - KeyF13: "\x01L\r", - KeyF14: "\x01M\r", - KeyF15: "\x01N\r", - KeyF16: "\x01O\r", - KeyPrint: "\x1bP", - KeyBacktab: "\x1bI", - KeyShfHome: "\x1b{", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/w/wy99_ansi/term.go b/vendor/github.com/gdamore/tcell/terminfo/w/wy99_ansi/term.go deleted file mode 100644 index fbe85699..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/w/wy99_ansi/term.go +++ /dev/null @@ -1,114 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package wy99_ansi - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // Wyse WY-99GT in ansi mode (int'l PC keyboard) - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "wy99-ansi", - Columns: 80, - Lines: 25, - Bell: "\a", - Clear: "\x1b[H\x1b[J$<200>", - ShowCursor: "\x1b[34h\x1b[?25h", - HideCursor: "\x1b[?25l", - AttrOff: "\x1b[m\x0f\x1b[\"q", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Dim: "\x1b[2m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - EnterKeypad: "\x1b[?1h", - ExitKeypad: "\x1b[?1l", - PadChar: "\x00", - AltChars: "``aaffggjjkkllmmnnooqqssttuuvvwwxx{{||}}~~", - EnterAcs: "\x0e", - ExitAcs: "\x0f", - EnableAcs: "\x1b)0", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b$<1>", - CursorUp1: "\x1bM", - KeyUp: "\x1bOA", - KeyDown: "\x1bOB", - KeyRight: "\x1bOC", - KeyLeft: "\x1bOD", - KeyBackspace: "\b", - KeyF1: "\x1bOP", - KeyF2: "\x1bOQ", - KeyF3: "\x1bOR", - KeyF4: "\x1bOS", - KeyF5: "\x1b[M", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyF17: "\x1b[K", - KeyF18: "\x1b[31~", - KeyF19: "\x1b[32~", - KeyF20: "\x1b[33~", - KeyF21: "\x1b[34~", - KeyF22: "\x1b[35~", - KeyF23: "\x1b[1~", - KeyF24: "\x1b[2~", - KeyBacktab: "\x1b[z", - }) - - // Wyse WY-99GT in ansi mode (US PC keyboard) - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "wy99a-ansi", - Columns: 80, - Lines: 25, - Bell: "\a", - Clear: "\x1b[H\x1b[J$<200>", - ShowCursor: "\x1b[34h\x1b[?25h", - HideCursor: "\x1b[?25l", - AttrOff: "\x1b[m\x0f\x1b[\"q", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Dim: "\x1b[2m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - EnterKeypad: "\x1b[?1h", - ExitKeypad: "\x1b[?1l", - PadChar: "\x00", - AltChars: "``aaffggjjkkllmmnnooqqssttuuvvwwxx{{||}}~~", - EnterAcs: "\x0e", - ExitAcs: "\x0f", - EnableAcs: "\x1b)0", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b$<1>", - CursorUp1: "\x1bM", - KeyUp: "\x1bOA", - KeyDown: "\x1bOB", - KeyRight: "\x1bOC", - KeyLeft: "\x1bOD", - KeyBackspace: "\b", - KeyF1: "\x1bOP", - KeyF2: "\x1bOQ", - KeyF3: "\x1bOR", - KeyF4: "\x1bOS", - KeyF5: "\x1b[M", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyF17: "\x1b[K", - KeyF18: "\x1b[31~", - KeyF19: "\x1b[32~", - KeyF20: "\x1b[33~", - KeyF21: "\x1b[34~", - KeyF22: "\x1b[35~", - KeyF23: "\x1b[1~", - KeyF24: "\x1b[2~", - KeyBacktab: "\x1b[z", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/x/xfce/term.go b/vendor/github.com/gdamore/tcell/terminfo/x/xfce/term.go deleted file mode 100644 index 219cc6fd..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/x/xfce/term.go +++ /dev/null @@ -1,156 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package xfce - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // Xfce Terminal - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "xfce", - Columns: 80, - Lines: 24, - Colors: 8, - Bell: "\a", - Clear: "\x1b[H\x1b[2J", - EnterCA: "\x1b7\x1b[?47h", - ExitCA: "\x1b[2J\x1b[?47l\x1b8", - ShowCursor: "\x1b[?25h", - HideCursor: "\x1b[?25l", - AttrOff: "\x1b[0m\x0f", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Reverse: "\x1b[7m", - EnterKeypad: "\x1b[?1h\x1b=", - ExitKeypad: "\x1b[?1l\x1b>", - SetFg: "\x1b[3%p1%dm", - SetBg: "\x1b[4%p1%dm", - SetFgBg: "\x1b[3%p1%d;4%p2%dm", - PadChar: "\x00", - AltChars: "``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x0e", - ExitAcs: "\x0f", - EnableAcs: "\x1b)0", - Mouse: "\x1b[M", - MouseMode: "%?%p1%{1}%=%t%'h'%Pa%e%'l'%Pa%;\x1b[?1000%ga%c\x1b[?1002%ga%c\x1b[?1003%ga%c\x1b[?1006%ga%c", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1bOA", - KeyDown: "\x1bOB", - KeyRight: "\x1bOC", - KeyLeft: "\x1bOD", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\xff", - KeyHome: "\x1bOH", - KeyEnd: "\x1bOF", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1bOP", - KeyF2: "\x1bOQ", - KeyF3: "\x1bOR", - KeyF4: "\x1bOS", - KeyF5: "\x1b[15~", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyF13: "\x1bO1;2P", - KeyF14: "\x1bO1;2Q", - KeyF15: "\x1bO1;2R", - KeyF16: "\x1bO1;2S", - KeyF17: "\x1b[15;2~", - KeyF18: "\x1b[17;2~", - KeyF19: "\x1b[18;2~", - KeyF20: "\x1b[19;2~", - KeyF21: "\x1b[20;2~", - KeyF22: "\x1b[21;2~", - KeyF23: "\x1b[23;2~", - KeyF24: "\x1b[24;2~", - KeyF25: "\x1bO1;5P", - KeyF26: "\x1bO1;5Q", - KeyF27: "\x1bO1;5R", - KeyF28: "\x1bO1;5S", - KeyF29: "\x1b[15;5~", - KeyF30: "\x1b[17;5~", - KeyF31: "\x1b[18;5~", - KeyF32: "\x1b[19;5~", - KeyF33: "\x1b[20;5~", - KeyF34: "\x1b[21;5~", - KeyF35: "\x1b[23;5~", - KeyF36: "\x1b[24;5~", - KeyF37: "\x1bO1;6P", - KeyF38: "\x1bO1;6Q", - KeyF39: "\x1bO1;6R", - KeyF40: "\x1bO1;6S", - KeyF41: "\x1b[15;6~", - KeyF42: "\x1b[17;6~", - KeyF43: "\x1b[18;6~", - KeyF44: "\x1b[19;6~", - KeyF45: "\x1b[20;6~", - KeyF46: "\x1b[21;6~", - KeyF47: "\x1b[23;6~", - KeyF48: "\x1b[24;6~", - KeyF49: "\x1bO1;3P", - KeyF50: "\x1bO1;3Q", - KeyF51: "\x1bO1;3R", - KeyF52: "\x1bO1;3S", - KeyF53: "\x1b[15;3~", - KeyF54: "\x1b[17;3~", - KeyF55: "\x1b[18;3~", - KeyF56: "\x1b[19;3~", - KeyF57: "\x1b[20;3~", - KeyF58: "\x1b[21;3~", - KeyF59: "\x1b[23;3~", - KeyF60: "\x1b[24;3~", - KeyF61: "\x1bO1;4P", - KeyF62: "\x1bO1;4Q", - KeyF63: "\x1bO1;4R", - KeyBacktab: "\x1b[Z", - KeyShfLeft: "\x1b[1;2D", - KeyShfRight: "\x1b[1;2C", - KeyShfUp: "\x1b[1;2A", - KeyShfDown: "\x1b[1;2B", - KeyCtrlLeft: "\x1b[1;5D", - KeyCtrlRight: "\x1b[1;5C", - KeyCtrlUp: "\x1b[1;5A", - KeyCtrlDown: "\x1b[1;5B", - KeyMetaLeft: "\x1b[1;9D", - KeyMetaRight: "\x1b[1;9C", - KeyMetaUp: "\x1b[1;9A", - KeyMetaDown: "\x1b[1;9B", - KeyAltLeft: "\x1b[1;3D", - KeyAltRight: "\x1b[1;3C", - KeyAltUp: "\x1b[1;3A", - KeyAltDown: "\x1b[1;3B", - KeyAltShfLeft: "\x1b[1;4D", - KeyAltShfRight: "\x1b[1;4C", - KeyAltShfUp: "\x1b[1;4A", - KeyAltShfDown: "\x1b[1;4B", - KeyMetaShfLeft: "\x1b[1;10D", - KeyMetaShfRight: "\x1b[1;10C", - KeyMetaShfUp: "\x1b[1;10A", - KeyMetaShfDown: "\x1b[1;10B", - KeyCtrlShfLeft: "\x1b[1;6D", - KeyCtrlShfRight: "\x1b[1;6C", - KeyCtrlShfUp: "\x1b[1;6A", - KeyCtrlShfDown: "\x1b[1;6B", - KeyShfHome: "\x1b[1;2H", - KeyShfEnd: "\x1b[1;2F", - KeyCtrlHome: "\x1b[1;5H", - KeyCtrlEnd: "\x1b[1;5F", - KeyAltHome: "\x1b[1;9H", - KeyAltEnd: "\x1b[1;9F", - KeyCtrlShfHome: "\x1b[1;6H", - KeyCtrlShfEnd: "\x1b[1;6F", - KeyMetaShfHome: "\x1b[1;10H", - KeyMetaShfEnd: "\x1b[1;10F", - KeyAltShfHome: "\x1b[1;4H", - KeyAltShfEnd: "\x1b[1;4F", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/x/xnuppc/term.go b/vendor/github.com/gdamore/tcell/terminfo/x/xnuppc/term.go deleted file mode 100644 index b1f9ad78..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/x/xnuppc/term.go +++ /dev/null @@ -1,34 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package xnuppc - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // Darwin PowerPC Console (color) - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "xnuppc", - Aliases: []string{"darwin"}, - Colors: 8, - Clear: "\x1b[H\x1b[J", - AttrOff: "\x1b[m", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Reverse: "\x1b[7m", - EnterKeypad: "\x1b[?1h\x1b=", - ExitKeypad: "\x1b[?1l\x1b>", - SetFg: "\x1b[3%p1%dm", - SetBg: "\x1b[4%p1%dm", - SetFgBg: "\x1b[3%p1%d;4%p2%dm", - PadChar: "\x00", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\x1b[D", - CursorUp1: "\x1b[A", - KeyUp: "\x1bOA", - KeyDown: "\x1bOB", - KeyRight: "\x1bOC", - KeyLeft: "\x1bOD", - KeyBackspace: "\xff", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/x/xterm/term.go b/vendor/github.com/gdamore/tcell/terminfo/x/xterm/term.go deleted file mode 100644 index 0e4c175f..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/x/xterm/term.go +++ /dev/null @@ -1,453 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package xterm - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // X11 terminal emulator - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "xterm", - Aliases: []string{"xterm-debian"}, - Columns: 80, - Lines: 24, - Colors: 8, - Bell: "\a", - Clear: "\x1b[H\x1b[2J", - EnterCA: "\x1b[?1049h\x1b[22;0;0t", - ExitCA: "\x1b[?1049l\x1b[23;0;0t", - ShowCursor: "\x1b[?12l\x1b[?25h", - HideCursor: "\x1b[?25l", - AttrOff: "\x1b(B\x1b[m", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Dim: "\x1b[2m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - EnterKeypad: "\x1b[?1h\x1b=", - ExitKeypad: "\x1b[?1l\x1b>", - SetFg: "\x1b[3%p1%dm", - SetBg: "\x1b[4%p1%dm", - SetFgBg: "\x1b[3%p1%d;4%p2%dm", - AltChars: "``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x1b(0", - ExitAcs: "\x1b(B", - Mouse: "\x1b[M", - MouseMode: "%?%p1%{1}%=%t%'h'%Pa%e%'l'%Pa%;\x1b[?1000%ga%c\x1b[?1002%ga%c\x1b[?1003%ga%c\x1b[?1006%ga%c", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1bOA", - KeyDown: "\x1bOB", - KeyRight: "\x1bOC", - KeyLeft: "\x1bOD", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\xff", - KeyHome: "\x1bOH", - KeyEnd: "\x1bOF", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1bOP", - KeyF2: "\x1bOQ", - KeyF3: "\x1bOR", - KeyF4: "\x1bOS", - KeyF5: "\x1b[15~", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyF13: "\x1b[1;2P", - KeyF14: "\x1b[1;2Q", - KeyF15: "\x1b[1;2R", - KeyF16: "\x1b[1;2S", - KeyF17: "\x1b[15;2~", - KeyF18: "\x1b[17;2~", - KeyF19: "\x1b[18;2~", - KeyF20: "\x1b[19;2~", - KeyF21: "\x1b[20;2~", - KeyF22: "\x1b[21;2~", - KeyF23: "\x1b[23;2~", - KeyF24: "\x1b[24;2~", - KeyF25: "\x1b[1;5P", - KeyF26: "\x1b[1;5Q", - KeyF27: "\x1b[1;5R", - KeyF28: "\x1b[1;5S", - KeyF29: "\x1b[15;5~", - KeyF30: "\x1b[17;5~", - KeyF31: "\x1b[18;5~", - KeyF32: "\x1b[19;5~", - KeyF33: "\x1b[20;5~", - KeyF34: "\x1b[21;5~", - KeyF35: "\x1b[23;5~", - KeyF36: "\x1b[24;5~", - KeyF37: "\x1b[1;6P", - KeyF38: "\x1b[1;6Q", - KeyF39: "\x1b[1;6R", - KeyF40: "\x1b[1;6S", - KeyF41: "\x1b[15;6~", - KeyF42: "\x1b[17;6~", - KeyF43: "\x1b[18;6~", - KeyF44: "\x1b[19;6~", - KeyF45: "\x1b[20;6~", - KeyF46: "\x1b[21;6~", - KeyF47: "\x1b[23;6~", - KeyF48: "\x1b[24;6~", - KeyF49: "\x1b[1;3P", - KeyF50: "\x1b[1;3Q", - KeyF51: "\x1b[1;3R", - KeyF52: "\x1b[1;3S", - KeyF53: "\x1b[15;3~", - KeyF54: "\x1b[17;3~", - KeyF55: "\x1b[18;3~", - KeyF56: "\x1b[19;3~", - KeyF57: "\x1b[20;3~", - KeyF58: "\x1b[21;3~", - KeyF59: "\x1b[23;3~", - KeyF60: "\x1b[24;3~", - KeyF61: "\x1b[1;4P", - KeyF62: "\x1b[1;4Q", - KeyF63: "\x1b[1;4R", - KeyBacktab: "\x1b[Z", - KeyShfLeft: "\x1b[1;2D", - KeyShfRight: "\x1b[1;2C", - KeyShfUp: "\x1b[1;2A", - KeyShfDown: "\x1b[1;2B", - KeyCtrlLeft: "\x1b[1;5D", - KeyCtrlRight: "\x1b[1;5C", - KeyCtrlUp: "\x1b[1;5A", - KeyCtrlDown: "\x1b[1;5B", - KeyMetaLeft: "\x1b[1;9D", - KeyMetaRight: "\x1b[1;9C", - KeyMetaUp: "\x1b[1;9A", - KeyMetaDown: "\x1b[1;9B", - KeyAltLeft: "\x1b[1;3D", - KeyAltRight: "\x1b[1;3C", - KeyAltUp: "\x1b[1;3A", - KeyAltDown: "\x1b[1;3B", - KeyAltShfLeft: "\x1b[1;4D", - KeyAltShfRight: "\x1b[1;4C", - KeyAltShfUp: "\x1b[1;4A", - KeyAltShfDown: "\x1b[1;4B", - KeyMetaShfLeft: "\x1b[1;10D", - KeyMetaShfRight: "\x1b[1;10C", - KeyMetaShfUp: "\x1b[1;10A", - KeyMetaShfDown: "\x1b[1;10B", - KeyCtrlShfLeft: "\x1b[1;6D", - KeyCtrlShfRight: "\x1b[1;6C", - KeyCtrlShfUp: "\x1b[1;6A", - KeyCtrlShfDown: "\x1b[1;6B", - KeyShfHome: "\x1b[1;2H", - KeyShfEnd: "\x1b[1;2F", - KeyCtrlHome: "\x1b[1;5H", - KeyCtrlEnd: "\x1b[1;5F", - KeyAltHome: "\x1b[1;9H", - KeyAltEnd: "\x1b[1;9F", - KeyCtrlShfHome: "\x1b[1;6H", - KeyCtrlShfEnd: "\x1b[1;6F", - KeyMetaShfHome: "\x1b[1;10H", - KeyMetaShfEnd: "\x1b[1;10F", - KeyAltShfHome: "\x1b[1;4H", - KeyAltShfEnd: "\x1b[1;4F", - }) - - // xterm with 88 colors - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "xterm-88color", - Columns: 80, - Lines: 24, - Colors: 88, - Bell: "\a", - Clear: "\x1b[H\x1b[2J", - EnterCA: "\x1b[?1049h\x1b[22;0;0t", - ExitCA: "\x1b[?1049l\x1b[23;0;0t", - ShowCursor: "\x1b[?12l\x1b[?25h", - HideCursor: "\x1b[?25l", - AttrOff: "\x1b(B\x1b[m", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Dim: "\x1b[2m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - EnterKeypad: "\x1b[?1h\x1b=", - ExitKeypad: "\x1b[?1l\x1b>", - SetFg: "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m", - SetBg: "\x1b[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m", - SetFgBg: "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;;%?%p2%{8}%<%t4%p2%d%e%p2%{16}%<%t10%p2%{8}%-%d%e48;5;%p2%d%;m", - AltChars: "``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x1b(0", - ExitAcs: "\x1b(B", - Mouse: "\x1b[M", - MouseMode: "%?%p1%{1}%=%t%'h'%Pa%e%'l'%Pa%;\x1b[?1000%ga%c\x1b[?1002%ga%c\x1b[?1003%ga%c\x1b[?1006%ga%c", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1bOA", - KeyDown: "\x1bOB", - KeyRight: "\x1bOC", - KeyLeft: "\x1bOD", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\xff", - KeyHome: "\x1bOH", - KeyEnd: "\x1bOF", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1bOP", - KeyF2: "\x1bOQ", - KeyF3: "\x1bOR", - KeyF4: "\x1bOS", - KeyF5: "\x1b[15~", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyF13: "\x1b[1;2P", - KeyF14: "\x1b[1;2Q", - KeyF15: "\x1b[1;2R", - KeyF16: "\x1b[1;2S", - KeyF17: "\x1b[15;2~", - KeyF18: "\x1b[17;2~", - KeyF19: "\x1b[18;2~", - KeyF20: "\x1b[19;2~", - KeyF21: "\x1b[20;2~", - KeyF22: "\x1b[21;2~", - KeyF23: "\x1b[23;2~", - KeyF24: "\x1b[24;2~", - KeyF25: "\x1b[1;5P", - KeyF26: "\x1b[1;5Q", - KeyF27: "\x1b[1;5R", - KeyF28: "\x1b[1;5S", - KeyF29: "\x1b[15;5~", - KeyF30: "\x1b[17;5~", - KeyF31: "\x1b[18;5~", - KeyF32: "\x1b[19;5~", - KeyF33: "\x1b[20;5~", - KeyF34: "\x1b[21;5~", - KeyF35: "\x1b[23;5~", - KeyF36: "\x1b[24;5~", - KeyF37: "\x1b[1;6P", - KeyF38: "\x1b[1;6Q", - KeyF39: "\x1b[1;6R", - KeyF40: "\x1b[1;6S", - KeyF41: "\x1b[15;6~", - KeyF42: "\x1b[17;6~", - KeyF43: "\x1b[18;6~", - KeyF44: "\x1b[19;6~", - KeyF45: "\x1b[20;6~", - KeyF46: "\x1b[21;6~", - KeyF47: "\x1b[23;6~", - KeyF48: "\x1b[24;6~", - KeyF49: "\x1b[1;3P", - KeyF50: "\x1b[1;3Q", - KeyF51: "\x1b[1;3R", - KeyF52: "\x1b[1;3S", - KeyF53: "\x1b[15;3~", - KeyF54: "\x1b[17;3~", - KeyF55: "\x1b[18;3~", - KeyF56: "\x1b[19;3~", - KeyF57: "\x1b[20;3~", - KeyF58: "\x1b[21;3~", - KeyF59: "\x1b[23;3~", - KeyF60: "\x1b[24;3~", - KeyF61: "\x1b[1;4P", - KeyF62: "\x1b[1;4Q", - KeyF63: "\x1b[1;4R", - KeyBacktab: "\x1b[Z", - KeyShfLeft: "\x1b[1;2D", - KeyShfRight: "\x1b[1;2C", - KeyShfUp: "\x1b[1;2A", - KeyShfDown: "\x1b[1;2B", - KeyCtrlLeft: "\x1b[1;5D", - KeyCtrlRight: "\x1b[1;5C", - KeyCtrlUp: "\x1b[1;5A", - KeyCtrlDown: "\x1b[1;5B", - KeyMetaLeft: "\x1b[1;9D", - KeyMetaRight: "\x1b[1;9C", - KeyMetaUp: "\x1b[1;9A", - KeyMetaDown: "\x1b[1;9B", - KeyAltLeft: "\x1b[1;3D", - KeyAltRight: "\x1b[1;3C", - KeyAltUp: "\x1b[1;3A", - KeyAltDown: "\x1b[1;3B", - KeyAltShfLeft: "\x1b[1;4D", - KeyAltShfRight: "\x1b[1;4C", - KeyAltShfUp: "\x1b[1;4A", - KeyAltShfDown: "\x1b[1;4B", - KeyMetaShfLeft: "\x1b[1;10D", - KeyMetaShfRight: "\x1b[1;10C", - KeyMetaShfUp: "\x1b[1;10A", - KeyMetaShfDown: "\x1b[1;10B", - KeyCtrlShfLeft: "\x1b[1;6D", - KeyCtrlShfRight: "\x1b[1;6C", - KeyCtrlShfUp: "\x1b[1;6A", - KeyCtrlShfDown: "\x1b[1;6B", - KeyShfHome: "\x1b[1;2H", - KeyShfEnd: "\x1b[1;2F", - KeyCtrlHome: "\x1b[1;5H", - KeyCtrlEnd: "\x1b[1;5F", - KeyAltHome: "\x1b[1;9H", - KeyAltEnd: "\x1b[1;9F", - KeyCtrlShfHome: "\x1b[1;6H", - KeyCtrlShfEnd: "\x1b[1;6F", - KeyMetaShfHome: "\x1b[1;10H", - KeyMetaShfEnd: "\x1b[1;10F", - KeyAltShfHome: "\x1b[1;4H", - KeyAltShfEnd: "\x1b[1;4F", - }) - - // xterm with 256 colors - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "xterm-256color", - Columns: 80, - Lines: 24, - Colors: 256, - Bell: "\a", - Clear: "\x1b[H\x1b[2J", - EnterCA: "\x1b[?1049h\x1b[22;0;0t", - ExitCA: "\x1b[?1049l\x1b[23;0;0t", - ShowCursor: "\x1b[?12l\x1b[?25h", - HideCursor: "\x1b[?25l", - AttrOff: "\x1b(B\x1b[m", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Dim: "\x1b[2m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - EnterKeypad: "\x1b[?1h\x1b=", - ExitKeypad: "\x1b[?1l\x1b>", - SetFg: "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m", - SetBg: "\x1b[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m", - SetFgBg: "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;;%?%p2%{8}%<%t4%p2%d%e%p2%{16}%<%t10%p2%{8}%-%d%e48;5;%p2%d%;m", - AltChars: "``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x1b(0", - ExitAcs: "\x1b(B", - Mouse: "\x1b[M", - MouseMode: "%?%p1%{1}%=%t%'h'%Pa%e%'l'%Pa%;\x1b[?1000%ga%c\x1b[?1002%ga%c\x1b[?1003%ga%c\x1b[?1006%ga%c", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1bOA", - KeyDown: "\x1bOB", - KeyRight: "\x1bOC", - KeyLeft: "\x1bOD", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\xff", - KeyHome: "\x1bOH", - KeyEnd: "\x1bOF", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1bOP", - KeyF2: "\x1bOQ", - KeyF3: "\x1bOR", - KeyF4: "\x1bOS", - KeyF5: "\x1b[15~", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyF13: "\x1b[1;2P", - KeyF14: "\x1b[1;2Q", - KeyF15: "\x1b[1;2R", - KeyF16: "\x1b[1;2S", - KeyF17: "\x1b[15;2~", - KeyF18: "\x1b[17;2~", - KeyF19: "\x1b[18;2~", - KeyF20: "\x1b[19;2~", - KeyF21: "\x1b[20;2~", - KeyF22: "\x1b[21;2~", - KeyF23: "\x1b[23;2~", - KeyF24: "\x1b[24;2~", - KeyF25: "\x1b[1;5P", - KeyF26: "\x1b[1;5Q", - KeyF27: "\x1b[1;5R", - KeyF28: "\x1b[1;5S", - KeyF29: "\x1b[15;5~", - KeyF30: "\x1b[17;5~", - KeyF31: "\x1b[18;5~", - KeyF32: "\x1b[19;5~", - KeyF33: "\x1b[20;5~", - KeyF34: "\x1b[21;5~", - KeyF35: "\x1b[23;5~", - KeyF36: "\x1b[24;5~", - KeyF37: "\x1b[1;6P", - KeyF38: "\x1b[1;6Q", - KeyF39: "\x1b[1;6R", - KeyF40: "\x1b[1;6S", - KeyF41: "\x1b[15;6~", - KeyF42: "\x1b[17;6~", - KeyF43: "\x1b[18;6~", - KeyF44: "\x1b[19;6~", - KeyF45: "\x1b[20;6~", - KeyF46: "\x1b[21;6~", - KeyF47: "\x1b[23;6~", - KeyF48: "\x1b[24;6~", - KeyF49: "\x1b[1;3P", - KeyF50: "\x1b[1;3Q", - KeyF51: "\x1b[1;3R", - KeyF52: "\x1b[1;3S", - KeyF53: "\x1b[15;3~", - KeyF54: "\x1b[17;3~", - KeyF55: "\x1b[18;3~", - KeyF56: "\x1b[19;3~", - KeyF57: "\x1b[20;3~", - KeyF58: "\x1b[21;3~", - KeyF59: "\x1b[23;3~", - KeyF60: "\x1b[24;3~", - KeyF61: "\x1b[1;4P", - KeyF62: "\x1b[1;4Q", - KeyF63: "\x1b[1;4R", - KeyBacktab: "\x1b[Z", - KeyShfLeft: "\x1b[1;2D", - KeyShfRight: "\x1b[1;2C", - KeyShfUp: "\x1b[1;2A", - KeyShfDown: "\x1b[1;2B", - KeyCtrlLeft: "\x1b[1;5D", - KeyCtrlRight: "\x1b[1;5C", - KeyCtrlUp: "\x1b[1;5A", - KeyCtrlDown: "\x1b[1;5B", - KeyMetaLeft: "\x1b[1;9D", - KeyMetaRight: "\x1b[1;9C", - KeyMetaUp: "\x1b[1;9A", - KeyMetaDown: "\x1b[1;9B", - KeyAltLeft: "\x1b[1;3D", - KeyAltRight: "\x1b[1;3C", - KeyAltUp: "\x1b[1;3A", - KeyAltDown: "\x1b[1;3B", - KeyAltShfLeft: "\x1b[1;4D", - KeyAltShfRight: "\x1b[1;4C", - KeyAltShfUp: "\x1b[1;4A", - KeyAltShfDown: "\x1b[1;4B", - KeyMetaShfLeft: "\x1b[1;10D", - KeyMetaShfRight: "\x1b[1;10C", - KeyMetaShfUp: "\x1b[1;10A", - KeyMetaShfDown: "\x1b[1;10B", - KeyCtrlShfLeft: "\x1b[1;6D", - KeyCtrlShfRight: "\x1b[1;6C", - KeyCtrlShfUp: "\x1b[1;6A", - KeyCtrlShfDown: "\x1b[1;6B", - KeyShfHome: "\x1b[1;2H", - KeyShfEnd: "\x1b[1;2F", - KeyCtrlHome: "\x1b[1;5H", - KeyCtrlEnd: "\x1b[1;5F", - KeyAltHome: "\x1b[1;9H", - KeyAltEnd: "\x1b[1;9F", - KeyCtrlShfHome: "\x1b[1;6H", - KeyCtrlShfEnd: "\x1b[1;6F", - KeyMetaShfHome: "\x1b[1;10H", - KeyMetaShfEnd: "\x1b[1;10F", - KeyAltShfHome: "\x1b[1;4H", - KeyAltShfEnd: "\x1b[1;4F", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/x/xterm_kitty/term.go b/vendor/github.com/gdamore/tcell/terminfo/x/xterm_kitty/term.go deleted file mode 100644 index 8a8d69b8..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/x/xterm_kitty/term.go +++ /dev/null @@ -1,155 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package xterm_kitty - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // KovIdTTY - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "xterm-kitty", - Columns: 80, - Lines: 24, - Colors: 256, - Bell: "\a", - Clear: "\x1b[H\x1b[2J", - EnterCA: "\x1b[?1049h", - ExitCA: "\x1b[?1049l", - ShowCursor: "\x1b[?12l\x1b[?25h", - HideCursor: "\x1b[?25l", - AttrOff: "\x1b(B\x1b[m", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Dim: "\x1b[2m", - Reverse: "\x1b[7m", - EnterKeypad: "\x1b[?1h", - ExitKeypad: "\x1b[?1l", - SetFg: "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m", - SetBg: "\x1b[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m", - SetFgBg: "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;;%?%p2%{8}%<%t4%p2%d%e%p2%{16}%<%t10%p2%{8}%-%d%e48;5;%p2%d%;m", - AltChars: "++,,--..00``aaffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x1b(0", - ExitAcs: "\x1b(B", - Mouse: "\x1b[M", - MouseMode: "%?%p1%{1}%=%t%'h'%Pa%e%'l'%Pa%;\x1b[?1000%ga%c\x1b[?1002%ga%c\x1b[?1003%ga%c\x1b[?1006%ga%c", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1bOA", - KeyDown: "\x1bOB", - KeyRight: "\x1bOC", - KeyLeft: "\x1bOD", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\xff", - KeyHome: "\x1bOH", - KeyEnd: "\x1bOF", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1bOP", - KeyF2: "\x1bOQ", - KeyF3: "\x1bOR", - KeyF4: "\x1bOS", - KeyF5: "\x1b[15~", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyF13: "\x1b[1;2P", - KeyF14: "\x1b[1;2Q", - KeyF15: "\x1b[1;2R", - KeyF16: "\x1b[1;2S", - KeyF17: "\x1b[15;2~", - KeyF18: "\x1b[17;2~", - KeyF19: "\x1b[18;2~", - KeyF20: "\x1b[19;2~", - KeyF21: "\x1b[20;2~", - KeyF22: "\x1b[21;2~", - KeyF23: "\x1b[23;2~", - KeyF24: "\x1b[24;2~", - KeyF25: "\x1b[1;5P", - KeyF26: "\x1b[1;5Q", - KeyF27: "\x1b[1;5R", - KeyF28: "\x1b[1;5S", - KeyF29: "\x1b[15;5~", - KeyF30: "\x1b[17;5~", - KeyF31: "\x1b[18;5~", - KeyF32: "\x1b[19;5~", - KeyF33: "\x1b[20;5~", - KeyF34: "\x1b[21;5~", - KeyF35: "\x1b[23;5~", - KeyF36: "\x1b[24;5~", - KeyF37: "\x1b[1;6P", - KeyF38: "\x1b[1;6Q", - KeyF39: "\x1b[1;6R", - KeyF40: "\x1b[1;6S", - KeyF41: "\x1b[15;6~", - KeyF42: "\x1b[17;6~", - KeyF43: "\x1b[18;6~", - KeyF44: "\x1b[19;6~", - KeyF45: "\x1b[20;6~", - KeyF46: "\x1b[21;6~", - KeyF47: "\x1b[23;6~", - KeyF48: "\x1b[24;6~", - KeyF49: "\x1b[1;3P", - KeyF50: "\x1b[1;3Q", - KeyF51: "\x1b[1;3R", - KeyF52: "\x1b[1;3S", - KeyF53: "\x1b[15;3~", - KeyF54: "\x1b[17;3~", - KeyF55: "\x1b[18;3~", - KeyF56: "\x1b[19;3~", - KeyF57: "\x1b[20;3~", - KeyF58: "\x1b[21;3~", - KeyF59: "\x1b[23;3~", - KeyF60: "\x1b[24;3~", - KeyF61: "\x1b[1;4P", - KeyF62: "\x1b[1;4Q", - KeyF63: "\x1b[1;4R", - KeyBacktab: "\x1b[Z", - KeyShfLeft: "\x1b[1;2D", - KeyShfRight: "\x1b[1;2C", - KeyShfUp: "\x1b[1;2A", - KeyShfDown: "\x1b[1;2B", - KeyCtrlLeft: "\x1b[1;5D", - KeyCtrlRight: "\x1b[1;5C", - KeyCtrlUp: "\x1b[1;5A", - KeyCtrlDown: "\x1b[1;5B", - KeyMetaLeft: "\x1b[1;9D", - KeyMetaRight: "\x1b[1;9C", - KeyMetaUp: "\x1b[1;9A", - KeyMetaDown: "\x1b[1;9B", - KeyAltLeft: "\x1b[1;3D", - KeyAltRight: "\x1b[1;3C", - KeyAltUp: "\x1b[1;3A", - KeyAltDown: "\x1b[1;3B", - KeyAltShfLeft: "\x1b[1;4D", - KeyAltShfRight: "\x1b[1;4C", - KeyAltShfUp: "\x1b[1;4A", - KeyAltShfDown: "\x1b[1;4B", - KeyMetaShfLeft: "\x1b[1;10D", - KeyMetaShfRight: "\x1b[1;10C", - KeyMetaShfUp: "\x1b[1;10A", - KeyMetaShfDown: "\x1b[1;10B", - KeyCtrlShfLeft: "\x1b[1;6D", - KeyCtrlShfRight: "\x1b[1;6C", - KeyCtrlShfUp: "\x1b[1;6A", - KeyCtrlShfDown: "\x1b[1;6B", - KeyShfHome: "\x1b[1;2H", - KeyShfEnd: "\x1b[1;2F", - KeyCtrlHome: "\x1b[1;5H", - KeyCtrlEnd: "\x1b[1;5F", - KeyAltHome: "\x1b[1;9H", - KeyAltEnd: "\x1b[1;9F", - KeyCtrlShfHome: "\x1b[1;6H", - KeyCtrlShfEnd: "\x1b[1;6F", - KeyMetaShfHome: "\x1b[1;10H", - KeyMetaShfEnd: "\x1b[1;10F", - KeyAltShfHome: "\x1b[1;4H", - KeyAltShfEnd: "\x1b[1;4F", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terms_default.go b/vendor/github.com/gdamore/tcell/terms_default.go deleted file mode 100644 index cf2dbaab..00000000 --- a/vendor/github.com/gdamore/tcell/terms_default.go +++ /dev/null @@ -1,23 +0,0 @@ -// +build !tcell_minimal - -// Copyright 2019 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tcell - -import ( - // This imports the default terminal entries. To disable, use the - // tcell_minimal build tag. - _ "github.com/gdamore/tcell/terminfo/extended" -) diff --git a/vendor/github.com/gdamore/tcell/terms_dynamic.go b/vendor/github.com/gdamore/tcell/terms_dynamic.go deleted file mode 100644 index a06c087c..00000000 --- a/vendor/github.com/gdamore/tcell/terms_dynamic.go +++ /dev/null @@ -1,37 +0,0 @@ -// +build !tcell_minimal,!nacl,!js,!zos,!plan9,!windows,!android - -// Copyright 2019 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tcell - -import ( - // This imports a dynamic version of the terminal database, which - // is built using infocmp. This relies on a working installation - // of infocmp (typically supplied with ncurses). We only do this - // for systems likely to have that -- i.e. UNIX based hosts. We - // also don't support Android here, because you really don't want - // to run external programs there. Generally the android terminals - // will be automatically included anyway. - "github.com/gdamore/tcell/terminfo" - "github.com/gdamore/tcell/terminfo/dynamic" -) - -func loadDynamicTerminfo(term string) (*terminfo.Terminfo, error) { - ti, _, e := dynamic.LoadTerminfo(term) - if e != nil { - return nil, e - } - return ti, nil -} diff --git a/vendor/github.com/gdamore/tcell/terms_static.go b/vendor/github.com/gdamore/tcell/terms_static.go deleted file mode 100644 index 379dbe1b..00000000 --- a/vendor/github.com/gdamore/tcell/terms_static.go +++ /dev/null @@ -1,27 +0,0 @@ -// +build tcell_minimal nacl js zos plan9 windows android - -// Copyright 2019 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tcell - -import ( - "errors" - - "github.com/gdamore/tcell/terminfo" -) - -func loadDynamicTerminfo(term string) (*terminfo.Terminfo, error) { - return nil, errors.New("terminal type unsupported") -} diff --git a/vendor/github.com/gdamore/tcell/tscreen.go b/vendor/github.com/gdamore/tcell/tscreen.go deleted file mode 100644 index b86a6c47..00000000 --- a/vendor/github.com/gdamore/tcell/tscreen.go +++ /dev/null @@ -1,1434 +0,0 @@ -// Copyright 2019 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tcell - -import ( - "bytes" - "io" - "os" - "strconv" - "sync" - "time" - "unicode/utf8" - - "golang.org/x/text/transform" - - "github.com/gdamore/tcell/terminfo" - - // import the stock terminals - _ "github.com/gdamore/tcell/terminfo/base" -) - -// NewTerminfoScreen returns a Screen that uses the stock TTY interface -// and POSIX termios, combined with a terminfo description taken from -// the $TERM environment variable. It returns an error if the terminal -// is not supported for any reason. -// -// For terminals that do not support dynamic resize events, the $LINES -// $COLUMNS environment variables can be set to the actual window size, -// otherwise defaults taken from the terminal database are used. -func NewTerminfoScreen() (Screen, error) { - ti, e := terminfo.LookupTerminfo(os.Getenv("TERM")) - if e != nil { - ti, e = loadDynamicTerminfo(os.Getenv("TERM")) - if e != nil { - return nil, e - } - terminfo.AddTerminfo(ti) - } - t := &tScreen{ti: ti} - - t.keyexist = make(map[Key]bool) - t.keycodes = make(map[string]*tKeyCode) - if len(ti.Mouse) > 0 { - t.mouse = []byte(ti.Mouse) - } - t.prepareKeys() - t.buildAcsMap() - t.sigwinch = make(chan os.Signal, 10) - t.fallback = make(map[rune]string) - for k, v := range RuneFallbacks { - t.fallback[k] = v - } - - return t, nil -} - -// tKeyCode represents a combination of a key code and modifiers. -type tKeyCode struct { - key Key - mod ModMask -} - -// tScreen represents a screen backed by a terminfo implementation. -type tScreen struct { - ti *terminfo.Terminfo - h int - w int - fini bool - cells CellBuffer - in *os.File - out *os.File - buffering bool // true if we are collecting writes to buf instead of sending directly to out - buf bytes.Buffer - curstyle Style - style Style - evch chan Event - sigwinch chan os.Signal - quit chan struct{} - indoneq chan struct{} - keyexist map[Key]bool - keycodes map[string]*tKeyCode - keychan chan []byte - keytimer *time.Timer - keyexpire time.Time - cx int - cy int - mouse []byte - clear bool - cursorx int - cursory int - tiosp *termiosPrivate - wasbtn bool - acs map[rune]string - charset string - encoder transform.Transformer - decoder transform.Transformer - fallback map[rune]string - colors map[Color]Color - palette []Color - truecolor bool - escaped bool - buttondn bool - - sync.Mutex -} - -func (t *tScreen) Init() error { - t.evch = make(chan Event, 10) - t.indoneq = make(chan struct{}) - t.keychan = make(chan []byte, 10) - t.keytimer = time.NewTimer(time.Millisecond * 50) - t.charset = "UTF-8" - - t.charset = getCharset() - if enc := GetEncoding(t.charset); enc != nil { - t.encoder = enc.NewEncoder() - t.decoder = enc.NewDecoder() - } else { - return ErrNoCharset - } - ti := t.ti - - // environment overrides - w := ti.Columns - h := ti.Lines - if i, _ := strconv.Atoi(os.Getenv("LINES")); i != 0 { - h = i - } - if i, _ := strconv.Atoi(os.Getenv("COLUMNS")); i != 0 { - w = i - } - if e := t.termioInit(); e != nil { - return e - } - - if t.ti.SetFgBgRGB != "" || t.ti.SetFgRGB != "" || t.ti.SetBgRGB != "" { - t.truecolor = true - } - // A user who wants to have his themes honored can - // set this environment variable. - if os.Getenv("TCELL_TRUECOLOR") == "disable" { - t.truecolor = false - } - if !t.truecolor { - t.colors = make(map[Color]Color) - t.palette = make([]Color, t.Colors()) - for i := 0; i < t.Colors(); i++ { - t.palette[i] = Color(i) - // identity map for our builtin colors - t.colors[Color(i)] = Color(i) - } - } - - t.TPuts(ti.EnterCA) - t.TPuts(ti.HideCursor) - t.TPuts(ti.EnableAcs) - t.TPuts(ti.Clear) - - t.quit = make(chan struct{}) - - t.Lock() - t.cx = -1 - t.cy = -1 - t.style = StyleDefault - t.cells.Resize(w, h) - t.cursorx = -1 - t.cursory = -1 - t.resize() - t.Unlock() - - go t.mainLoop() - go t.inputLoop() - - return nil -} - -func (t *tScreen) prepareKeyMod(key Key, mod ModMask, val string) { - if val != "" { - // Do not overrride codes that already exist - if _, exist := t.keycodes[val]; !exist { - t.keyexist[key] = true - t.keycodes[val] = &tKeyCode{key: key, mod: mod} - } - } -} - -func (t *tScreen) prepareKey(key Key, val string) { - t.prepareKeyMod(key, ModNone, val) -} - -func (t *tScreen) prepareKeys() { - ti := t.ti - t.prepareKey(KeyBackspace, ti.KeyBackspace) - t.prepareKey(KeyF1, ti.KeyF1) - t.prepareKey(KeyF2, ti.KeyF2) - t.prepareKey(KeyF3, ti.KeyF3) - t.prepareKey(KeyF4, ti.KeyF4) - t.prepareKey(KeyF5, ti.KeyF5) - t.prepareKey(KeyF6, ti.KeyF6) - t.prepareKey(KeyF7, ti.KeyF7) - t.prepareKey(KeyF8, ti.KeyF8) - t.prepareKey(KeyF9, ti.KeyF9) - t.prepareKey(KeyF10, ti.KeyF10) - t.prepareKey(KeyF11, ti.KeyF11) - t.prepareKey(KeyF12, ti.KeyF12) - t.prepareKey(KeyF13, ti.KeyF13) - t.prepareKey(KeyF14, ti.KeyF14) - t.prepareKey(KeyF15, ti.KeyF15) - t.prepareKey(KeyF16, ti.KeyF16) - t.prepareKey(KeyF17, ti.KeyF17) - t.prepareKey(KeyF18, ti.KeyF18) - t.prepareKey(KeyF19, ti.KeyF19) - t.prepareKey(KeyF20, ti.KeyF20) - t.prepareKey(KeyF21, ti.KeyF21) - t.prepareKey(KeyF22, ti.KeyF22) - t.prepareKey(KeyF23, ti.KeyF23) - t.prepareKey(KeyF24, ti.KeyF24) - t.prepareKey(KeyF25, ti.KeyF25) - t.prepareKey(KeyF26, ti.KeyF26) - t.prepareKey(KeyF27, ti.KeyF27) - t.prepareKey(KeyF28, ti.KeyF28) - t.prepareKey(KeyF29, ti.KeyF29) - t.prepareKey(KeyF30, ti.KeyF30) - t.prepareKey(KeyF31, ti.KeyF31) - t.prepareKey(KeyF32, ti.KeyF32) - t.prepareKey(KeyF33, ti.KeyF33) - t.prepareKey(KeyF34, ti.KeyF34) - t.prepareKey(KeyF35, ti.KeyF35) - t.prepareKey(KeyF36, ti.KeyF36) - t.prepareKey(KeyF37, ti.KeyF37) - t.prepareKey(KeyF38, ti.KeyF38) - t.prepareKey(KeyF39, ti.KeyF39) - t.prepareKey(KeyF40, ti.KeyF40) - t.prepareKey(KeyF41, ti.KeyF41) - t.prepareKey(KeyF42, ti.KeyF42) - t.prepareKey(KeyF43, ti.KeyF43) - t.prepareKey(KeyF44, ti.KeyF44) - t.prepareKey(KeyF45, ti.KeyF45) - t.prepareKey(KeyF46, ti.KeyF46) - t.prepareKey(KeyF47, ti.KeyF47) - t.prepareKey(KeyF48, ti.KeyF48) - t.prepareKey(KeyF49, ti.KeyF49) - t.prepareKey(KeyF50, ti.KeyF50) - t.prepareKey(KeyF51, ti.KeyF51) - t.prepareKey(KeyF52, ti.KeyF52) - t.prepareKey(KeyF53, ti.KeyF53) - t.prepareKey(KeyF54, ti.KeyF54) - t.prepareKey(KeyF55, ti.KeyF55) - t.prepareKey(KeyF56, ti.KeyF56) - t.prepareKey(KeyF57, ti.KeyF57) - t.prepareKey(KeyF58, ti.KeyF58) - t.prepareKey(KeyF59, ti.KeyF59) - t.prepareKey(KeyF60, ti.KeyF60) - t.prepareKey(KeyF61, ti.KeyF61) - t.prepareKey(KeyF62, ti.KeyF62) - t.prepareKey(KeyF63, ti.KeyF63) - t.prepareKey(KeyF64, ti.KeyF64) - t.prepareKey(KeyInsert, ti.KeyInsert) - t.prepareKey(KeyDelete, ti.KeyDelete) - t.prepareKey(KeyHome, ti.KeyHome) - t.prepareKey(KeyEnd, ti.KeyEnd) - t.prepareKey(KeyUp, ti.KeyUp) - t.prepareKey(KeyDown, ti.KeyDown) - t.prepareKey(KeyLeft, ti.KeyLeft) - t.prepareKey(KeyRight, ti.KeyRight) - t.prepareKey(KeyPgUp, ti.KeyPgUp) - t.prepareKey(KeyPgDn, ti.KeyPgDn) - t.prepareKey(KeyHelp, ti.KeyHelp) - t.prepareKey(KeyPrint, ti.KeyPrint) - t.prepareKey(KeyCancel, ti.KeyCancel) - t.prepareKey(KeyExit, ti.KeyExit) - t.prepareKey(KeyBacktab, ti.KeyBacktab) - - t.prepareKeyMod(KeyRight, ModShift, ti.KeyShfRight) - t.prepareKeyMod(KeyLeft, ModShift, ti.KeyShfLeft) - t.prepareKeyMod(KeyUp, ModShift, ti.KeyShfUp) - t.prepareKeyMod(KeyDown, ModShift, ti.KeyShfDown) - t.prepareKeyMod(KeyHome, ModShift, ti.KeyShfHome) - t.prepareKeyMod(KeyEnd, ModShift, ti.KeyShfEnd) - - t.prepareKeyMod(KeyRight, ModCtrl, ti.KeyCtrlRight) - t.prepareKeyMod(KeyLeft, ModCtrl, ti.KeyCtrlLeft) - t.prepareKeyMod(KeyUp, ModCtrl, ti.KeyCtrlUp) - t.prepareKeyMod(KeyDown, ModCtrl, ti.KeyCtrlDown) - t.prepareKeyMod(KeyHome, ModCtrl, ti.KeyCtrlHome) - t.prepareKeyMod(KeyEnd, ModCtrl, ti.KeyCtrlEnd) - - t.prepareKeyMod(KeyRight, ModAlt, ti.KeyAltRight) - t.prepareKeyMod(KeyLeft, ModAlt, ti.KeyAltLeft) - t.prepareKeyMod(KeyUp, ModAlt, ti.KeyAltUp) - t.prepareKeyMod(KeyDown, ModAlt, ti.KeyAltDown) - t.prepareKeyMod(KeyHome, ModAlt, ti.KeyAltHome) - t.prepareKeyMod(KeyEnd, ModAlt, ti.KeyAltEnd) - - t.prepareKeyMod(KeyRight, ModAlt, ti.KeyMetaRight) - t.prepareKeyMod(KeyLeft, ModAlt, ti.KeyMetaLeft) - t.prepareKeyMod(KeyUp, ModAlt, ti.KeyMetaUp) - t.prepareKeyMod(KeyDown, ModAlt, ti.KeyMetaDown) - t.prepareKeyMod(KeyHome, ModAlt, ti.KeyMetaHome) - t.prepareKeyMod(KeyEnd, ModAlt, ti.KeyMetaEnd) - - t.prepareKeyMod(KeyRight, ModAlt|ModShift, ti.KeyAltShfRight) - t.prepareKeyMod(KeyLeft, ModAlt|ModShift, ti.KeyAltShfLeft) - t.prepareKeyMod(KeyUp, ModAlt|ModShift, ti.KeyAltShfUp) - t.prepareKeyMod(KeyDown, ModAlt|ModShift, ti.KeyAltShfDown) - t.prepareKeyMod(KeyHome, ModAlt|ModShift, ti.KeyAltShfHome) - t.prepareKeyMod(KeyEnd, ModAlt|ModShift, ti.KeyAltShfEnd) - - t.prepareKeyMod(KeyRight, ModAlt|ModShift, ti.KeyMetaShfRight) - t.prepareKeyMod(KeyLeft, ModAlt|ModShift, ti.KeyMetaShfLeft) - t.prepareKeyMod(KeyUp, ModAlt|ModShift, ti.KeyMetaShfUp) - t.prepareKeyMod(KeyDown, ModAlt|ModShift, ti.KeyMetaShfDown) - t.prepareKeyMod(KeyHome, ModAlt|ModShift, ti.KeyMetaShfHome) - t.prepareKeyMod(KeyEnd, ModAlt|ModShift, ti.KeyMetaShfEnd) - - t.prepareKeyMod(KeyRight, ModCtrl|ModShift, ti.KeyCtrlShfRight) - t.prepareKeyMod(KeyLeft, ModCtrl|ModShift, ti.KeyCtrlShfLeft) - t.prepareKeyMod(KeyUp, ModCtrl|ModShift, ti.KeyCtrlShfUp) - t.prepareKeyMod(KeyDown, ModCtrl|ModShift, ti.KeyCtrlShfDown) - t.prepareKeyMod(KeyHome, ModCtrl|ModShift, ti.KeyCtrlShfHome) - t.prepareKeyMod(KeyEnd, ModCtrl|ModShift, ti.KeyCtrlShfEnd) - - // Sadly, xterm handling of keycodes is somewhat erratic. In - // particular, different codes are sent depending on application - // mode is in use or not, and the entries for many of these are - // simply absent from terminfo on many systems. So we insert - // a number of escape sequences if they are not already used, in - // order to have the widest correct usage. Note that prepareKey - // will not inject codes if the escape sequence is already known. - // We also only do this for terminals that have the application - // mode present. - - // Cursor mode - if ti.EnterKeypad != "" { - t.prepareKey(KeyUp, "\x1b[A") - t.prepareKey(KeyDown, "\x1b[B") - t.prepareKey(KeyRight, "\x1b[C") - t.prepareKey(KeyLeft, "\x1b[D") - t.prepareKey(KeyEnd, "\x1b[F") - t.prepareKey(KeyHome, "\x1b[H") - t.prepareKey(KeyDelete, "\x1b[3~") - t.prepareKey(KeyHome, "\x1b[1~") - t.prepareKey(KeyEnd, "\x1b[4~") - t.prepareKey(KeyPgUp, "\x1b[5~") - t.prepareKey(KeyPgDn, "\x1b[6~") - - // Application mode - t.prepareKey(KeyUp, "\x1bOA") - t.prepareKey(KeyDown, "\x1bOB") - t.prepareKey(KeyRight, "\x1bOC") - t.prepareKey(KeyLeft, "\x1bOD") - t.prepareKey(KeyHome, "\x1bOH") - } - -outer: - // Add key mappings for control keys. - for i := 0; i < ' '; i++ { - // Do not insert direct key codes for ambiguous keys. - // For example, ESC is used for lots of other keys, so - // when parsing this we don't want to fast path handling - // of it, but instead wait a bit before parsing it as in - // isolation. - for esc := range t.keycodes { - if []byte(esc)[0] == byte(i) { - continue outer - } - } - - t.keyexist[Key(i)] = true - - mod := ModCtrl - switch Key(i) { - case KeyBS, KeyTAB, KeyESC, KeyCR: - // directly typeable- no control sequence - mod = ModNone - } - t.keycodes[string(rune(i))] = &tKeyCode{key: Key(i), mod: mod} - } -} - -func (t *tScreen) Fini() { - t.Lock() - defer t.Unlock() - - ti := t.ti - t.cells.Resize(0, 0) - t.TPuts(ti.ShowCursor) - t.TPuts(ti.AttrOff) - t.TPuts(ti.Clear) - t.TPuts(ti.ExitCA) - t.TPuts(ti.ExitKeypad) - t.TPuts(ti.TParm(ti.MouseMode, 0)) - t.curstyle = Style(-1) - t.clear = false - t.fini = true - - select { - case <-t.quit: - // do nothing, already closed - - default: - close(t.quit) - } - - t.termioFini() -} - -func (t *tScreen) SetStyle(style Style) { - t.Lock() - if !t.fini { - t.style = style - } - t.Unlock() -} - -func (t *tScreen) Clear() { - t.Fill(' ', t.style) -} - -func (t *tScreen) Fill(r rune, style Style) { - t.Lock() - if !t.fini { - t.cells.Fill(r, style) - } - t.Unlock() -} - -func (t *tScreen) SetContent(x, y int, mainc rune, combc []rune, style Style) { - t.Lock() - if !t.fini { - t.cells.SetContent(x, y, mainc, combc, style) - } - t.Unlock() -} - -func (t *tScreen) GetContent(x, y int) (rune, []rune, Style, int) { - t.Lock() - mainc, combc, style, width := t.cells.GetContent(x, y) - t.Unlock() - return mainc, combc, style, width -} - -func (t *tScreen) SetCell(x, y int, style Style, ch ...rune) { - if len(ch) > 0 { - t.SetContent(x, y, ch[0], ch[1:], style) - } else { - t.SetContent(x, y, ' ', nil, style) - } -} - -func (t *tScreen) encodeRune(r rune, buf []byte) []byte { - - nb := make([]byte, 6) - ob := make([]byte, 6) - num := utf8.EncodeRune(ob, r) - ob = ob[:num] - dst := 0 - var err error - if enc := t.encoder; enc != nil { - enc.Reset() - dst, _, err = enc.Transform(nb, ob, true) - } - if err != nil || dst == 0 || nb[0] == '\x1a' { - // Combining characters are elided - if len(buf) == 0 { - if acs, ok := t.acs[r]; ok { - buf = append(buf, []byte(acs)...) - } else if fb, ok := t.fallback[r]; ok { - buf = append(buf, []byte(fb)...) - } else { - buf = append(buf, '?') - } - } - } else { - buf = append(buf, nb[:dst]...) - } - - return buf -} - -func (t *tScreen) sendFgBg(fg Color, bg Color) { - ti := t.ti - if ti.Colors == 0 { - return - } - if t.truecolor { - if ti.SetFgBgRGB != "" && - fg != ColorDefault && bg != ColorDefault { - r1, g1, b1 := fg.RGB() - r2, g2, b2 := bg.RGB() - t.TPuts(ti.TParm(ti.SetFgBgRGB, - int(r1), int(g1), int(b1), - int(r2), int(g2), int(b2))) - } else { - if fg != ColorDefault && ti.SetFgRGB != "" { - r, g, b := fg.RGB() - t.TPuts(ti.TParm(ti.SetFgRGB, - int(r), int(g), int(b))) - } - if bg != ColorDefault && ti.SetBgRGB != "" { - r, g, b := bg.RGB() - t.TPuts(ti.TParm(ti.SetBgRGB, - int(r), int(g), int(b))) - } - } - return - } - - if fg != ColorDefault { - if v, ok := t.colors[fg]; ok { - fg = v - } else { - v = FindColor(fg, t.palette) - t.colors[fg] = v - fg = v - } - } - - if bg != ColorDefault { - if v, ok := t.colors[bg]; ok { - bg = v - } else { - v = FindColor(bg, t.palette) - t.colors[bg] = v - bg = v - } - } - - if ti.SetFgBg != "" && fg != ColorDefault && bg != ColorDefault { - t.TPuts(ti.TParm(ti.SetFgBg, int(fg), int(bg))) - } else { - if fg != ColorDefault && ti.SetFg != "" { - t.TPuts(ti.TParm(ti.SetFg, int(fg))) - } - if bg != ColorDefault && ti.SetBg != "" { - t.TPuts(ti.TParm(ti.SetBg, int(bg))) - } - } -} - -func (t *tScreen) drawCell(x, y int) int { - - ti := t.ti - - mainc, combc, style, width := t.cells.GetContent(x, y) - if !t.cells.Dirty(x, y) { - return width - } - - if t.cy != y || t.cx != x { - t.TPuts(ti.TGoto(x, y)) - t.cx = x - t.cy = y - } - - if style == StyleDefault { - style = t.style - } - if style != t.curstyle { - fg, bg, attrs := style.Decompose() - - t.TPuts(ti.AttrOff) - - t.sendFgBg(fg, bg) - if attrs&AttrBold != 0 { - t.TPuts(ti.Bold) - } - if attrs&AttrUnderline != 0 { - t.TPuts(ti.Underline) - } - if attrs&AttrReverse != 0 { - t.TPuts(ti.Reverse) - } - if attrs&AttrBlink != 0 { - t.TPuts(ti.Blink) - } - if attrs&AttrDim != 0 { - t.TPuts(ti.Dim) - } - t.curstyle = style - } - // now emit runes - taking care to not overrun width with a - // wide character, and to ensure that we emit exactly one regular - // character followed up by any residual combing characters - - if width < 1 { - width = 1 - } - - var str string - - buf := make([]byte, 0, 6) - - buf = t.encodeRune(mainc, buf) - for _, r := range combc { - buf = t.encodeRune(r, buf) - } - - str = string(buf) - if width > 1 && str == "?" { - // No FullWidth character support - str = "? " - t.cx = -1 - } - - // XXX: check for hazeltine not being able to display ~ - - if x > t.w-width { - // too wide to fit; emit a single space instead - width = 1 - str = " " - } - t.writeString(str) - t.cx += width - t.cells.SetDirty(x, y, false) - if width > 1 { - t.cx = -1 - } - - return width -} - -func (t *tScreen) ShowCursor(x, y int) { - t.Lock() - t.cursorx = x - t.cursory = y - t.Unlock() -} - -func (t *tScreen) HideCursor() { - t.ShowCursor(-1, -1) -} - -func (t *tScreen) showCursor() { - - x, y := t.cursorx, t.cursory - w, h := t.cells.Size() - if x < 0 || y < 0 || x >= w || y >= h { - t.hideCursor() - return - } - t.TPuts(t.ti.TGoto(x, y)) - t.TPuts(t.ti.ShowCursor) - t.cx = x - t.cy = y -} - -// writeString sends a string to the terminal. The string is sent as-is and -// this function does not expand inline padding indications (of the form -// $<[delay]> where [delay] is msec). In order to have these expanded, use -// TPuts. If the screen is "buffering", the string is collected in a buffer, -// with the intention that the entire buffer be sent to the terminal in one -// write operation at some point later. -func (t *tScreen) writeString(s string) { - if t.buffering { - io.WriteString(&t.buf, s) - } else { - io.WriteString(t.out, s) - } -} - -func (t *tScreen) TPuts(s string) { - if t.buffering { - t.ti.TPuts(&t.buf, s) - } else { - t.ti.TPuts(t.out, s) - } -} - -func (t *tScreen) Show() { - t.Lock() - if !t.fini { - t.resize() - t.draw() - } - t.Unlock() -} - -func (t *tScreen) clearScreen() { - fg, bg, _ := t.style.Decompose() - t.sendFgBg(fg, bg) - t.TPuts(t.ti.Clear) - t.clear = false -} - -func (t *tScreen) hideCursor() { - // does not update cursor position - if t.ti.HideCursor != "" { - t.TPuts(t.ti.HideCursor) - } else { - // No way to hide cursor, stick it - // at bottom right of screen - t.cx, t.cy = t.cells.Size() - t.TPuts(t.ti.TGoto(t.cx, t.cy)) - } -} - -func (t *tScreen) draw() { - // clobber cursor position, because we're gonna change it all - t.cx = -1 - t.cy = -1 - - t.buf.Reset() - t.buffering = true - defer func() { - t.buffering = false - }() - - // hide the cursor while we move stuff around - t.hideCursor() - - if t.clear { - t.clearScreen() - } - - for y := 0; y < t.h; y++ { - for x := 0; x < t.w; x++ { - width := t.drawCell(x, y) - if width > 1 { - if x+1 < t.w { - // this is necessary so that if we ever - // go back to drawing that cell, we - // actually will *draw* it. - t.cells.SetDirty(x+1, y, true) - } - } - x += width - 1 - } - } - - // restore the cursor - t.showCursor() - - t.buf.WriteTo(t.out) -} - -func (t *tScreen) EnableMouse() { - if len(t.mouse) != 0 { - t.TPuts(t.ti.TParm(t.ti.MouseMode, 1)) - } -} - -func (t *tScreen) DisableMouse() { - if len(t.mouse) != 0 { - t.TPuts(t.ti.TParm(t.ti.MouseMode, 0)) - } -} - -func (t *tScreen) Size() (int, int) { - t.Lock() - w, h := t.w, t.h - t.Unlock() - return w, h -} - -func (t *tScreen) resize() { - if w, h, e := t.getWinSize(); e == nil { - if w != t.w || h != t.h { - t.cx = -1 - t.cy = -1 - - t.cells.Resize(w, h) - t.cells.Invalidate() - t.h = h - t.w = w - ev := NewEventResize(w, h) - t.PostEvent(ev) - } - } -} - -func (t *tScreen) Colors() int { - // this doesn't change, no need for lock - if t.truecolor { - return 1 << 24 - } - return t.ti.Colors -} - -func (t *tScreen) PollEvent() Event { - select { - case <-t.quit: - return nil - case ev := <-t.evch: - return ev - } -} - -// vtACSNames is a map of bytes defined by terminfo that are used in -// the terminals Alternate Character Set to represent other glyphs. -// For example, the upper left corner of the box drawing set can be -// displayed by printing "l" while in the alternate character set. -// Its not quite that simple, since the "l" is the terminfo name, -// and it may be necessary to use a different character based on -// the terminal implementation (or the terminal may lack support for -// this altogether). See buildAcsMap below for detail. -var vtACSNames = map[byte]rune{ - '+': RuneRArrow, - ',': RuneLArrow, - '-': RuneUArrow, - '.': RuneDArrow, - '0': RuneBlock, - '`': RuneDiamond, - 'a': RuneCkBoard, - 'b': '␉', // VT100, Not defined by terminfo - 'c': '␌', // VT100, Not defined by terminfo - 'd': '␋', // VT100, Not defined by terminfo - 'e': '␊', // VT100, Not defined by terminfo - 'f': RuneDegree, - 'g': RunePlMinus, - 'h': RuneBoard, - 'i': RuneLantern, - 'j': RuneLRCorner, - 'k': RuneURCorner, - 'l': RuneULCorner, - 'm': RuneLLCorner, - 'n': RunePlus, - 'o': RuneS1, - 'p': RuneS3, - 'q': RuneHLine, - 'r': RuneS7, - 's': RuneS9, - 't': RuneLTee, - 'u': RuneRTee, - 'v': RuneBTee, - 'w': RuneTTee, - 'x': RuneVLine, - 'y': RuneLEqual, - 'z': RuneGEqual, - '{': RunePi, - '|': RuneNEqual, - '}': RuneSterling, - '~': RuneBullet, -} - -// buildAcsMap builds a map of characters that we translate from Unicode to -// alternate character encodings. To do this, we use the standard VT100 ACS -// maps. This is only done if the terminal lacks support for Unicode; we -// always prefer to emit Unicode glyphs when we are able. -func (t *tScreen) buildAcsMap() { - acsstr := t.ti.AltChars - t.acs = make(map[rune]string) - for len(acsstr) > 2 { - srcv := acsstr[0] - dstv := string(acsstr[1]) - if r, ok := vtACSNames[srcv]; ok { - t.acs[r] = t.ti.EnterAcs + dstv + t.ti.ExitAcs - } - acsstr = acsstr[2:] - } -} - -func (t *tScreen) PostEventWait(ev Event) { - t.evch <- ev -} - -func (t *tScreen) PostEvent(ev Event) error { - select { - case t.evch <- ev: - return nil - default: - return ErrEventQFull - } -} - -func (t *tScreen) clip(x, y int) (int, int) { - w, h := t.cells.Size() - if x < 0 { - x = 0 - } - if y < 0 { - y = 0 - } - if x > w-1 { - x = w - 1 - } - if y > h-1 { - y = h - 1 - } - return x, y -} - -// buildMouseEvent returns an event based on the supplied coordinates and button -// state. Note that the screen's mouse button state is updated based on the -// input to this function (i.e. it mutates the receiver). -func (t *tScreen) buildMouseEvent(x, y, btn int) *EventMouse { - - // XTerm mouse events only report at most one button at a time, - // which may include a wheel button. Wheel motion events are - // reported as single impulses, while other button events are reported - // as separate press & release events. - - button := ButtonNone - mod := ModNone - - // Mouse wheel has bit 6 set, no release events. It should be noted - // that wheel events are sometimes misdelivered as mouse button events - // during a click-drag, so we debounce these, considering them to be - // button press events unless we see an intervening release event. - switch btn & 0x43 { - case 0: - button = Button1 - t.wasbtn = true - case 1: - button = Button2 - t.wasbtn = true - case 2: - button = Button3 - t.wasbtn = true - case 3: - button = ButtonNone - t.wasbtn = false - case 0x40: - if !t.wasbtn { - button = WheelUp - } else { - button = Button1 - } - case 0x41: - if !t.wasbtn { - button = WheelDown - } else { - button = Button2 - } - } - - if btn&0x4 != 0 { - mod |= ModShift - } - if btn&0x8 != 0 { - mod |= ModAlt - } - if btn&0x10 != 0 { - mod |= ModCtrl - } - - // Some terminals will report mouse coordinates outside the - // screen, especially with click-drag events. Clip the coordinates - // to the screen in that case. - x, y = t.clip(x, y) - - return NewEventMouse(x, y, button, mod) -} - -// parseSgrMouse attempts to locate an SGR mouse record at the start of the -// buffer. It returns true, true if it found one, and the associated bytes -// be removed from the buffer. It returns true, false if the buffer might -// contain such an event, but more bytes are necessary (partial match), and -// false, false if the content is definitely *not* an SGR mouse record. -func (t *tScreen) parseSgrMouse(buf *bytes.Buffer, evs *[]Event) (bool, bool) { - - b := buf.Bytes() - - var x, y, btn, state int - dig := false - neg := false - motion := false - i := 0 - val := 0 - - for i = range b { - switch b[i] { - case '\x1b': - if state != 0 { - return false, false - } - state = 1 - - case '\x9b': - if state != 0 { - return false, false - } - state = 2 - - case '[': - if state != 1 { - return false, false - } - state = 2 - - case '<': - if state != 2 { - return false, false - } - val = 0 - dig = false - neg = false - state = 3 - - case '-': - if state != 3 && state != 4 && state != 5 { - return false, false - } - if dig || neg { - return false, false - } - neg = true // stay in state - - case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': - if state != 3 && state != 4 && state != 5 { - return false, false - } - val *= 10 - val += int(b[i] - '0') - dig = true // stay in state - - case ';': - if neg { - val = -val - } - switch state { - case 3: - btn, val = val, 0 - neg, dig, state = false, false, 4 - case 4: - x, val = val-1, 0 - neg, dig, state = false, false, 5 - default: - return false, false - } - - case 'm', 'M': - if state != 5 { - return false, false - } - if neg { - val = -val - } - y = val - 1 - - motion = (btn & 32) != 0 - btn &^= 32 - if b[i] == 'm' { - // mouse release, clear all buttons - btn |= 3 - btn &^= 0x40 - t.buttondn = false - } else if motion { - /* - * Some broken terminals appear to send - * mouse button one motion events, instead of - * encoding 35 (no buttons) into these events. - * We resolve these by looking for a non-motion - * event first. - */ - if !t.buttondn { - btn |= 3 - btn &^= 0x40 - } - } else { - t.buttondn = true - } - // consume the event bytes - for i >= 0 { - buf.ReadByte() - i-- - } - *evs = append(*evs, t.buildMouseEvent(x, y, btn)) - return true, true - } - } - - // incomplete & inconclusve at this point - return true, false -} - -// parseXtermMouse is like parseSgrMouse, but it parses a legacy -// X11 mouse record. -func (t *tScreen) parseXtermMouse(buf *bytes.Buffer, evs *[]Event) (bool, bool) { - - b := buf.Bytes() - - state := 0 - btn := 0 - x := 0 - y := 0 - - for i := range b { - switch state { - case 0: - switch b[i] { - case '\x1b': - state = 1 - case '\x9b': - state = 2 - default: - return false, false - } - case 1: - if b[i] != '[' { - return false, false - } - state = 2 - case 2: - if b[i] != 'M' { - return false, false - } - state++ - case 3: - btn = int(b[i]) - state++ - case 4: - x = int(b[i]) - 32 - 1 - state++ - case 5: - y = int(b[i]) - 32 - 1 - for i >= 0 { - buf.ReadByte() - i-- - } - *evs = append(*evs, t.buildMouseEvent(x, y, btn)) - return true, true - } - } - return true, false -} - -func (t *tScreen) parseFunctionKey(buf *bytes.Buffer, evs *[]Event) (bool, bool) { - b := buf.Bytes() - partial := false - for e, k := range t.keycodes { - esc := []byte(e) - if (len(esc) == 1) && (esc[0] == '\x1b') { - continue - } - if bytes.HasPrefix(b, esc) { - // matched - var r rune - if len(esc) == 1 { - r = rune(b[0]) - } - mod := k.mod - if t.escaped { - mod |= ModAlt - t.escaped = false - } - *evs = append(*evs, NewEventKey(k.key, r, mod)) - for i := 0; i < len(esc); i++ { - buf.ReadByte() - } - return true, true - } - if bytes.HasPrefix(esc, b) { - partial = true - } - } - return partial, false -} - -func (t *tScreen) parseRune(buf *bytes.Buffer, evs *[]Event) (bool, bool) { - b := buf.Bytes() - if b[0] >= ' ' && b[0] <= 0x7F { - // printable ASCII easy to deal with -- no encodings - mod := ModNone - if t.escaped { - mod = ModAlt - t.escaped = false - } - *evs = append(*evs, NewEventKey(KeyRune, rune(b[0]), mod)) - buf.ReadByte() - return true, true - } - - if b[0] < 0x80 { - // Low numbered values are control keys, not runes. - return false, false - } - - utfb := make([]byte, 12) - for l := 1; l <= len(b); l++ { - t.decoder.Reset() - nout, nin, e := t.decoder.Transform(utfb, b[:l], true) - if e == transform.ErrShortSrc { - continue - } - if nout != 0 { - r, _ := utf8.DecodeRune(utfb[:nout]) - if r != utf8.RuneError { - mod := ModNone - if t.escaped { - mod = ModAlt - t.escaped = false - } - *evs = append(*evs, NewEventKey(KeyRune, r, mod)) - } - for nin > 0 { - buf.ReadByte() - nin-- - } - return true, true - } - } - // Looks like potential escape - return true, false -} - -func (t *tScreen) scanInput(buf *bytes.Buffer, expire bool) { - evs := t.collectEventsFromInput(buf, expire) - - for _, ev := range evs { - t.PostEventWait(ev) - } -} - -// Return an array of Events extracted from the supplied buffer. This is done -// while holding the screen's lock - the events can then be queued for -// application processing with the lock released. -func (t *tScreen) collectEventsFromInput(buf *bytes.Buffer, expire bool) []Event { - - res := make([]Event, 0, 20) - - t.Lock() - defer t.Unlock() - - for { - b := buf.Bytes() - if len(b) == 0 { - buf.Reset() - return res - } - - partials := 0 - - if part, comp := t.parseRune(buf, &res); comp { - continue - } else if part { - partials++ - } - - if part, comp := t.parseFunctionKey(buf, &res); comp { - continue - } else if part { - partials++ - } - - // Only parse mouse records if this term claims to have - // mouse support - - if t.ti.Mouse != "" { - if part, comp := t.parseXtermMouse(buf, &res); comp { - continue - } else if part { - partials++ - } - - if part, comp := t.parseSgrMouse(buf, &res); comp { - continue - } else if part { - partials++ - } - } - - if partials == 0 || expire { - if b[0] == '\x1b' { - if len(b) == 1 { - res = append(res, NewEventKey(KeyEsc, 0, ModNone)) - t.escaped = false - } else { - t.escaped = true - } - buf.ReadByte() - continue - } - // Nothing was going to match, or we timed out - // waiting for more data -- just deliver the characters - // to the app & let them sort it out. Possibly we - // should only do this for control characters like ESC. - by, _ := buf.ReadByte() - mod := ModNone - if t.escaped { - t.escaped = false - mod = ModAlt - } - res = append(res, NewEventKey(KeyRune, rune(by), mod)) - continue - } - - // well we have some partial data, wait until we get - // some more - break - } - - return res -} - -func (t *tScreen) mainLoop() { - buf := &bytes.Buffer{} - for { - select { - case <-t.quit: - close(t.indoneq) - return - case <-t.sigwinch: - t.Lock() - t.cx = -1 - t.cy = -1 - t.resize() - t.cells.Invalidate() - t.draw() - t.Unlock() - continue - case <-t.keytimer.C: - // If the timer fired, and the current time - // is after the expiration of the escape sequence, - // then we assume the escape sequence reached it's - // conclusion, and process the chunk independently. - // This lets us detect conflicts such as a lone ESC. - if buf.Len() > 0 { - if time.Now().After(t.keyexpire) { - t.scanInput(buf, true) - } - } - if buf.Len() > 0 { - if !t.keytimer.Stop() { - select { - case <-t.keytimer.C: - default: - } - } - t.keytimer.Reset(time.Millisecond * 50) - } - case chunk := <-t.keychan: - buf.Write(chunk) - t.keyexpire = time.Now().Add(time.Millisecond * 50) - t.scanInput(buf, false) - if !t.keytimer.Stop() { - select { - case <-t.keytimer.C: - default: - } - } - if buf.Len() > 0 { - t.keytimer.Reset(time.Millisecond * 50) - } - } - } -} - -func (t *tScreen) inputLoop() { - - for { - chunk := make([]byte, 128) - n, e := t.in.Read(chunk) - switch e { - case io.EOF: - case nil: - default: - t.PostEvent(NewEventError(e)) - return - } - t.keychan <- chunk[:n] - } -} - -func (t *tScreen) Sync() { - t.Lock() - t.cx = -1 - t.cy = -1 - if !t.fini { - t.resize() - t.clear = true - t.cells.Invalidate() - t.draw() - } - t.Unlock() -} - -func (t *tScreen) CharacterSet() string { - return t.charset -} - -func (t *tScreen) RegisterRuneFallback(orig rune, fallback string) { - t.Lock() - t.fallback[orig] = fallback - t.Unlock() -} - -func (t *tScreen) UnregisterRuneFallback(orig rune) { - t.Lock() - delete(t.fallback, orig) - t.Unlock() -} - -func (t *tScreen) CanDisplay(r rune, checkFallbacks bool) bool { - - if enc := t.encoder; enc != nil { - nb := make([]byte, 6) - ob := make([]byte, 6) - num := utf8.EncodeRune(ob, r) - - enc.Reset() - dst, _, err := enc.Transform(nb, ob[:num], true) - if dst != 0 && err == nil && nb[0] != '\x1A' { - return true - } - } - // Terminal fallbacks always permitted, since we assume they are - // basically nearly perfect renditions. - if _, ok := t.acs[r]; ok { - return true - } - if !checkFallbacks { - return false - } - if _, ok := t.fallback[r]; ok { - return true - } - return false -} - -func (t *tScreen) HasMouse() bool { - return len(t.mouse) != 0 -} - -func (t *tScreen) HasKey(k Key) bool { - if k == KeyRune { - return true - } - return t.keyexist[k] -} - -func (t *tScreen) Resize(int, int, int, int) {} diff --git a/vendor/github.com/gdamore/tcell/tscreen_bsd.go b/vendor/github.com/gdamore/tcell/tscreen_bsd.go deleted file mode 100644 index 25137165..00000000 --- a/vendor/github.com/gdamore/tcell/tscreen_bsd.go +++ /dev/null @@ -1,116 +0,0 @@ -// +build freebsd netbsd openbsd dragonfly - -// Copyright 2019 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tcell - -import ( - "os" - "os/signal" - "syscall" - "unsafe" -) - -type termiosPrivate syscall.Termios - -func (t *tScreen) termioInit() error { - var e error - var newtios termiosPrivate - var fd uintptr - var tios uintptr - var ioc uintptr - t.tiosp = &termiosPrivate{} - - if t.in, e = os.OpenFile("/dev/tty", os.O_RDONLY, 0); e != nil { - goto failed - } - if t.out, e = os.OpenFile("/dev/tty", os.O_WRONLY, 0); e != nil { - goto failed - } - - tios = uintptr(unsafe.Pointer(t.tiosp)) - ioc = uintptr(syscall.TIOCGETA) - fd = uintptr(t.out.Fd()) - if _, _, e1 := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioc, tios, 0, 0, 0); e1 != 0 { - e = e1 - goto failed - } - - newtios = *t.tiosp - newtios.Iflag &^= syscall.IGNBRK | syscall.BRKINT | syscall.PARMRK | - syscall.ISTRIP | syscall.INLCR | syscall.IGNCR | - syscall.ICRNL | syscall.IXON - newtios.Oflag &^= syscall.OPOST - newtios.Lflag &^= syscall.ECHO | syscall.ECHONL | syscall.ICANON | - syscall.ISIG | syscall.IEXTEN - newtios.Cflag &^= syscall.CSIZE | syscall.PARENB - newtios.Cflag |= syscall.CS8 - - tios = uintptr(unsafe.Pointer(&newtios)) - - ioc = uintptr(syscall.TIOCSETA) - if _, _, e1 := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioc, tios, 0, 0, 0); e1 != 0 { - e = e1 - goto failed - } - - signal.Notify(t.sigwinch, syscall.SIGWINCH) - - if w, h, e := t.getWinSize(); e == nil && w != 0 && h != 0 { - t.cells.Resize(w, h) - } - - return nil - -failed: - if t.in != nil { - t.in.Close() - } - if t.out != nil { - t.out.Close() - } - return e -} - -func (t *tScreen) termioFini() { - - signal.Stop(t.sigwinch) - - <-t.indoneq - - if t.out != nil { - fd := uintptr(t.out.Fd()) - ioc := uintptr(syscall.TIOCSETAF) - tios := uintptr(unsafe.Pointer(t.tiosp)) - syscall.Syscall6(syscall.SYS_IOCTL, fd, ioc, tios, 0, 0, 0) - t.out.Close() - } - if t.in != nil { - t.in.Close() - } -} - -func (t *tScreen) getWinSize() (int, int, error) { - - fd := uintptr(t.out.Fd()) - dim := [4]uint16{} - dimp := uintptr(unsafe.Pointer(&dim)) - ioc := uintptr(syscall.TIOCGWINSZ) - if _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, - fd, ioc, dimp, 0, 0, 0); err != 0 { - return -1, -1, err - } - return int(dim[1]), int(dim[0]), nil -} diff --git a/vendor/github.com/gdamore/tcell/tscreen_darwin.go b/vendor/github.com/gdamore/tcell/tscreen_darwin.go deleted file mode 100644 index 6ee5fd5e..00000000 --- a/vendor/github.com/gdamore/tcell/tscreen_darwin.go +++ /dev/null @@ -1,137 +0,0 @@ -// +build darwin - -// Copyright 2019 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tcell - -// The Darwin system is *almost* a real BSD system, but it suffers from -// a brain damaged TTY driver. This TTY driver does not actually -// wake up in poll() or similar calls, which means that we cannot reliably -// shut down the terminal without resorting to obscene custom C code -// and a dedicated poller thread. -// -// So instead, we do a best effort, and simply try to do the close in the -// background. Probably this will cause a leak of two goroutines and -// maybe also the file descriptor, meaning that applications on Darwin -// can't reinitialize the screen, but that's probably a very rare behavior, -// and accepting that is the best of some very poor alternative options. -// -// Maybe someday Apple will fix there tty driver, but its been broken for -// a long time (probably forever) so holding one's breath is contraindicated. - -import ( - "os" - "os/signal" - "syscall" - "unsafe" -) - -type termiosPrivate syscall.Termios - -func (t *tScreen) termioInit() error { - var e error - var newtios termiosPrivate - var fd uintptr - var tios uintptr - var ioc uintptr - t.tiosp = &termiosPrivate{} - - if t.in, e = os.OpenFile("/dev/tty", os.O_RDONLY, 0); e != nil { - goto failed - } - if t.out, e = os.OpenFile("/dev/tty", os.O_WRONLY, 0); e != nil { - goto failed - } - - tios = uintptr(unsafe.Pointer(t.tiosp)) - ioc = uintptr(syscall.TIOCGETA) - fd = uintptr(t.out.Fd()) - if _, _, e1 := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioc, tios, 0, 0, 0); e1 != 0 { - e = e1 - goto failed - } - - newtios = *t.tiosp - newtios.Iflag &^= syscall.IGNBRK | syscall.BRKINT | syscall.PARMRK | - syscall.ISTRIP | syscall.INLCR | syscall.IGNCR | - syscall.ICRNL | syscall.IXON - newtios.Oflag &^= syscall.OPOST - newtios.Lflag &^= syscall.ECHO | syscall.ECHONL | syscall.ICANON | - syscall.ISIG | syscall.IEXTEN - newtios.Cflag &^= syscall.CSIZE | syscall.PARENB - newtios.Cflag |= syscall.CS8 - - tios = uintptr(unsafe.Pointer(&newtios)) - - ioc = uintptr(syscall.TIOCSETA) - if _, _, e1 := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioc, tios, 0, 0, 0); e1 != 0 { - e = e1 - goto failed - } - - signal.Notify(t.sigwinch, syscall.SIGWINCH) - - if w, h, e := t.getWinSize(); e == nil && w != 0 && h != 0 { - t.cells.Resize(w, h) - } - - return nil - -failed: - if t.in != nil { - t.in.Close() - } - if t.out != nil { - t.out.Close() - } - return e -} - -func (t *tScreen) termioFini() { - - signal.Stop(t.sigwinch) - - <-t.indoneq - - if t.out != nil { - fd := uintptr(t.out.Fd()) - ioc := uintptr(syscall.TIOCSETAF) - tios := uintptr(unsafe.Pointer(t.tiosp)) - syscall.Syscall6(syscall.SYS_IOCTL, fd, ioc, tios, 0, 0, 0) - t.out.Close() - } - - // See above -- we background this call which might help, but - // really the tty is probably open. - - go func() { - if t.in != nil { - t.in.Close() - } - }() -} - -func (t *tScreen) getWinSize() (int, int, error) { - - fd := uintptr(t.out.Fd()) - dim := [4]uint16{} - dimp := uintptr(unsafe.Pointer(&dim)) - ioc := uintptr(syscall.TIOCGWINSZ) - if _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, - fd, ioc, dimp, 0, 0, 0); err != 0 { - return -1, -1, err - } - return int(dim[1]), int(dim[0]), nil -} diff --git a/vendor/github.com/gdamore/tcell/tscreen_linux.go b/vendor/github.com/gdamore/tcell/tscreen_linux.go deleted file mode 100644 index 19e58d60..00000000 --- a/vendor/github.com/gdamore/tcell/tscreen_linux.go +++ /dev/null @@ -1,119 +0,0 @@ -// +build linux - -// Copyright 2019 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tcell - -import ( - "os" - "os/signal" - "syscall" - - "golang.org/x/sys/unix" -) - -type termiosPrivate struct { - tio *unix.Termios -} - -func (t *tScreen) termioInit() error { - var e error - var raw *unix.Termios - var tio *unix.Termios - - if t.in, e = os.OpenFile("/dev/tty", os.O_RDONLY, 0); e != nil { - goto failed - } - if t.out, e = os.OpenFile("/dev/tty", os.O_WRONLY, 0); e != nil { - goto failed - } - - tio, e = unix.IoctlGetTermios(int(t.out.Fd()), unix.TCGETS) - if e != nil { - goto failed - } - - t.tiosp = &termiosPrivate{tio: tio} - - // make a local copy, to make it raw - raw = &unix.Termios{ - Cflag: tio.Cflag, - Oflag: tio.Oflag, - Iflag: tio.Iflag, - Lflag: tio.Lflag, - Cc: tio.Cc, - } - raw.Iflag &^= (unix.IGNBRK | unix.BRKINT | unix.PARMRK | unix.ISTRIP | - unix.INLCR | unix.IGNCR | unix.ICRNL | unix.IXON) - raw.Oflag &^= unix.OPOST - raw.Lflag &^= (unix.ECHO | unix.ECHONL | unix.ICANON | unix.ISIG | - unix.IEXTEN) - raw.Cflag &^= (unix.CSIZE | unix.PARENB) - raw.Cflag |= unix.CS8 - - // This is setup for blocking reads. In the past we attempted to - // use non-blocking reads, but now a separate input loop and timer - // copes with the problems we had on some systems (BSD/Darwin) - // where close hung forever. - raw.Cc[unix.VMIN] = 1 - raw.Cc[unix.VTIME] = 0 - - e = unix.IoctlSetTermios(int(t.out.Fd()), unix.TCSETS, raw) - if e != nil { - goto failed - } - - signal.Notify(t.sigwinch, syscall.SIGWINCH) - - if w, h, e := t.getWinSize(); e == nil && w != 0 && h != 0 { - t.cells.Resize(w, h) - } - - return nil - -failed: - if t.in != nil { - t.in.Close() - } - if t.out != nil { - t.out.Close() - } - return e -} - -func (t *tScreen) termioFini() { - - signal.Stop(t.sigwinch) - - <-t.indoneq - - if t.out != nil && t.tiosp != nil { - unix.IoctlSetTermios(int(t.out.Fd()), unix.TCSETSF, t.tiosp.tio) - t.out.Close() - } - - if t.in != nil { - t.in.Close() - } -} - -func (t *tScreen) getWinSize() (int, int, error) { - - wsz, err := unix.IoctlGetWinsize(int(t.out.Fd()), unix.TIOCGWINSZ) - if err != nil { - return -1, -1, err - } - return int(wsz.Col), int(wsz.Row), nil -} diff --git a/vendor/github.com/gdamore/tcell/tscreen_solaris.go b/vendor/github.com/gdamore/tcell/tscreen_solaris.go deleted file mode 100644 index 9fa48b85..00000000 --- a/vendor/github.com/gdamore/tcell/tscreen_solaris.go +++ /dev/null @@ -1,117 +0,0 @@ -// +build solaris - -// Copyright 2019 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tcell - -import ( - "os" - "os/signal" - "syscall" - - "golang.org/x/sys/unix" -) - -type termiosPrivate struct { - tio *unix.Termios -} - -func (t *tScreen) termioInit() error { - var e error - var raw *unix.Termios - var tio *unix.Termios - - if t.in, e = os.OpenFile("/dev/tty", os.O_RDONLY, 0); e != nil { - goto failed - } - if t.out, e = os.OpenFile("/dev/tty", os.O_WRONLY, 0); e != nil { - goto failed - } - - tio, e = unix.IoctlGetTermios(int(t.out.Fd()), unix.TCGETS) - if e != nil { - goto failed - } - - t.tiosp = &termiosPrivate{tio: tio} - - // make a local copy, to make it raw - raw = &unix.Termios{ - Cflag: tio.Cflag, - Oflag: tio.Oflag, - Iflag: tio.Iflag, - Lflag: tio.Lflag, - Cc: tio.Cc, - } - - raw.Iflag &^= (unix.IGNBRK | unix.BRKINT | unix.PARMRK | unix.INLCR | - unix.IGNCR | unix.ICRNL | unix.IXON) - raw.Oflag &^= unix.OPOST - raw.Lflag &^= (unix.ECHO | unix.ECHONL | unix.ICANON | unix.ISIG | unix.IEXTEN) - raw.Cflag &^= (unix.CSIZE | unix.PARENB) - raw.Cflag |= unix.CS8 - - // This is setup for blocking reads. In the past we attempted to - // use non-blocking reads, but now a separate input loop and timer - // copes with the problems we had on some systems (BSD/Darwin) - // where close hung forever. - raw.Cc[unix.VMIN] = 1 - raw.Cc[unix.VTIME] = 0 - - e = unix.IoctlSetTermios(int(t.out.Fd()), unix.TCSETS, raw) - if e != nil { - goto failed - } - - signal.Notify(t.sigwinch, syscall.SIGWINCH) - - if w, h, e := t.getWinSize(); e == nil && w != 0 && h != 0 { - t.cells.Resize(w, h) - } - - return nil - -failed: - if t.in != nil { - t.in.Close() - } - if t.out != nil { - t.out.Close() - } - return e -} - -func (t *tScreen) termioFini() { - - signal.Stop(t.sigwinch) - - <-t.indoneq - - if t.out != nil && t.tiosp != nil { - unix.IoctlSetTermios(int(t.out.Fd()), unix.TCSETSF, t.tiosp.tio) - t.out.Close() - } - if t.in != nil { - t.in.Close() - } -} - -func (t *tScreen) getWinSize() (int, int, error) { - wsz, err := unix.IoctlGetWinsize(int(t.out.Fd()), unix.TIOCGWINSZ) - if err != nil { - return -1, -1, err - } - return int(wsz.Col), int(wsz.Row), nil -} diff --git a/vendor/github.com/gdamore/tcell/tscreen_stub.go b/vendor/github.com/gdamore/tcell/tscreen_stub.go deleted file mode 100644 index 91de26e1..00000000 --- a/vendor/github.com/gdamore/tcell/tscreen_stub.go +++ /dev/null @@ -1,32 +0,0 @@ -// +build nacl plan9 - -// Copyright 2015 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tcell - -// This stub file is for systems that have no termios. - -type termiosPrivate struct{} - -func (t *tScreen) termioInit() error { - return ErrNoScreen -} - -func (t *tScreen) termioFini() { -} - -func (t *tScreen) getWinSize() (int, int, error) { - return 0, 0, ErrNoScreen -} diff --git a/vendor/github.com/gdamore/tcell/tscreen_windows.go b/vendor/github.com/gdamore/tcell/tscreen_windows.go deleted file mode 100644 index daac0976..00000000 --- a/vendor/github.com/gdamore/tcell/tscreen_windows.go +++ /dev/null @@ -1,40 +0,0 @@ -// +build windows - -// Copyright 2015 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tcell - -// On Windows we don't have support for termios. We probably could, and -// may should, in a cygwin type environment. Its not clear how to make -// this all work nicely with both cygwin and Windows console, so we -// decline to do so here. - -func (t *tScreen) termioInit() error { - return ErrNoScreen -} - -func (t *tScreen) termioFini() { - return -} - -func (t *tScreen) getWinSize() (int, int, error) { - return 0, 0, ErrNoScreen -} - -func (t *tScreen) getCharset() string { - return "UTF-16LE" -} - -type termiosPrivate struct{} diff --git a/vendor/github.com/lucasb-eyer/go-colorful/.gitignore b/vendor/github.com/lucasb-eyer/go-colorful/.gitignore deleted file mode 100644 index 47fda8ee..00000000 --- a/vendor/github.com/lucasb-eyer/go-colorful/.gitignore +++ /dev/null @@ -1,28 +0,0 @@ -# Compiled Object files, Static and Dynamic libs (Shared Objects) -*.o -*.a -*.so - -# Folders -_obj -_test - -# Vim swap files -.*.sw? - -# Architecture specific extensions/prefixes -*.[568vq] -[568vq].out - -*.cgo1.go -*.cgo2.c -_cgo_defun.c -_cgo_gotypes.go -_cgo_export.* - -_testmain.go - -*.exe - -# Code coverage stuff -coverage.out diff --git a/vendor/github.com/lucasb-eyer/go-colorful/.travis.yml b/vendor/github.com/lucasb-eyer/go-colorful/.travis.yml deleted file mode 100644 index 5bb2a827..00000000 --- a/vendor/github.com/lucasb-eyer/go-colorful/.travis.yml +++ /dev/null @@ -1,7 +0,0 @@ -language: go -install: - - go get golang.org/x/tools/cmd/cover - - go get github.com/mattn/goveralls -script: - - go test -v -covermode=count -coverprofile=coverage.out - - if [[ "$TRAVIS_PULL_REQUEST" = "false" ]]; then $HOME/gopath/bin/goveralls -coverprofile=coverage.out -service=travis-ci -repotoken $COVERALLS_TOKEN; fi diff --git a/vendor/github.com/lucasb-eyer/go-colorful/LICENSE b/vendor/github.com/lucasb-eyer/go-colorful/LICENSE deleted file mode 100644 index 4e402a00..00000000 --- a/vendor/github.com/lucasb-eyer/go-colorful/LICENSE +++ /dev/null @@ -1,7 +0,0 @@ -Copyright (c) 2013 Lucas Beyer - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/github.com/lucasb-eyer/go-colorful/README.md b/vendor/github.com/lucasb-eyer/go-colorful/README.md deleted file mode 100644 index 2cb0c424..00000000 --- a/vendor/github.com/lucasb-eyer/go-colorful/README.md +++ /dev/null @@ -1,492 +0,0 @@ -go-colorful -=========== -A library for playing with colors in go (golang). - -[![Build Status](https://travis-ci.org/lucasb-eyer/go-colorful.svg?branch=master)](https://travis-ci.org/lucasb-eyer/go-colorful) -[![Coverage Status](https://coveralls.io/repos/github/lucasb-eyer/go-colorful/badge.svg?branch=master)](https://coveralls.io/github/lucasb-eyer/go-colorful?branch=master) - -Why? -==== -I love games. I make games. I love detail and I get lost in detail. -One such detail popped up during the development of [Memory Which Does Not Suck](https://github.com/lucasb-eyer/mwdns/), -when we wanted the server to assign the players random colors. Sometimes -two players got very similar colors, which bugged me. The very same evening, -[I want hue](http://tools.medialab.sciences-po.fr/iwanthue/) was the top post -on HackerNews' frontpage and showed me how to Do It Right™. Last but not -least, there was no library for handling color spaces available in go. Colorful -does just that and implements Go's `color.Color` interface. - -What? -===== -Go-Colorful stores colors in RGB and provides methods from converting these to various color-spaces. Currently supported colorspaces are: - -- **RGB:** All three of Red, Green and Blue in [0..1]. -- **HSL:** Hue in [0..360], Saturation and Luminance in [0..1]. For legacy reasons; please forget that it exists. -- **HSV:** Hue in [0..360], Saturation and Value in [0..1]. You're better off using HCL, see below. -- **Hex RGB:** The "internet" color format, as in #FF00FF. -- **Linear RGB:** See [gamma correct rendering](http://www.sjbrown.co.uk/2004/05/14/gamma-correct-rendering/). -- **CIE-XYZ:** CIE's standard color space, almost in [0..1]. -- **CIE-xyY:** encodes chromacity in x and y and luminance in Y, all in [0..1] -- **CIE-L\*a\*b\*:** A *perceptually uniform* color space, i.e. distances are meaningful. L\* in [0..1] and a\*, b\* almost in [-1..1]. -- **CIE-L\*u\*v\*:** Very similar to CIE-L\*a\*b\*, there is [no consensus](http://en.wikipedia.org/wiki/CIELUV#Historical_background) on which one is "better". -- **CIE-L\*C\*h° (HCL):** This is generally the [most useful](http://vis4.net/blog/posts/avoid-equidistant-hsv-colors/) one; CIE-L\*a\*b\* space in polar coordinates, i.e. a *better* HSV. H° is in [0..360], C\* almost in [-1..1] and L\* as in CIE-L\*a\*b\*. - -For the colorspaces where it makes sense (XYZ, Lab, Luv, HCl), the -[D65](http://en.wikipedia.org/wiki/Illuminant_D65) is used as reference white -by default but methods for using your own reference white are provided. - -A coordinate being *almost in* a range means that generally it is, but for very -bright colors and depending on the reference white, it might overflow this -range slightly. For example, C\* of #0000ff is 1.338. - -Unit-tests are provided. - -Nice, but what's it useful for? -------------------------------- - -- Converting color spaces. Some people like to do that. -- Blending (interpolating) between colors in a "natural" look by using the right colorspace. -- Generating random colors under some constraints (e.g. colors of the same shade, or shades of one color.) -- Generating gorgeous random palettes with distinct colors of a same temperature. - -What not (yet)? -=============== -There are a few features which are currently missing and might be useful. -I just haven't implemented them yet because I didn't have the need for it. -Pull requests welcome. - -- Sorting colors (potentially using above mentioned distances) - -So which colorspace should I use? -================================= -It depends on what you want to do. I think the folks from *I want hue* are -on-spot when they say that RGB fits to how *screens produce* color, CIE L\*a\*b\* -fits how *humans perceive* color and HCL fits how *humans think* colors. - -Whenever you'd use HSV, rather go for CIE-L\*C\*h°. for fixed lightness L\* and -chroma C\* values, the hue angle h° rotates through colors of the same -perceived brightness and intensity. - -How? -==== - -### Installing -Installing the library is as easy as - -```bash -$ go get github.com/lucasb-eyer/go-colorful -``` - -The package can then be used through an - -```go -import "github.com/lucasb-eyer/go-colorful" -``` - -### Basic usage - -Create a beautiful blue color using different source space: - -```go -// Any of the following should be the same -c := colorful.Color{0.313725, 0.478431, 0.721569} -c, err := colorful.Hex("#517AB8") -if err != nil { - log.Fatal(err) -} -c = colorful.Hsv(216.0, 0.56, 0.722) -c = colorful.Xyz(0.189165, 0.190837, 0.480248) -c = colorful.Xyy(0.219895, 0.221839, 0.190837) -c = colorful.Lab(0.507850, 0.040585,-0.370945) -c = colorful.Luv(0.507849,-0.194172,-0.567924) -c = colorful.Hcl(276.2440, 0.373160, 0.507849) -fmt.Printf("RGB values: %v, %v, %v", c.R, c.G, c.B) -``` - -And then converting this color back into various color spaces: - -```go -hex := c.Hex() -h, s, v := c.Hsv() -x, y, z := c.Xyz() -x, y, Y := c.Xyy() -l, a, b := c.Lab() -l, u, v := c.Luv() -h, c, l := c.Hcl() -``` - -Note that, because of Go's unfortunate choice of requiring an initial uppercase, -the name of the functions relating to the xyY space are just off. If you have -any good suggestion, please open an issue. (I don't consider XyY good.) - -### The `color.Color` interface -Because a `colorful.Color` implements Go's `color.Color` interface (found in the -`image/color` package), it can be used anywhere that expects a `color.Color`. - -Furthermore, you can convert anything that implements the `color.Color` interface -into a `colorful.Color` using the `MakeColor` function: - -```go -c, ok := colorful.MakeColor(color.Gray16{12345}) -``` - -**Caveat:** Be aware that this latter conversion (using `MakeColor`) hits a -corner-case when alpha is exactly zero. Because `color.Color` uses pre-multiplied -alpha colors, this means the RGB values are lost (set to 0) and it's impossible -to recover them. In such a case `MakeColor` will return `false` as its second value. - -### Comparing colors -In the RGB color space, the Euclidian distance between colors *doesn't* correspond -to visual/perceptual distance. This means that two pairs of colors which have the -same distance in RGB space can look much further apart. This is fixed by the -CIE-L\*a\*b\*, CIE-L\*u\*v\* and CIE-L\*C\*h° color spaces. -Thus you should only compare colors in any of these space. -(Note that the distance in CIE-L\*a\*b\* and CIE-L\*C\*h° are the same, since it's the same space but in cylindrical coordinates) - -![Color distance comparison](doc/colordist/colordist.png) - -The two colors shown on the top look much more different than the two shown on -the bottom. Still, in RGB space, their distance is the same. -Here is a little example program which shows the distances between the top two -and bottom two colors in RGB, CIE-L\*a\*b\* and CIE-L\*u\*v\* space. You can find it in `doc/colordist/colordist.go`. - -```go -package main - -import "fmt" -import "github.com/lucasb-eyer/go-colorful" - -func main() { - c1a := colorful.Color{150.0 / 255.0, 10.0 / 255.0, 150.0 / 255.0} - c1b := colorful.Color{53.0 / 255.0, 10.0 / 255.0, 150.0 / 255.0} - c2a := colorful.Color{10.0 / 255.0, 150.0 / 255.0, 50.0 / 255.0} - c2b := colorful.Color{99.9 / 255.0, 150.0 / 255.0, 10.0 / 255.0} - - fmt.Printf("DistanceRgb: c1: %v\tand c2: %v\n", c1a.DistanceRgb(c1b), c2a.DistanceRgb(c2b)) - fmt.Printf("DistanceLab: c1: %v\tand c2: %v\n", c1a.DistanceLab(c1b), c2a.DistanceLab(c2b)) - fmt.Printf("DistanceLuv: c1: %v\tand c2: %v\n", c1a.DistanceLuv(c1b), c2a.DistanceLuv(c2b)) - fmt.Printf("DistanceCIE76: c1: %v\tand c2: %v\n", c1a.DistanceCIE76(c1b), c2a.DistanceCIE76(c2b)) - fmt.Printf("DistanceCIE94: c1: %v\tand c2: %v\n", c1a.DistanceCIE94(c1b), c2a.DistanceCIE94(c2b)) - fmt.Printf("DistanceCIEDE2000: c1: %v\tand c2: %v\n", c1a.DistanceCIEDE2000(c1b), c2a.DistanceCIEDE2000(c2b)) -} -``` - -Running the above program shows that you should always prefer any of the CIE distances: - -```bash -$ go run colordist.go -DistanceRgb: c1: 0.3803921568627451 and c2: 0.3858713931171159 -DistanceLab: c1: 0.32048458312798056 and c2: 0.24397151758565272 -DistanceLuv: c1: 0.5134369614199698 and c2: 0.2568692839860636 -DistanceCIE76: c1: 0.32048458312798056 and c2: 0.24397151758565272 -DistanceCIE94: c1: 0.19799168128511324 and c2: 0.12207136371167401 -DistanceCIEDE2000: c1: 0.17274551120971166 and c2: 0.10665210031428465 -``` - -It also shows that `DistanceLab` is more formally known as `DistanceCIE76` and -has been superseded by the slightly more accurate, but much more expensive -`DistanceCIE94` and `DistanceCIEDE2000`. - -Note that `AlmostEqualRgb` is provided mainly for (unit-)testing purposes. Use -it only if you really know what you're doing. It will eat your cat. - -### Blending colors -Blending is highly connected to distance, since it basically "walks through" the -colorspace thus, if the colorspace maps distances well, the walk is "smooth". - -Colorful comes with blending functions in RGB, HSV and any of the LAB spaces. -Of course, you'd rather want to use the blending functions of the LAB spaces since -these spaces map distances well but, just in case, here is an example showing -you how the blendings (`#fdffcc` to `#242a42`) are done in the various spaces: - -![Blending colors in different spaces.](doc/colorblend/colorblend.png) - -What you see is that HSV is really bad: it adds some green, which is not present -in the original colors at all! RGB is much better, but it stays light a little -too long. LUV and LAB both hit the right lightness but LAB has a little more -color. HCL works in the same vein as HSV (both cylindrical interpolations) but -it does it right in that there is no green appearing and the lighthness changes -in a linear manner. - -While this seems all good, you need to know one thing: When interpolating in any -of the CIE color spaces, you might get invalid RGB colors! This is important if -the starting and ending colors are user-input or random. An example of where this -happens is when blending between `#eeef61` and `#1e3140`: - -![Invalid RGB colors may crop up when blending in CIE spaces.](doc/colorblend/invalid.png) - -You can test whether a color is a valid RGB color by calling the `IsValid` method -and indeed, calling IsValid will return false for the redish colors on the bottom. -One way to "fix" this is to get a valid color close to the invalid one by calling -`Clamped`, which always returns a nearby valid color. Doing this, we get the -following result, which is satisfactory: - -![Fixing invalid RGB colors by clamping them to the valid range.](doc/colorblend/clamped.png) - -The following is the code creating the above three images; it can be found in `doc/colorblend/colorblend.go` - -```go -package main - -import "fmt" -import "github.com/lucasb-eyer/go-colorful" -import "image" -import "image/draw" -import "image/png" -import "os" - -func main() { - blocks := 10 - blockw := 40 - img := image.NewRGBA(image.Rect(0,0,blocks*blockw,200)) - - c1, _ := colorful.Hex("#fdffcc") - c2, _ := colorful.Hex("#242a42") - - // Use these colors to get invalid RGB in the gradient. - //c1, _ := colorful.Hex("#EEEF61") - //c2, _ := colorful.Hex("#1E3140") - - for i := 0 ; i < blocks ; i++ { - draw.Draw(img, image.Rect(i*blockw, 0,(i+1)*blockw, 40), &image.Uniform{c1.BlendHsv(c2, float64(i)/float64(blocks-1))}, image.ZP, draw.Src) - draw.Draw(img, image.Rect(i*blockw, 40,(i+1)*blockw, 80), &image.Uniform{c1.BlendLuv(c2, float64(i)/float64(blocks-1))}, image.ZP, draw.Src) - draw.Draw(img, image.Rect(i*blockw, 80,(i+1)*blockw,120), &image.Uniform{c1.BlendRgb(c2, float64(i)/float64(blocks-1))}, image.ZP, draw.Src) - draw.Draw(img, image.Rect(i*blockw,120,(i+1)*blockw,160), &image.Uniform{c1.BlendLab(c2, float64(i)/float64(blocks-1))}, image.ZP, draw.Src) - draw.Draw(img, image.Rect(i*blockw,160,(i+1)*blockw,200), &image.Uniform{c1.BlendHcl(c2, float64(i)/float64(blocks-1))}, image.ZP, draw.Src) - - // This can be used to "fix" invalid colors in the gradient. - //draw.Draw(img, image.Rect(i*blockw,160,(i+1)*blockw,200), &image.Uniform{c1.BlendHcl(c2, float64(i)/float64(blocks-1)).Clamped()}, image.ZP, draw.Src) - } - - toimg, err := os.Create("colorblend.png") - if err != nil { - fmt.Printf("Error: %v", err) - return - } - defer toimg.Close() - - png.Encode(toimg, img) -} -``` - -#### Generating color gradients -A very common reason to blend colors is creating gradients. There is an example -program in [doc/gradientgen.go](doc/gradientgen/gradientgen.go); it doesn't use any API -which hasn't been used in the previous example code, so I won't bother pasting -the code in here. Just look at that gorgeous gradient it generated in HCL space: - -!["Spectral" colorbrewer gradient in HCL space.](doc/gradientgen/gradientgen.png) - -### Getting random colors -It is sometimes necessary to generate random colors. You could simply do this -on your own by generating colors with random values. By restricting the random -values to a range smaller than [0..1] and using a space such as CIE-H\*C\*l° or -HSV, you can generate both random shades of a color or random colors of a -lightness: - -```go -random_blue := colorful.Hcl(180.0+rand.Float64()*50.0, 0.2+rand.Float64()*0.8, 0.3+rand.Float64()*0.7) -random_dark := colorful.Hcl(rand.Float64()*360.0, rand.Float64(), rand.Float64()*0.4) -random_light := colorful.Hcl(rand.Float64()*360.0, rand.Float64(), 0.6+rand.Float64()*0.4) -``` - -Since getting random "warm" and "happy" colors is quite a common task, there -are some helper functions: - -```go -colorful.WarmColor() -colorful.HappyColor() -colorful.FastWarmColor() -colorful.FastHappyColor() -``` - -The ones prefixed by `Fast` are faster but less coherent since they use the HSV -space as opposed to the regular ones which use CIE-L\*C\*h° space. The -following picture shows the warm colors in the top two rows and happy colors -in the bottom two rows. Within these, the first is the regular one and the -second is the fast one. - -![Warm, fast warm, happy and fast happy random colors, respectively.](doc/colorgens/colorgens.png) - -Don't forget to initialize the random seed! You can see the code used for -generating this picture in `doc/colorgens/colorgens.go`. - -### Getting random palettes -As soon as you need to generate more than one random color, you probably want -them to be distinguishible. Playing against an opponent which has almost the -same blue as I do is not fun. This is where random palettes can help. - -These palettes are generated using an algorithm which ensures that all colors -on the palette are as distinguishible as possible. Again, there is a `Fast` -method which works in HSV and is less perceptually uniform and a non-`Fast` -method which works in CIE spaces. For more theory on `SoftPalette`, check out -[I want hue](http://tools.medialab.sciences-po.fr/iwanthue/theory.php). Yet -again, there is a `Happy` and a `Warm` version, which do what you expect, but -now there is an additional `Soft` version, which is more configurable: you can -give a constraint on the color space in order to get colors within a certain *feel*. - -Let's start with the simple methods first, all they take is the amount of -colors to generate, which could, for example, be the player count. They return -an array of `colorful.Color` objects: - -```go -pal1, err1 := colorful.WarmPalette(10) -pal2 := colorful.FastWarmPalette(10) -pal3, err3 := colorful.HappyPalette(10) -pal4 := colorful.FastHappyPalette(10) -pal5, err5 := colorful.SoftPalette(10) -``` - -Note that the non-fast methods *may* fail if you ask for way too many colors. -Let's move on to the advanced one, namely `SoftPaletteEx`. Besides the color -count, this function takes a `SoftPaletteSettings` object as argument. The -interesting part here is its `CheckColor` member, which is a boolean function -taking three floating points as arguments: `l`, `a` and `b`. This function -should return `true` for colors which lie within the region you want and `false` -otherwise. The other members are `Iteration`, which should be within [5..100] -where higher means slower but more exact palette, and `ManySamples` which you -should set to `true` in case your `CheckColor` constraint rejects a large part -of the color space. - -For example, to create a palette of 10 brownish colors, you'd call it like this: - -```go -func isbrowny(l, a, b float64) bool { - h, c, L := colorful.LabToHcl(l, a, b) - return 10.0 < h && h < 50.0 && 0.1 < c && c < 0.5 && L < 0.5 -} -// Since the above function is pretty restrictive, we set ManySamples to true. -brownies := colorful.SoftPaletteEx(10, colorful.SoftPaletteSettings{isbrowny, 50, true}) -``` - -The following picture shows the palettes generated by all of these methods -(sourcecode in `doc/palettegens/palettegens.go`), in the order they were presented, i.e. -from top to bottom: `Warm`, `FastWarm`, `Happy`, `FastHappy`, `Soft`, -`SoftEx(isbrowny)`. All of them contain some randomness, so YMMV. - -![All example palettes](doc/palettegens/palettegens.png) - -Again, the code used for generating the above image is available as [doc/palettegens/palettegens.go](https://github.com/lucasb-eyer/go-colorful/blob/master/doc/palettegens/palettegens.go). - -### Sorting colors -TODO: Sort using dist fn. - -### Using linear RGB for computations -There are two methods for transforming RGB<->Linear RGB: a fast and almost precise one, -and a slow and precise one. - -```go -r, g, b := colorful.Hex("#FF0000").FastLinearRgb() -``` - -TODO: describe some more. - -### Want to use some other reference point? - -```go -c := colorful.LabWhiteRef(0.507850, 0.040585,-0.370945, colorful.D50) -l, a, b := c.LabWhiteRef(colorful.D50) -``` - -### Reading and writing colors from databases - -The type `HexColor` makes it easy to store colors as strings in a database. It -implements the [https://godoc.org/database/sql#Scanner](database/sql.Scanner) -and [database/sql/driver.Value](https://godoc.org/database/sql/driver.Value) -interfaces which provide automatic type conversion. - -Example: - -```go -var hc HexColor -_, err := db.QueryRow("SELECT '#ff0000';").Scan(&hc) -// hc == HexColor{R: 1, G: 0, B: 0}; err == nil -``` - -FAQ -=== - -### Q: I get all f!@#ed up values! Your library sucks! -A: You probably provided values in the wrong range. For example, RGB values are -expected to reside between 0 and 1, *not* between 0 and 255. Normalize your colors. - -### Q: Lab/Luv/HCl seem broken! Your library sucks! -They look like this: - - - -A: You're likely trying to generate and display colors that can't be represented by RGB, -and thus monitors. When you're trying to convert, say, `HCL(190.0, 1.0, 1.0).RGB255()`, -you're asking for RGB values of `(-2105.254 300.680 286.185)`, which clearly don't exist, -and the `RGB255` function just casts these numbers to `uint8`, creating wrap-around and -what looks like a completely broken gradient. What you want to do, is either use more -reasonable values of colors which actually exist in RGB, or just `Clamp()` the resulting -color to its nearest existing one, living with the consequences: -`HCL(190.0, 1.0, 1.0).Clamp().RGB255()`. It will look something like this: - - - -[Here's an issue going in-depth about this](https://github.com/lucasb-eyer/go-colorful/issues/14), -as well as [my answer](https://github.com/lucasb-eyer/go-colorful/issues/14#issuecomment-324205385), -both with code and pretty pictures. Also note that this was somewhat covered above in the -["Blending colors" section](https://github.com/lucasb-eyer/go-colorful#blending-colors). - -### Q: In a tight loop, conversion to Lab/Luv/HCl/... are slooooow! -A: Yes, they are. -This library aims for correctness, readability, and modularity; it wasn't written with speed in mind. -A large part of the slowness comes from these conversions going through `LinearRgb` which uses powers. -I implemented a fast approximation to `LinearRgb` called `FastLinearRgb` by using Taylor approximations. -The approximation is roughly 5x faster and precise up to roughly 0.5%, -the major caveat being that if the input values are outside the range 0-1, accuracy drops dramatically. -You can use these in your conversions as follows: - -```go -col := // Get your color somehow -l, a, b := XyzToLab(LinearRgbToXyz(col.LinearRgb())) -``` - -If you need faster versions of `Distance*` and `Blend*` that make use of this fast approximation, -feel free to implement them and open a pull-request, I'll happily accept. - -The derivation of these functions can be followed in [this Jupyter notebook](doc/LinearRGB Approximations.ipynb). -Here's the main figure showing the approximation quality: - -![approximation quality](doc/approx-quality.png) - -More speed could be gained by using SIMD instructions in many places. -You can also get more speed for specific conversions by approximating the full conversion function, -but that is outside the scope of this library. -Thanks to [@ZirconiumX](https://github.com/ZirconiumX) for starting this investigation, -see [issue #18](https://github.com/lucasb-eyer/go-colorful/issues/18) for details. - -### Q: Why would `MakeColor` ever fail!? -A: `MakeColor` fails when the alpha channel is zero. In that case, the -conversion is undefined. See [issue 21](https://github.com/lucasb-eyer/go-colorful/issues/21) -as well as the short caveat note in the ["The `color.Color` interface"](README.md#the-colorcolor-interface) -section above. - -Who? -==== - -This library has been developed by Lucas Beyer with contributions from -Bastien Dejean (@baskerville), Phil Kulak (@pkulak) and Christian Muehlhaeuser (@muesli). - -Release Notes -============= - -### Version 1.0 -- API Breaking change in `MakeColor`: instead of `panic`ing when alpha is zero, it now returns a secondary, boolean return value indicating success. See [the color.Color interface](https://github.com/lucasb-eyer/go-colorful#the-colorcolor-interface) section and [this FAQ entry](https://github.com/lucasb-eyer/go-colorful#q-why-would-makecolor-ever-fail) for details. - -### Version 0.9 -- Initial version number after having ignored versioning for a long time :) - -License: MIT -============ -Copyright (c) 2013 Lucas Beyer - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/vendor/github.com/lucasb-eyer/go-colorful/colorgens.go b/vendor/github.com/lucasb-eyer/go-colorful/colorgens.go deleted file mode 100644 index 2e2e49e1..00000000 --- a/vendor/github.com/lucasb-eyer/go-colorful/colorgens.go +++ /dev/null @@ -1,55 +0,0 @@ -// Various ways to generate single random colors - -package colorful - -import ( - "math/rand" -) - -// Creates a random dark, "warm" color through a restricted HSV space. -func FastWarmColor() Color { - return Hsv( - rand.Float64()*360.0, - 0.5+rand.Float64()*0.3, - 0.3+rand.Float64()*0.3) -} - -// Creates a random dark, "warm" color through restricted HCL space. -// This is slower than FastWarmColor but will likely give you colors which have -// the same "warmness" if you run it many times. -func WarmColor() (c Color) { - for c = randomWarm(); !c.IsValid(); c = randomWarm() { - } - return -} - -func randomWarm() Color { - return Hcl( - rand.Float64()*360.0, - 0.1+rand.Float64()*0.3, - 0.2+rand.Float64()*0.3) -} - -// Creates a random bright, "pimpy" color through a restricted HSV space. -func FastHappyColor() Color { - return Hsv( - rand.Float64()*360.0, - 0.7+rand.Float64()*0.3, - 0.6+rand.Float64()*0.3) -} - -// Creates a random bright, "pimpy" color through restricted HCL space. -// This is slower than FastHappyColor but will likely give you colors which -// have the same "brightness" if you run it many times. -func HappyColor() (c Color) { - for c = randomPimp(); !c.IsValid(); c = randomPimp() { - } - return -} - -func randomPimp() Color { - return Hcl( - rand.Float64()*360.0, - 0.5+rand.Float64()*0.3, - 0.5+rand.Float64()*0.3) -} diff --git a/vendor/github.com/lucasb-eyer/go-colorful/colors.go b/vendor/github.com/lucasb-eyer/go-colorful/colors.go deleted file mode 100644 index 29870df0..00000000 --- a/vendor/github.com/lucasb-eyer/go-colorful/colors.go +++ /dev/null @@ -1,903 +0,0 @@ -// The colorful package provides all kinds of functions for working with colors. -package colorful - -import ( - "fmt" - "image/color" - "math" -) - -// A color is stored internally using sRGB (standard RGB) values in the range 0-1 -type Color struct { - R, G, B float64 -} - -// Implement the Go color.Color interface. -func (col Color) RGBA() (r, g, b, a uint32) { - r = uint32(col.R*65535.0 + 0.5) - g = uint32(col.G*65535.0 + 0.5) - b = uint32(col.B*65535.0 + 0.5) - a = 0xFFFF - return -} - -// Constructs a colorful.Color from something implementing color.Color -func MakeColor(col color.Color) (Color, bool) { - r, g, b, a := col.RGBA() - if a == 0 { - return Color{0, 0, 0}, false - } - - // Since color.Color is alpha pre-multiplied, we need to divide the - // RGB values by alpha again in order to get back the original RGB. - r *= 0xffff - r /= a - g *= 0xffff - g /= a - b *= 0xffff - b /= a - - return Color{float64(r) / 65535.0, float64(g) / 65535.0, float64(b) / 65535.0}, true -} - -// Might come in handy sometimes to reduce boilerplate code. -func (col Color) RGB255() (r, g, b uint8) { - r = uint8(col.R*255.0 + 0.5) - g = uint8(col.G*255.0 + 0.5) - b = uint8(col.B*255.0 + 0.5) - return -} - -// This is the tolerance used when comparing colors using AlmostEqualRgb. -const Delta = 1.0 / 255.0 - -// This is the default reference white point. -var D65 = [3]float64{0.95047, 1.00000, 1.08883} - -// And another one. -var D50 = [3]float64{0.96422, 1.00000, 0.82521} - -// Checks whether the color exists in RGB space, i.e. all values are in [0..1] -func (c Color) IsValid() bool { - return 0.0 <= c.R && c.R <= 1.0 && - 0.0 <= c.G && c.G <= 1.0 && - 0.0 <= c.B && c.B <= 1.0 -} - -func clamp01(v float64) float64 { - return math.Max(0.0, math.Min(v, 1.0)) -} - -// Returns Clamps the color into valid range, clamping each value to [0..1] -// If the color is valid already, this is a no-op. -func (c Color) Clamped() Color { - return Color{clamp01(c.R), clamp01(c.G), clamp01(c.B)} -} - -func sq(v float64) float64 { - return v * v -} - -func cub(v float64) float64 { - return v * v * v -} - -// DistanceRgb computes the distance between two colors in RGB space. -// This is not a good measure! Rather do it in Lab space. -func (c1 Color) DistanceRgb(c2 Color) float64 { - return math.Sqrt(sq(c1.R-c2.R) + sq(c1.G-c2.G) + sq(c1.B-c2.B)) -} - -// Check for equality between colors within the tolerance Delta (1/255). -func (c1 Color) AlmostEqualRgb(c2 Color) bool { - return math.Abs(c1.R-c2.R)+ - math.Abs(c1.G-c2.G)+ - math.Abs(c1.B-c2.B) < 3.0*Delta -} - -// You don't really want to use this, do you? Go for BlendLab, BlendLuv or BlendHcl. -func (c1 Color) BlendRgb(c2 Color, t float64) Color { - return Color{c1.R + t*(c2.R-c1.R), - c1.G + t*(c2.G-c1.G), - c1.B + t*(c2.B-c1.B)} -} - -// Utility used by Hxx color-spaces for interpolating between two angles in [0,360]. -func interp_angle(a0, a1, t float64) float64 { - // Based on the answer here: http://stackoverflow.com/a/14498790/2366315 - // With potential proof that it works here: http://math.stackexchange.com/a/2144499 - delta := math.Mod(math.Mod(a1-a0, 360.0)+540, 360.0) - 180.0 - return math.Mod(a0+t*delta+360.0, 360.0) -} - -/// HSV /// -/////////// -// From http://en.wikipedia.org/wiki/HSL_and_HSV -// Note that h is in [0..360] and s,v in [0..1] - -// Hsv returns the Hue [0..360], Saturation and Value [0..1] of the color. -func (col Color) Hsv() (h, s, v float64) { - min := math.Min(math.Min(col.R, col.G), col.B) - v = math.Max(math.Max(col.R, col.G), col.B) - C := v - min - - s = 0.0 - if v != 0.0 { - s = C / v - } - - h = 0.0 // We use 0 instead of undefined as in wp. - if min != v { - if v == col.R { - h = math.Mod((col.G-col.B)/C, 6.0) - } - if v == col.G { - h = (col.B-col.R)/C + 2.0 - } - if v == col.B { - h = (col.R-col.G)/C + 4.0 - } - h *= 60.0 - if h < 0.0 { - h += 360.0 - } - } - return -} - -// Hsv creates a new Color given a Hue in [0..360], a Saturation and a Value in [0..1] -func Hsv(H, S, V float64) Color { - Hp := H / 60.0 - C := V * S - X := C * (1.0 - math.Abs(math.Mod(Hp, 2.0)-1.0)) - - m := V - C - r, g, b := 0.0, 0.0, 0.0 - - switch { - case 0.0 <= Hp && Hp < 1.0: - r = C - g = X - case 1.0 <= Hp && Hp < 2.0: - r = X - g = C - case 2.0 <= Hp && Hp < 3.0: - g = C - b = X - case 3.0 <= Hp && Hp < 4.0: - g = X - b = C - case 4.0 <= Hp && Hp < 5.0: - r = X - b = C - case 5.0 <= Hp && Hp < 6.0: - r = C - b = X - } - - return Color{m + r, m + g, m + b} -} - -// You don't really want to use this, do you? Go for BlendLab, BlendLuv or BlendHcl. -func (c1 Color) BlendHsv(c2 Color, t float64) Color { - h1, s1, v1 := c1.Hsv() - h2, s2, v2 := c2.Hsv() - - // We know that h are both in [0..360] - return Hsv(interp_angle(h1, h2, t), s1+t*(s2-s1), v1+t*(v2-v1)) -} - -/// HSL /// -/////////// - -// Hsl returns the Hue [0..360], Saturation [0..1], and Luminance (lightness) [0..1] of the color. -func (col Color) Hsl() (h, s, l float64) { - min := math.Min(math.Min(col.R, col.G), col.B) - max := math.Max(math.Max(col.R, col.G), col.B) - - l = (max + min) / 2 - - if min == max { - s = 0 - h = 0 - } else { - if l < 0.5 { - s = (max - min) / (max + min) - } else { - s = (max - min) / (2.0 - max - min) - } - - if max == col.R { - h = (col.G - col.B) / (max - min) - } else if max == col.G { - h = 2.0 + (col.B-col.R)/(max-min) - } else { - h = 4.0 + (col.R-col.G)/(max-min) - } - - h *= 60 - - if h < 0 { - h += 360 - } - } - - return -} - -// Hsl creates a new Color given a Hue in [0..360], a Saturation [0..1], and a Luminance (lightness) in [0..1] -func Hsl(h, s, l float64) Color { - if s == 0 { - return Color{l, l, l} - } - - var r, g, b float64 - var t1 float64 - var t2 float64 - var tr float64 - var tg float64 - var tb float64 - - if l < 0.5 { - t1 = l * (1.0 + s) - } else { - t1 = l + s - l*s - } - - t2 = 2*l - t1 - h /= 360 - tr = h + 1.0/3.0 - tg = h - tb = h - 1.0/3.0 - - if tr < 0 { - tr++ - } - if tr > 1 { - tr-- - } - if tg < 0 { - tg++ - } - if tg > 1 { - tg-- - } - if tb < 0 { - tb++ - } - if tb > 1 { - tb-- - } - - // Red - if 6*tr < 1 { - r = t2 + (t1-t2)*6*tr - } else if 2*tr < 1 { - r = t1 - } else if 3*tr < 2 { - r = t2 + (t1-t2)*(2.0/3.0-tr)*6 - } else { - r = t2 - } - - // Green - if 6*tg < 1 { - g = t2 + (t1-t2)*6*tg - } else if 2*tg < 1 { - g = t1 - } else if 3*tg < 2 { - g = t2 + (t1-t2)*(2.0/3.0-tg)*6 - } else { - g = t2 - } - - // Blue - if 6*tb < 1 { - b = t2 + (t1-t2)*6*tb - } else if 2*tb < 1 { - b = t1 - } else if 3*tb < 2 { - b = t2 + (t1-t2)*(2.0/3.0-tb)*6 - } else { - b = t2 - } - - return Color{r, g, b} -} - -/// Hex /// -/////////// - -// Hex returns the hex "html" representation of the color, as in #ff0080. -func (col Color) Hex() string { - // Add 0.5 for rounding - return fmt.Sprintf("#%02x%02x%02x", uint8(col.R*255.0+0.5), uint8(col.G*255.0+0.5), uint8(col.B*255.0+0.5)) -} - -// Hex parses a "html" hex color-string, either in the 3 "#f0c" or 6 "#ff1034" digits form. -func Hex(scol string) (Color, error) { - format := "#%02x%02x%02x" - factor := 1.0 / 255.0 - if len(scol) == 4 { - format = "#%1x%1x%1x" - factor = 1.0 / 15.0 - } - - var r, g, b uint8 - n, err := fmt.Sscanf(scol, format, &r, &g, &b) - if err != nil { - return Color{}, err - } - if n != 3 { - return Color{}, fmt.Errorf("color: %v is not a hex-color", scol) - } - - return Color{float64(r) * factor, float64(g) * factor, float64(b) * factor}, nil -} - -/// Linear /// -////////////// -// http://www.sjbrown.co.uk/2004/05/14/gamma-correct-rendering/ -// http://www.brucelindbloom.com/Eqn_RGB_to_XYZ.html - -func linearize(v float64) float64 { - if v <= 0.04045 { - return v / 12.92 - } - return math.Pow((v+0.055)/1.055, 2.4) -} - -// LinearRgb converts the color into the linear RGB space (see http://www.sjbrown.co.uk/2004/05/14/gamma-correct-rendering/). -func (col Color) LinearRgb() (r, g, b float64) { - r = linearize(col.R) - g = linearize(col.G) - b = linearize(col.B) - return -} - -// A much faster and still quite precise linearization using a 6th-order Taylor approximation. -// See the accompanying Jupyter notebook for derivation of the constants. -func linearize_fast(v float64) float64 { - v1 := v - 0.5 - v2 := v1 * v1 - v3 := v2 * v1 - v4 := v2 * v2 - //v5 := v3*v2 - return -0.248750514614486 + 0.925583310193438*v + 1.16740237321695*v2 + 0.280457026598666*v3 - 0.0757991963780179*v4 //+ 0.0437040411548932*v5 -} - -// FastLinearRgb is much faster than and almost as accurate as LinearRgb. -// BUT it is important to NOTE that they only produce good results for valid colors r,g,b in [0,1]. -func (col Color) FastLinearRgb() (r, g, b float64) { - r = linearize_fast(col.R) - g = linearize_fast(col.G) - b = linearize_fast(col.B) - return -} - -func delinearize(v float64) float64 { - if v <= 0.0031308 { - return 12.92 * v - } - return 1.055*math.Pow(v, 1.0/2.4) - 0.055 -} - -// LinearRgb creates an sRGB color out of the given linear RGB color (see http://www.sjbrown.co.uk/2004/05/14/gamma-correct-rendering/). -func LinearRgb(r, g, b float64) Color { - return Color{delinearize(r), delinearize(g), delinearize(b)} -} - -func delinearize_fast(v float64) float64 { - // This function (fractional root) is much harder to linearize, so we need to split. - if v > 0.2 { - v1 := v - 0.6 - v2 := v1 * v1 - v3 := v2 * v1 - v4 := v2 * v2 - v5 := v3 * v2 - return 0.442430344268235 + 0.592178981271708*v - 0.287864782562636*v2 + 0.253214392068985*v3 - 0.272557158129811*v4 + 0.325554383321718*v5 - } else if v > 0.03 { - v1 := v - 0.115 - v2 := v1 * v1 - v3 := v2 * v1 - v4 := v2 * v2 - v5 := v3 * v2 - return 0.194915592891669 + 1.55227076330229*v - 3.93691860257828*v2 + 18.0679839248761*v3 - 101.468750302746*v4 + 632.341487393927*v5 - } else { - v1 := v - 0.015 - v2 := v1 * v1 - v3 := v2 * v1 - v4 := v2 * v2 - v5 := v3 * v2 - // You can clearly see from the involved constants that the low-end is highly nonlinear. - return 0.0519565234928877 + 5.09316778537561*v - 99.0338180489702*v2 + 3484.52322764895*v3 - 150028.083412663*v4 + 7168008.42971613*v5 - } -} - -// FastLinearRgb is much faster than and almost as accurate as LinearRgb. -// BUT it is important to NOTE that they only produce good results for valid inputs r,g,b in [0,1]. -func FastLinearRgb(r, g, b float64) Color { - return Color{delinearize_fast(r), delinearize_fast(g), delinearize_fast(b)} -} - -// XyzToLinearRgb converts from CIE XYZ-space to Linear RGB space. -func XyzToLinearRgb(x, y, z float64) (r, g, b float64) { - r = 3.2404542*x - 1.5371385*y - 0.4985314*z - g = -0.9692660*x + 1.8760108*y + 0.0415560*z - b = 0.0556434*x - 0.2040259*y + 1.0572252*z - return -} - -func LinearRgbToXyz(r, g, b float64) (x, y, z float64) { - x = 0.4124564*r + 0.3575761*g + 0.1804375*b - y = 0.2126729*r + 0.7151522*g + 0.0721750*b - z = 0.0193339*r + 0.1191920*g + 0.9503041*b - return -} - -/// XYZ /// -/////////// -// http://www.sjbrown.co.uk/2004/05/14/gamma-correct-rendering/ - -func (col Color) Xyz() (x, y, z float64) { - return LinearRgbToXyz(col.LinearRgb()) -} - -func Xyz(x, y, z float64) Color { - return LinearRgb(XyzToLinearRgb(x, y, z)) -} - -/// xyY /// -/////////// -// http://www.brucelindbloom.com/Eqn_XYZ_to_xyY.html - -// Well, the name is bad, since it's xyY but Golang needs me to start with a -// capital letter to make the method public. -func XyzToXyy(X, Y, Z float64) (x, y, Yout float64) { - return XyzToXyyWhiteRef(X, Y, Z, D65) -} - -func XyzToXyyWhiteRef(X, Y, Z float64, wref [3]float64) (x, y, Yout float64) { - Yout = Y - N := X + Y + Z - if math.Abs(N) < 1e-14 { - // When we have black, Bruce Lindbloom recommends to use - // the reference white's chromacity for x and y. - x = wref[0] / (wref[0] + wref[1] + wref[2]) - y = wref[1] / (wref[0] + wref[1] + wref[2]) - } else { - x = X / N - y = Y / N - } - return -} - -func XyyToXyz(x, y, Y float64) (X, Yout, Z float64) { - Yout = Y - - if -1e-14 < y && y < 1e-14 { - X = 0.0 - Z = 0.0 - } else { - X = Y / y * x - Z = Y / y * (1.0 - x - y) - } - - return -} - -// Converts the given color to CIE xyY space using D65 as reference white. -// (Note that the reference white is only used for black input.) -// x, y and Y are in [0..1] -func (col Color) Xyy() (x, y, Y float64) { - return XyzToXyy(col.Xyz()) -} - -// Converts the given color to CIE xyY space, taking into account -// a given reference white. (i.e. the monitor's white) -// (Note that the reference white is only used for black input.) -// x, y and Y are in [0..1] -func (col Color) XyyWhiteRef(wref [3]float64) (x, y, Y float64) { - X, Y2, Z := col.Xyz() - return XyzToXyyWhiteRef(X, Y2, Z, wref) -} - -// Generates a color by using data given in CIE xyY space. -// x, y and Y are in [0..1] -func Xyy(x, y, Y float64) Color { - return Xyz(XyyToXyz(x, y, Y)) -} - -/// L*a*b* /// -////////////// -// http://en.wikipedia.org/wiki/Lab_color_space#CIELAB-CIEXYZ_conversions -// For L*a*b*, we need to L*a*b*<->XYZ->RGB and the first one is device dependent. - -func lab_f(t float64) float64 { - if t > 6.0/29.0*6.0/29.0*6.0/29.0 { - return math.Cbrt(t) - } - return t/3.0*29.0/6.0*29.0/6.0 + 4.0/29.0 -} - -func XyzToLab(x, y, z float64) (l, a, b float64) { - // Use D65 white as reference point by default. - // http://www.fredmiranda.com/forum/topic/1035332 - // http://en.wikipedia.org/wiki/Standard_illuminant - return XyzToLabWhiteRef(x, y, z, D65) -} - -func XyzToLabWhiteRef(x, y, z float64, wref [3]float64) (l, a, b float64) { - fy := lab_f(y / wref[1]) - l = 1.16*fy - 0.16 - a = 5.0 * (lab_f(x/wref[0]) - fy) - b = 2.0 * (fy - lab_f(z/wref[2])) - return -} - -func lab_finv(t float64) float64 { - if t > 6.0/29.0 { - return t * t * t - } - return 3.0 * 6.0 / 29.0 * 6.0 / 29.0 * (t - 4.0/29.0) -} - -func LabToXyz(l, a, b float64) (x, y, z float64) { - // D65 white (see above). - return LabToXyzWhiteRef(l, a, b, D65) -} - -func LabToXyzWhiteRef(l, a, b float64, wref [3]float64) (x, y, z float64) { - l2 := (l + 0.16) / 1.16 - x = wref[0] * lab_finv(l2+a/5.0) - y = wref[1] * lab_finv(l2) - z = wref[2] * lab_finv(l2-b/2.0) - return -} - -// Converts the given color to CIE L*a*b* space using D65 as reference white. -func (col Color) Lab() (l, a, b float64) { - return XyzToLab(col.Xyz()) -} - -// Converts the given color to CIE L*a*b* space, taking into account -// a given reference white. (i.e. the monitor's white) -func (col Color) LabWhiteRef(wref [3]float64) (l, a, b float64) { - x, y, z := col.Xyz() - return XyzToLabWhiteRef(x, y, z, wref) -} - -// Generates a color by using data given in CIE L*a*b* space using D65 as reference white. -// WARNING: many combinations of `l`, `a`, and `b` values do not have corresponding -// valid RGB values, check the FAQ in the README if you're unsure. -func Lab(l, a, b float64) Color { - return Xyz(LabToXyz(l, a, b)) -} - -// Generates a color by using data given in CIE L*a*b* space, taking -// into account a given reference white. (i.e. the monitor's white) -func LabWhiteRef(l, a, b float64, wref [3]float64) Color { - return Xyz(LabToXyzWhiteRef(l, a, b, wref)) -} - -// DistanceLab is a good measure of visual similarity between two colors! -// A result of 0 would mean identical colors, while a result of 1 or higher -// means the colors differ a lot. -func (c1 Color) DistanceLab(c2 Color) float64 { - l1, a1, b1 := c1.Lab() - l2, a2, b2 := c2.Lab() - return math.Sqrt(sq(l1-l2) + sq(a1-a2) + sq(b1-b2)) -} - -// That's actually the same, but I don't want to break code. -func (c1 Color) DistanceCIE76(c2 Color) float64 { - return c1.DistanceLab(c2) -} - -// Uses the CIE94 formula to calculate color distance. More accurate than -// DistanceLab, but also more work. -func (cl Color) DistanceCIE94(cr Color) float64 { - l1, a1, b1 := cl.Lab() - l2, a2, b2 := cr.Lab() - - // NOTE: Since all those formulas expect L,a,b values 100x larger than we - // have them in this library, we either need to adjust all constants - // in the formula, or convert the ranges of L,a,b before, and then - // scale the distances down again. The latter is less error-prone. - l1, a1, b1 = l1*100.0, a1*100.0, b1*100.0 - l2, a2, b2 = l2*100.0, a2*100.0, b2*100.0 - - kl := 1.0 // 2.0 for textiles - kc := 1.0 - kh := 1.0 - k1 := 0.045 // 0.048 for textiles - k2 := 0.015 // 0.014 for textiles. - - deltaL := l1 - l2 - c1 := math.Sqrt(sq(a1) + sq(b1)) - c2 := math.Sqrt(sq(a2) + sq(b2)) - deltaCab := c1 - c2 - - // Not taking Sqrt here for stability, and it's unnecessary. - deltaHab2 := sq(a1-a2) + sq(b1-b2) - sq(deltaCab) - sl := 1.0 - sc := 1.0 + k1*c1 - sh := 1.0 + k2*c1 - - vL2 := sq(deltaL / (kl * sl)) - vC2 := sq(deltaCab / (kc * sc)) - vH2 := deltaHab2 / sq(kh*sh) - - return math.Sqrt(vL2+vC2+vH2) * 0.01 // See above. -} - -// DistanceCIEDE2000 uses the Delta E 2000 formula to calculate color -// distance. It is more expensive but more accurate than both DistanceLab -// and DistanceCIE94. -func (cl Color) DistanceCIEDE2000(cr Color) float64 { - return cl.DistanceCIEDE2000klch(cr, 1.0, 1.0, 1.0) -} - -// DistanceCIEDE2000klch uses the Delta E 2000 formula with custom values -// for the weighting factors kL, kC, and kH. -func (cl Color) DistanceCIEDE2000klch(cr Color, kl, kc, kh float64) float64 { - l1, a1, b1 := cl.Lab() - l2, a2, b2 := cr.Lab() - - // As with CIE94, we scale up the ranges of L,a,b beforehand and scale - // them down again afterwards. - l1, a1, b1 = l1*100.0, a1*100.0, b1*100.0 - l2, a2, b2 = l2*100.0, a2*100.0, b2*100.0 - - cab1 := math.Sqrt(sq(a1) + sq(b1)) - cab2 := math.Sqrt(sq(a2) + sq(b2)) - cabmean := (cab1 + cab2) / 2 - - g := 0.5 * (1 - math.Sqrt(math.Pow(cabmean, 7)/(math.Pow(cabmean, 7)+math.Pow(25, 7)))) - ap1 := (1 + g) * a1 - ap2 := (1 + g) * a2 - cp1 := math.Sqrt(sq(ap1) + sq(b1)) - cp2 := math.Sqrt(sq(ap2) + sq(b2)) - - hp1 := 0.0 - if b1 != ap1 || ap1 != 0 { - hp1 = math.Atan2(b1, ap1) - if hp1 < 0 { - hp1 += math.Pi * 2 - } - hp1 *= 180 / math.Pi - } - hp2 := 0.0 - if b2 != ap2 || ap2 != 0 { - hp2 = math.Atan2(b2, ap2) - if hp2 < 0 { - hp2 += math.Pi * 2 - } - hp2 *= 180 / math.Pi - } - - deltaLp := l2 - l1 - deltaCp := cp2 - cp1 - dhp := 0.0 - cpProduct := cp1 * cp2 - if cpProduct != 0 { - dhp = hp2 - hp1 - if dhp > 180 { - dhp -= 360 - } else if dhp < -180 { - dhp += 360 - } - } - deltaHp := 2 * math.Sqrt(cpProduct) * math.Sin(dhp/2*math.Pi/180) - - lpmean := (l1 + l2) / 2 - cpmean := (cp1 + cp2) / 2 - hpmean := hp1 + hp2 - if cpProduct != 0 { - hpmean /= 2 - if math.Abs(hp1-hp2) > 180 { - if hp1+hp2 < 360 { - hpmean += 180 - } else { - hpmean -= 180 - } - } - } - - t := 1 - 0.17*math.Cos((hpmean-30)*math.Pi/180) + 0.24*math.Cos(2*hpmean*math.Pi/180) + 0.32*math.Cos((3*hpmean+6)*math.Pi/180) - 0.2*math.Cos((4*hpmean-63)*math.Pi/180) - deltaTheta := 30 * math.Exp(-sq((hpmean-275)/25)) - rc := 2 * math.Sqrt(math.Pow(cpmean, 7)/(math.Pow(cpmean, 7)+math.Pow(25, 7))) - sl := 1 + (0.015*sq(lpmean-50))/math.Sqrt(20+sq(lpmean-50)) - sc := 1 + 0.045*cpmean - sh := 1 + 0.015*cpmean*t - rt := -math.Sin(2*deltaTheta*math.Pi/180) * rc - - return math.Sqrt(sq(deltaLp/(kl*sl))+sq(deltaCp/(kc*sc))+sq(deltaHp/(kh*sh))+rt*(deltaCp/(kc*sc))*(deltaHp/(kh*sh))) * 0.01 -} - -// BlendLab blends two colors in the L*a*b* color-space, which should result in a smoother blend. -// t == 0 results in c1, t == 1 results in c2 -func (c1 Color) BlendLab(c2 Color, t float64) Color { - l1, a1, b1 := c1.Lab() - l2, a2, b2 := c2.Lab() - return Lab(l1+t*(l2-l1), - a1+t*(a2-a1), - b1+t*(b2-b1)) -} - -/// L*u*v* /// -////////////// -// http://en.wikipedia.org/wiki/CIELUV#XYZ_.E2.86.92_CIELUV_and_CIELUV_.E2.86.92_XYZ_conversions -// For L*u*v*, we need to L*u*v*<->XYZ<->RGB and the first one is device dependent. - -func XyzToLuv(x, y, z float64) (l, a, b float64) { - // Use D65 white as reference point by default. - // http://www.fredmiranda.com/forum/topic/1035332 - // http://en.wikipedia.org/wiki/Standard_illuminant - return XyzToLuvWhiteRef(x, y, z, D65) -} - -func XyzToLuvWhiteRef(x, y, z float64, wref [3]float64) (l, u, v float64) { - if y/wref[1] <= 6.0/29.0*6.0/29.0*6.0/29.0 { - l = y / wref[1] * 29.0 / 3.0 * 29.0 / 3.0 * 29.0 / 3.0 - } else { - l = 1.16*math.Cbrt(y/wref[1]) - 0.16 - } - ubis, vbis := xyz_to_uv(x, y, z) - un, vn := xyz_to_uv(wref[0], wref[1], wref[2]) - u = 13.0 * l * (ubis - un) - v = 13.0 * l * (vbis - vn) - return -} - -// For this part, we do as R's graphics.hcl does, not as wikipedia does. -// Or is it the same? -func xyz_to_uv(x, y, z float64) (u, v float64) { - denom := x + 15.0*y + 3.0*z - if denom == 0.0 { - u, v = 0.0, 0.0 - } else { - u = 4.0 * x / denom - v = 9.0 * y / denom - } - return -} - -func LuvToXyz(l, u, v float64) (x, y, z float64) { - // D65 white (see above). - return LuvToXyzWhiteRef(l, u, v, D65) -} - -func LuvToXyzWhiteRef(l, u, v float64, wref [3]float64) (x, y, z float64) { - //y = wref[1] * lab_finv((l + 0.16) / 1.16) - if l <= 0.08 { - y = wref[1] * l * 100.0 * 3.0 / 29.0 * 3.0 / 29.0 * 3.0 / 29.0 - } else { - y = wref[1] * cub((l+0.16)/1.16) - } - un, vn := xyz_to_uv(wref[0], wref[1], wref[2]) - if l != 0.0 { - ubis := u/(13.0*l) + un - vbis := v/(13.0*l) + vn - x = y * 9.0 * ubis / (4.0 * vbis) - z = y * (12.0 - 3.0*ubis - 20.0*vbis) / (4.0 * vbis) - } else { - x, y = 0.0, 0.0 - } - return -} - -// Converts the given color to CIE L*u*v* space using D65 as reference white. -// L* is in [0..1] and both u* and v* are in about [-1..1] -func (col Color) Luv() (l, u, v float64) { - return XyzToLuv(col.Xyz()) -} - -// Converts the given color to CIE L*u*v* space, taking into account -// a given reference white. (i.e. the monitor's white) -// L* is in [0..1] and both u* and v* are in about [-1..1] -func (col Color) LuvWhiteRef(wref [3]float64) (l, u, v float64) { - x, y, z := col.Xyz() - return XyzToLuvWhiteRef(x, y, z, wref) -} - -// Generates a color by using data given in CIE L*u*v* space using D65 as reference white. -// L* is in [0..1] and both u* and v* are in about [-1..1] -// WARNING: many combinations of `l`, `a`, and `b` values do not have corresponding -// valid RGB values, check the FAQ in the README if you're unsure. -func Luv(l, u, v float64) Color { - return Xyz(LuvToXyz(l, u, v)) -} - -// Generates a color by using data given in CIE L*u*v* space, taking -// into account a given reference white. (i.e. the monitor's white) -// L* is in [0..1] and both u* and v* are in about [-1..1] -func LuvWhiteRef(l, u, v float64, wref [3]float64) Color { - return Xyz(LuvToXyzWhiteRef(l, u, v, wref)) -} - -// DistanceLuv is a good measure of visual similarity between two colors! -// A result of 0 would mean identical colors, while a result of 1 or higher -// means the colors differ a lot. -func (c1 Color) DistanceLuv(c2 Color) float64 { - l1, u1, v1 := c1.Luv() - l2, u2, v2 := c2.Luv() - return math.Sqrt(sq(l1-l2) + sq(u1-u2) + sq(v1-v2)) -} - -// BlendLuv blends two colors in the CIE-L*u*v* color-space, which should result in a smoother blend. -// t == 0 results in c1, t == 1 results in c2 -func (c1 Color) BlendLuv(c2 Color, t float64) Color { - l1, u1, v1 := c1.Luv() - l2, u2, v2 := c2.Luv() - return Luv(l1+t*(l2-l1), - u1+t*(u2-u1), - v1+t*(v2-v1)) -} - -/// HCL /// -/////////// -// HCL is nothing else than L*a*b* in cylindrical coordinates! -// (this was wrong on English wikipedia, I fixed it, let's hope the fix stays.) -// But it is widely popular since it is a "correct HSV" -// http://www.hunterlab.com/appnotes/an09_96a.pdf - -// Converts the given color to HCL space using D65 as reference white. -// H values are in [0..360], C and L values are in [0..1] although C can overshoot 1.0 -func (col Color) Hcl() (h, c, l float64) { - return col.HclWhiteRef(D65) -} - -func LabToHcl(L, a, b float64) (h, c, l float64) { - // Oops, floating point workaround necessary if a ~= b and both are very small (i.e. almost zero). - if math.Abs(b-a) > 1e-4 && math.Abs(a) > 1e-4 { - h = math.Mod(57.29577951308232087721*math.Atan2(b, a)+360.0, 360.0) // Rad2Deg - } else { - h = 0.0 - } - c = math.Sqrt(sq(a) + sq(b)) - l = L - return -} - -// Converts the given color to HCL space, taking into account -// a given reference white. (i.e. the monitor's white) -// H values are in [0..360], C and L values are in [0..1] -func (col Color) HclWhiteRef(wref [3]float64) (h, c, l float64) { - L, a, b := col.LabWhiteRef(wref) - return LabToHcl(L, a, b) -} - -// Generates a color by using data given in HCL space using D65 as reference white. -// H values are in [0..360], C and L values are in [0..1] -// WARNING: many combinations of `l`, `a`, and `b` values do not have corresponding -// valid RGB values, check the FAQ in the README if you're unsure. -func Hcl(h, c, l float64) Color { - return HclWhiteRef(h, c, l, D65) -} - -func HclToLab(h, c, l float64) (L, a, b float64) { - H := 0.01745329251994329576 * h // Deg2Rad - a = c * math.Cos(H) - b = c * math.Sin(H) - L = l - return -} - -// Generates a color by using data given in HCL space, taking -// into account a given reference white. (i.e. the monitor's white) -// H values are in [0..360], C and L values are in [0..1] -func HclWhiteRef(h, c, l float64, wref [3]float64) Color { - L, a, b := HclToLab(h, c, l) - return LabWhiteRef(L, a, b, wref) -} - -// BlendHcl blends two colors in the CIE-L*C*h° color-space, which should result in a smoother blend. -// t == 0 results in c1, t == 1 results in c2 -func (col1 Color) BlendHcl(col2 Color, t float64) Color { - h1, c1, l1 := col1.Hcl() - h2, c2, l2 := col2.Hcl() - - // We know that h are both in [0..360] - return Hcl(interp_angle(h1, h2, t), c1+t*(c2-c1), l1+t*(l2-l1)) -} diff --git a/vendor/github.com/lucasb-eyer/go-colorful/happy_palettegen.go b/vendor/github.com/lucasb-eyer/go-colorful/happy_palettegen.go deleted file mode 100644 index bb66dfa4..00000000 --- a/vendor/github.com/lucasb-eyer/go-colorful/happy_palettegen.go +++ /dev/null @@ -1,25 +0,0 @@ -package colorful - -import ( - "math/rand" -) - -// Uses the HSV color space to generate colors with similar S,V but distributed -// evenly along their Hue. This is fast but not always pretty. -// If you've got time to spare, use Lab (the non-fast below). -func FastHappyPalette(colorsCount int) (colors []Color) { - colors = make([]Color, colorsCount) - - for i := 0; i < colorsCount; i++ { - colors[i] = Hsv(float64(i)*(360.0/float64(colorsCount)), 0.8+rand.Float64()*0.2, 0.65+rand.Float64()*0.2) - } - return -} - -func HappyPalette(colorsCount int) ([]Color, error) { - pimpy := func(l, a, b float64) bool { - _, c, _ := LabToHcl(l, a, b) - return 0.3 <= c && 0.4 <= l && l <= 0.8 - } - return SoftPaletteEx(colorsCount, SoftPaletteSettings{pimpy, 50, true}) -} diff --git a/vendor/github.com/lucasb-eyer/go-colorful/hexcolor.go b/vendor/github.com/lucasb-eyer/go-colorful/hexcolor.go deleted file mode 100644 index 86a5ed98..00000000 --- a/vendor/github.com/lucasb-eyer/go-colorful/hexcolor.go +++ /dev/null @@ -1,37 +0,0 @@ -package colorful - -import ( - "database/sql/driver" - "fmt" - "reflect" -) - -// A HexColor is a Color stored as a hex string "#rrggbb". It implements the -// database/sql.Scanner and database/sql/driver.Value interfaces. -type HexColor Color - -type errUnsupportedType struct { - got interface{} - want reflect.Type -} - -func (hc *HexColor) Scan(value interface{}) error { - s, ok := value.(string) - if !ok { - return errUnsupportedType{got: reflect.TypeOf(value), want: reflect.TypeOf("")} - } - c, err := Hex(s) - if err != nil { - return err - } - *hc = HexColor(c) - return nil -} - -func (hc *HexColor) Value() (driver.Value, error) { - return Color(*hc).Hex(), nil -} - -func (e errUnsupportedType) Error() string { - return fmt.Sprintf("unsupported type: got %v, want a %s", e.got, e.want) -} diff --git a/vendor/github.com/lucasb-eyer/go-colorful/soft_palettegen.go b/vendor/github.com/lucasb-eyer/go-colorful/soft_palettegen.go deleted file mode 100644 index 0154ac9b..00000000 --- a/vendor/github.com/lucasb-eyer/go-colorful/soft_palettegen.go +++ /dev/null @@ -1,185 +0,0 @@ -// Largely inspired by the descriptions in http://lab.medialab.sciences-po.fr/iwanthue/ -// but written from scratch. - -package colorful - -import ( - "fmt" - "math" - "math/rand" -) - -// The algorithm works in L*a*b* color space and converts to RGB in the end. -// L* in [0..1], a* and b* in [-1..1] -type lab_t struct { - L, A, B float64 -} - -type SoftPaletteSettings struct { - // A function which can be used to restrict the allowed color-space. - CheckColor func(l, a, b float64) bool - - // The higher, the better quality but the slower. Usually two figures. - Iterations int - - // Use up to 160000 or 8000 samples of the L*a*b* space (and thus calls to CheckColor). - // Set this to true only if your CheckColor shapes the Lab space weirdly. - ManySamples bool -} - -// Yeah, windows-stype Foo, FooEx, screw you golang... -// Uses K-means to cluster the color-space and return the means of the clusters -// as a new palette of distinctive colors. Falls back to K-medoid if the mean -// happens to fall outside of the color-space, which can only happen if you -// specify a CheckColor function. -func SoftPaletteEx(colorsCount int, settings SoftPaletteSettings) ([]Color, error) { - - // Checks whether it's a valid RGB and also fulfills the potentially provided constraint. - check := func(col lab_t) bool { - c := Lab(col.L, col.A, col.B) - return c.IsValid() && (settings.CheckColor == nil || settings.CheckColor(col.L, col.A, col.B)) - } - - // Sample the color space. These will be the points k-means is run on. - dl := 0.05 - dab := 0.1 - if settings.ManySamples { - dl = 0.01 - dab = 0.05 - } - - samples := make([]lab_t, 0, int(1.0/dl*2.0/dab*2.0/dab)) - for l := 0.0; l <= 1.0; l += dl { - for a := -1.0; a <= 1.0; a += dab { - for b := -1.0; b <= 1.0; b += dab { - if check(lab_t{l, a, b}) { - samples = append(samples, lab_t{l, a, b}) - } - } - } - } - - // That would cause some infinite loops down there... - if len(samples) < colorsCount { - return nil, fmt.Errorf("palettegen: more colors requested (%v) than samples available (%v). Your requested color count may be wrong, you might want to use many samples or your constraint function makes the valid color space too small.", colorsCount, len(samples)) - } else if len(samples) == colorsCount { - return labs2cols(samples), nil // Oops? - } - - // We take the initial means out of the samples, so they are in fact medoids. - // This helps us avoid infinite loops or arbitrary cutoffs with too restrictive constraints. - means := make([]lab_t, colorsCount) - for i := 0; i < colorsCount; i++ { - for means[i] = samples[rand.Intn(len(samples))]; in(means, i, means[i]); means[i] = samples[rand.Intn(len(samples))] { - } - } - - clusters := make([]int, len(samples)) - samples_used := make([]bool, len(samples)) - - // The actual k-means/medoid iterations - for i := 0; i < settings.Iterations; i++ { - // Reassing the samples to clusters, i.e. to their closest mean. - // By the way, also check if any sample is used as a medoid and if so, mark that. - for isample, sample := range samples { - samples_used[isample] = false - mindist := math.Inf(+1) - for imean, mean := range means { - dist := lab_dist(sample, mean) - if dist < mindist { - mindist = dist - clusters[isample] = imean - } - - // Mark samples which are used as a medoid. - if lab_eq(sample, mean) { - samples_used[isample] = true - } - } - } - - // Compute new means according to the samples. - for imean := range means { - // The new mean is the average of all samples belonging to it.. - nsamples := 0 - newmean := lab_t{0.0, 0.0, 0.0} - for isample, sample := range samples { - if clusters[isample] == imean { - nsamples++ - newmean.L += sample.L - newmean.A += sample.A - newmean.B += sample.B - } - } - if nsamples > 0 { - newmean.L /= float64(nsamples) - newmean.A /= float64(nsamples) - newmean.B /= float64(nsamples) - } else { - // That mean doesn't have any samples? Get a new mean from the sample list! - var inewmean int - for inewmean = rand.Intn(len(samples_used)); samples_used[inewmean]; inewmean = rand.Intn(len(samples_used)) { - } - newmean = samples[inewmean] - samples_used[inewmean] = true - } - - // But now we still need to check whether the new mean is an allowed color. - if nsamples > 0 && check(newmean) { - // It does, life's good (TM) - means[imean] = newmean - } else { - // New mean isn't an allowed color or doesn't have any samples! - // Switch to medoid mode and pick the closest (unused) sample. - // This should always find something thanks to len(samples) >= colorsCount - mindist := math.Inf(+1) - for isample, sample := range samples { - if !samples_used[isample] { - dist := lab_dist(sample, newmean) - if dist < mindist { - mindist = dist - newmean = sample - } - } - } - } - } - } - return labs2cols(means), nil -} - -// A wrapper which uses common parameters. -func SoftPalette(colorsCount int) ([]Color, error) { - return SoftPaletteEx(colorsCount, SoftPaletteSettings{nil, 50, false}) -} - -func in(haystack []lab_t, upto int, needle lab_t) bool { - for i := 0; i < upto && i < len(haystack); i++ { - if haystack[i] == needle { - return true - } - } - return false -} - -const LAB_DELTA = 1e-6 - -func lab_eq(lab1, lab2 lab_t) bool { - return math.Abs(lab1.L-lab2.L) < LAB_DELTA && - math.Abs(lab1.A-lab2.A) < LAB_DELTA && - math.Abs(lab1.B-lab2.B) < LAB_DELTA -} - -// That's faster than using colorful's DistanceLab since we would have to -// convert back and forth for that. Here is no conversion. -func lab_dist(lab1, lab2 lab_t) float64 { - return math.Sqrt(sq(lab1.L-lab2.L) + sq(lab1.A-lab2.A) + sq(lab1.B-lab2.B)) -} - -func labs2cols(labs []lab_t) (cols []Color) { - cols = make([]Color, len(labs)) - for k, v := range labs { - cols[k] = Lab(v.L, v.A, v.B) - } - return cols -} diff --git a/vendor/github.com/lucasb-eyer/go-colorful/warm_palettegen.go b/vendor/github.com/lucasb-eyer/go-colorful/warm_palettegen.go deleted file mode 100644 index 00f42a5c..00000000 --- a/vendor/github.com/lucasb-eyer/go-colorful/warm_palettegen.go +++ /dev/null @@ -1,25 +0,0 @@ -package colorful - -import ( - "math/rand" -) - -// Uses the HSV color space to generate colors with similar S,V but distributed -// evenly along their Hue. This is fast but not always pretty. -// If you've got time to spare, use Lab (the non-fast below). -func FastWarmPalette(colorsCount int) (colors []Color) { - colors = make([]Color, colorsCount) - - for i := 0; i < colorsCount; i++ { - colors[i] = Hsv(float64(i)*(360.0/float64(colorsCount)), 0.55+rand.Float64()*0.2, 0.35+rand.Float64()*0.2) - } - return -} - -func WarmPalette(colorsCount int) ([]Color, error) { - warmy := func(l, a, b float64) bool { - _, c, _ := LabToHcl(l, a, b) - return 0.1 <= c && c <= 0.4 && 0.2 <= l && l <= 0.5 - } - return SoftPaletteEx(colorsCount, SoftPaletteSettings{warmy, 50, true}) -} diff --git a/vendor/github.com/mattn/go-runewidth/.travis.yml b/vendor/github.com/mattn/go-runewidth/.travis.yml deleted file mode 100644 index 6a21813a..00000000 --- a/vendor/github.com/mattn/go-runewidth/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -language: go -sudo: false -go: - - 1.13.x - - tip - -before_install: - - go get -t -v ./... - -script: - - go generate - - git diff --cached --exit-code - - ./go.test.sh - -after_success: - - bash <(curl -s https://codecov.io/bash) diff --git a/vendor/github.com/mattn/go-runewidth/LICENSE b/vendor/github.com/mattn/go-runewidth/LICENSE deleted file mode 100644 index 91b5cef3..00000000 --- a/vendor/github.com/mattn/go-runewidth/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016 Yasuhiro Matsumoto - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/mattn/go-runewidth/README.md b/vendor/github.com/mattn/go-runewidth/README.md deleted file mode 100644 index aa56ab96..00000000 --- a/vendor/github.com/mattn/go-runewidth/README.md +++ /dev/null @@ -1,27 +0,0 @@ -go-runewidth -============ - -[![Build Status](https://travis-ci.org/mattn/go-runewidth.png?branch=master)](https://travis-ci.org/mattn/go-runewidth) -[![Codecov](https://codecov.io/gh/mattn/go-runewidth/branch/master/graph/badge.svg)](https://codecov.io/gh/mattn/go-runewidth) -[![GoDoc](https://godoc.org/github.com/mattn/go-runewidth?status.svg)](http://godoc.org/github.com/mattn/go-runewidth) -[![Go Report Card](https://goreportcard.com/badge/github.com/mattn/go-runewidth)](https://goreportcard.com/report/github.com/mattn/go-runewidth) - -Provides functions to get fixed width of the character or string. - -Usage ------ - -```go -runewidth.StringWidth("つのだ☆HIRO") == 12 -``` - - -Author ------- - -Yasuhiro Matsumoto - -License -------- - -under the MIT License: http://mattn.mit-license.org/2013 diff --git a/vendor/github.com/mattn/go-runewidth/go.test.sh b/vendor/github.com/mattn/go-runewidth/go.test.sh deleted file mode 100644 index 012162b0..00000000 --- a/vendor/github.com/mattn/go-runewidth/go.test.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash - -set -e -echo "" > coverage.txt - -for d in $(go list ./... | grep -v vendor); do - go test -race -coverprofile=profile.out -covermode=atomic "$d" - if [ -f profile.out ]; then - cat profile.out >> coverage.txt - rm profile.out - fi -done diff --git a/vendor/github.com/mattn/go-runewidth/runewidth.go b/vendor/github.com/mattn/go-runewidth/runewidth.go deleted file mode 100644 index 19f8e044..00000000 --- a/vendor/github.com/mattn/go-runewidth/runewidth.go +++ /dev/null @@ -1,257 +0,0 @@ -package runewidth - -import ( - "os" -) - -//go:generate go run script/generate.go - -var ( - // EastAsianWidth will be set true if the current locale is CJK - EastAsianWidth bool - - // ZeroWidthJoiner is flag to set to use UTR#51 ZWJ - ZeroWidthJoiner bool - - // DefaultCondition is a condition in current locale - DefaultCondition = &Condition{} -) - -func init() { - handleEnv() -} - -func handleEnv() { - env := os.Getenv("RUNEWIDTH_EASTASIAN") - if env == "" { - EastAsianWidth = IsEastAsian() - } else { - EastAsianWidth = env == "1" - } - // update DefaultCondition - DefaultCondition.EastAsianWidth = EastAsianWidth - DefaultCondition.ZeroWidthJoiner = ZeroWidthJoiner -} - -type interval struct { - first rune - last rune -} - -type table []interval - -func inTables(r rune, ts ...table) bool { - for _, t := range ts { - if inTable(r, t) { - return true - } - } - return false -} - -func inTable(r rune, t table) bool { - if r < t[0].first { - return false - } - - bot := 0 - top := len(t) - 1 - for top >= bot { - mid := (bot + top) >> 1 - - switch { - case t[mid].last < r: - bot = mid + 1 - case t[mid].first > r: - top = mid - 1 - default: - return true - } - } - - return false -} - -var private = table{ - {0x00E000, 0x00F8FF}, {0x0F0000, 0x0FFFFD}, {0x100000, 0x10FFFD}, -} - -var nonprint = table{ - {0x0000, 0x001F}, {0x007F, 0x009F}, {0x00AD, 0x00AD}, - {0x070F, 0x070F}, {0x180B, 0x180E}, {0x200B, 0x200F}, - {0x2028, 0x202E}, {0x206A, 0x206F}, {0xD800, 0xDFFF}, - {0xFEFF, 0xFEFF}, {0xFFF9, 0xFFFB}, {0xFFFE, 0xFFFF}, -} - -// Condition have flag EastAsianWidth whether the current locale is CJK or not. -type Condition struct { - EastAsianWidth bool - ZeroWidthJoiner bool -} - -// NewCondition return new instance of Condition which is current locale. -func NewCondition() *Condition { - return &Condition{ - EastAsianWidth: EastAsianWidth, - ZeroWidthJoiner: ZeroWidthJoiner, - } -} - -// RuneWidth returns the number of cells in r. -// See http://www.unicode.org/reports/tr11/ -func (c *Condition) RuneWidth(r rune) int { - switch { - case r < 0 || r > 0x10FFFF || inTables(r, nonprint, combining, notassigned): - return 0 - case (c.EastAsianWidth && IsAmbiguousWidth(r)) || inTables(r, doublewidth): - return 2 - default: - return 1 - } -} - -func (c *Condition) stringWidth(s string) (width int) { - for _, r := range []rune(s) { - width += c.RuneWidth(r) - } - return width -} - -func (c *Condition) stringWidthZeroJoiner(s string) (width int) { - r1, r2 := rune(0), rune(0) - for _, r := range []rune(s) { - if r == 0xFE0E || r == 0xFE0F { - continue - } - w := c.RuneWidth(r) - if r2 == 0x200D && inTables(r, emoji) && inTables(r1, emoji) { - if width < w { - width = w - } - } else { - width += w - } - r1, r2 = r2, r - } - return width -} - -// StringWidth return width as you can see -func (c *Condition) StringWidth(s string) (width int) { - if c.ZeroWidthJoiner { - return c.stringWidthZeroJoiner(s) - } - return c.stringWidth(s) -} - -// Truncate return string truncated with w cells -func (c *Condition) Truncate(s string, w int, tail string) string { - if c.StringWidth(s) <= w { - return s - } - r := []rune(s) - tw := c.StringWidth(tail) - w -= tw - width := 0 - i := 0 - for ; i < len(r); i++ { - cw := c.RuneWidth(r[i]) - if width+cw > w { - break - } - width += cw - } - return string(r[0:i]) + tail -} - -// Wrap return string wrapped with w cells -func (c *Condition) Wrap(s string, w int) string { - width := 0 - out := "" - for _, r := range []rune(s) { - cw := RuneWidth(r) - if r == '\n' { - out += string(r) - width = 0 - continue - } else if width+cw > w { - out += "\n" - width = 0 - out += string(r) - width += cw - continue - } - out += string(r) - width += cw - } - return out -} - -// FillLeft return string filled in left by spaces in w cells -func (c *Condition) FillLeft(s string, w int) string { - width := c.StringWidth(s) - count := w - width - if count > 0 { - b := make([]byte, count) - for i := range b { - b[i] = ' ' - } - return string(b) + s - } - return s -} - -// FillRight return string filled in left by spaces in w cells -func (c *Condition) FillRight(s string, w int) string { - width := c.StringWidth(s) - count := w - width - if count > 0 { - b := make([]byte, count) - for i := range b { - b[i] = ' ' - } - return s + string(b) - } - return s -} - -// RuneWidth returns the number of cells in r. -// See http://www.unicode.org/reports/tr11/ -func RuneWidth(r rune) int { - return DefaultCondition.RuneWidth(r) -} - -// IsAmbiguousWidth returns whether is ambiguous width or not. -func IsAmbiguousWidth(r rune) bool { - return inTables(r, private, ambiguous) -} - -// IsNeutralWidth returns whether is neutral width or not. -func IsNeutralWidth(r rune) bool { - return inTable(r, neutral) -} - -// StringWidth return width as you can see -func StringWidth(s string) (width int) { - return DefaultCondition.StringWidth(s) -} - -// Truncate return string truncated with w cells -func Truncate(s string, w int, tail string) string { - return DefaultCondition.Truncate(s, w, tail) -} - -// Wrap return string wrapped with w cells -func Wrap(s string, w int) string { - return DefaultCondition.Wrap(s, w) -} - -// FillLeft return string filled in left by spaces in w cells -func FillLeft(s string, w int) string { - return DefaultCondition.FillLeft(s, w) -} - -// FillRight return string filled in left by spaces in w cells -func FillRight(s string, w int) string { - return DefaultCondition.FillRight(s, w) -} diff --git a/vendor/github.com/mattn/go-runewidth/runewidth_appengine.go b/vendor/github.com/mattn/go-runewidth/runewidth_appengine.go deleted file mode 100644 index 7d99f6e5..00000000 --- a/vendor/github.com/mattn/go-runewidth/runewidth_appengine.go +++ /dev/null @@ -1,8 +0,0 @@ -// +build appengine - -package runewidth - -// IsEastAsian return true if the current locale is CJK -func IsEastAsian() bool { - return false -} diff --git a/vendor/github.com/mattn/go-runewidth/runewidth_js.go b/vendor/github.com/mattn/go-runewidth/runewidth_js.go deleted file mode 100644 index c5fdf40b..00000000 --- a/vendor/github.com/mattn/go-runewidth/runewidth_js.go +++ /dev/null @@ -1,9 +0,0 @@ -// +build js -// +build !appengine - -package runewidth - -func IsEastAsian() bool { - // TODO: Implement this for the web. Detect east asian in a compatible way, and return true. - return false -} diff --git a/vendor/github.com/mattn/go-runewidth/runewidth_posix.go b/vendor/github.com/mattn/go-runewidth/runewidth_posix.go deleted file mode 100644 index 66a58b5d..00000000 --- a/vendor/github.com/mattn/go-runewidth/runewidth_posix.go +++ /dev/null @@ -1,79 +0,0 @@ -// +build !windows -// +build !js -// +build !appengine - -package runewidth - -import ( - "os" - "regexp" - "strings" -) - -var reLoc = regexp.MustCompile(`^[a-z][a-z][a-z]?(?:_[A-Z][A-Z])?\.(.+)`) - -var mblenTable = map[string]int{ - "utf-8": 6, - "utf8": 6, - "jis": 8, - "eucjp": 3, - "euckr": 2, - "euccn": 2, - "sjis": 2, - "cp932": 2, - "cp51932": 2, - "cp936": 2, - "cp949": 2, - "cp950": 2, - "big5": 2, - "gbk": 2, - "gb2312": 2, -} - -func isEastAsian(locale string) bool { - charset := strings.ToLower(locale) - r := reLoc.FindStringSubmatch(locale) - if len(r) == 2 { - charset = strings.ToLower(r[1]) - } - - if strings.HasSuffix(charset, "@cjk_narrow") { - return false - } - - for pos, b := range []byte(charset) { - if b == '@' { - charset = charset[:pos] - break - } - } - max := 1 - if m, ok := mblenTable[charset]; ok { - max = m - } - if max > 1 && (charset[0] != 'u' || - strings.HasPrefix(locale, "ja") || - strings.HasPrefix(locale, "ko") || - strings.HasPrefix(locale, "zh")) { - return true - } - return false -} - -// IsEastAsian return true if the current locale is CJK -func IsEastAsian() bool { - locale := os.Getenv("LC_CTYPE") - if locale == "" { - locale = os.Getenv("LANG") - } - - // ignore C locale - if locale == "POSIX" || locale == "C" { - return false - } - if len(locale) > 1 && locale[0] == 'C' && (locale[1] == '.' || locale[1] == '-') { - return false - } - - return isEastAsian(locale) -} diff --git a/vendor/github.com/mattn/go-runewidth/runewidth_table.go b/vendor/github.com/mattn/go-runewidth/runewidth_table.go deleted file mode 100644 index a8ccee5b..00000000 --- a/vendor/github.com/mattn/go-runewidth/runewidth_table.go +++ /dev/null @@ -1,429 +0,0 @@ -// Code generated by script/generate.go. DO NOT EDIT. - -package runewidth - -var combining = table{ - {0x0300, 0x036F}, {0x0483, 0x0489}, {0x07EB, 0x07F3}, - {0x0C00, 0x0C00}, {0x0C04, 0x0C04}, {0x0D00, 0x0D01}, - {0x135D, 0x135F}, {0x1A7F, 0x1A7F}, {0x1AB0, 0x1ABE}, - {0x1B6B, 0x1B73}, {0x1DC0, 0x1DF9}, {0x1DFB, 0x1DFF}, - {0x20D0, 0x20F0}, {0x2CEF, 0x2CF1}, {0x2DE0, 0x2DFF}, - {0x3099, 0x309A}, {0xA66F, 0xA672}, {0xA674, 0xA67D}, - {0xA69E, 0xA69F}, {0xA6F0, 0xA6F1}, {0xA8E0, 0xA8F1}, - {0xFE20, 0xFE2F}, {0x101FD, 0x101FD}, {0x10376, 0x1037A}, - {0x10F46, 0x10F50}, {0x11300, 0x11301}, {0x1133B, 0x1133C}, - {0x11366, 0x1136C}, {0x11370, 0x11374}, {0x16AF0, 0x16AF4}, - {0x1D165, 0x1D169}, {0x1D16D, 0x1D172}, {0x1D17B, 0x1D182}, - {0x1D185, 0x1D18B}, {0x1D1AA, 0x1D1AD}, {0x1D242, 0x1D244}, - {0x1E000, 0x1E006}, {0x1E008, 0x1E018}, {0x1E01B, 0x1E021}, - {0x1E023, 0x1E024}, {0x1E026, 0x1E02A}, {0x1E8D0, 0x1E8D6}, -} - -var doublewidth = table{ - {0x1100, 0x115F}, {0x231A, 0x231B}, {0x2329, 0x232A}, - {0x23E9, 0x23EC}, {0x23F0, 0x23F0}, {0x23F3, 0x23F3}, - {0x25FD, 0x25FE}, {0x2614, 0x2615}, {0x2648, 0x2653}, - {0x267F, 0x267F}, {0x2693, 0x2693}, {0x26A1, 0x26A1}, - {0x26AA, 0x26AB}, {0x26BD, 0x26BE}, {0x26C4, 0x26C5}, - {0x26CE, 0x26CE}, {0x26D4, 0x26D4}, {0x26EA, 0x26EA}, - {0x26F2, 0x26F3}, {0x26F5, 0x26F5}, {0x26FA, 0x26FA}, - {0x26FD, 0x26FD}, {0x2705, 0x2705}, {0x270A, 0x270B}, - {0x2728, 0x2728}, {0x274C, 0x274C}, {0x274E, 0x274E}, - {0x2753, 0x2755}, {0x2757, 0x2757}, {0x2795, 0x2797}, - {0x27B0, 0x27B0}, {0x27BF, 0x27BF}, {0x2B1B, 0x2B1C}, - {0x2B50, 0x2B50}, {0x2B55, 0x2B55}, {0x2E80, 0x2E99}, - {0x2E9B, 0x2EF3}, {0x2F00, 0x2FD5}, {0x2FF0, 0x2FFB}, - {0x3000, 0x303E}, {0x3041, 0x3096}, {0x3099, 0x30FF}, - {0x3105, 0x312F}, {0x3131, 0x318E}, {0x3190, 0x31BA}, - {0x31C0, 0x31E3}, {0x31F0, 0x321E}, {0x3220, 0x3247}, - {0x3250, 0x4DBF}, {0x4E00, 0xA48C}, {0xA490, 0xA4C6}, - {0xA960, 0xA97C}, {0xAC00, 0xD7A3}, {0xF900, 0xFAFF}, - {0xFE10, 0xFE19}, {0xFE30, 0xFE52}, {0xFE54, 0xFE66}, - {0xFE68, 0xFE6B}, {0xFF01, 0xFF60}, {0xFFE0, 0xFFE6}, - {0x16FE0, 0x16FE3}, {0x17000, 0x187F7}, {0x18800, 0x18AF2}, - {0x1B000, 0x1B11E}, {0x1B150, 0x1B152}, {0x1B164, 0x1B167}, - {0x1B170, 0x1B2FB}, {0x1F004, 0x1F004}, {0x1F0CF, 0x1F0CF}, - {0x1F18E, 0x1F18E}, {0x1F191, 0x1F19A}, {0x1F200, 0x1F202}, - {0x1F210, 0x1F23B}, {0x1F240, 0x1F248}, {0x1F250, 0x1F251}, - {0x1F260, 0x1F265}, {0x1F300, 0x1F320}, {0x1F32D, 0x1F335}, - {0x1F337, 0x1F37C}, {0x1F37E, 0x1F393}, {0x1F3A0, 0x1F3CA}, - {0x1F3CF, 0x1F3D3}, {0x1F3E0, 0x1F3F0}, {0x1F3F4, 0x1F3F4}, - {0x1F3F8, 0x1F43E}, {0x1F440, 0x1F440}, {0x1F442, 0x1F4FC}, - {0x1F4FF, 0x1F53D}, {0x1F54B, 0x1F54E}, {0x1F550, 0x1F567}, - {0x1F57A, 0x1F57A}, {0x1F595, 0x1F596}, {0x1F5A4, 0x1F5A4}, - {0x1F5FB, 0x1F64F}, {0x1F680, 0x1F6C5}, {0x1F6CC, 0x1F6CC}, - {0x1F6D0, 0x1F6D2}, {0x1F6D5, 0x1F6D5}, {0x1F6EB, 0x1F6EC}, - {0x1F6F4, 0x1F6FA}, {0x1F7E0, 0x1F7EB}, {0x1F90D, 0x1F971}, - {0x1F973, 0x1F976}, {0x1F97A, 0x1F9A2}, {0x1F9A5, 0x1F9AA}, - {0x1F9AE, 0x1F9CA}, {0x1F9CD, 0x1F9FF}, {0x1FA70, 0x1FA73}, - {0x1FA78, 0x1FA7A}, {0x1FA80, 0x1FA82}, {0x1FA90, 0x1FA95}, - {0x20000, 0x2FFFD}, {0x30000, 0x3FFFD}, -} - -var ambiguous = table{ - {0x00A1, 0x00A1}, {0x00A4, 0x00A4}, {0x00A7, 0x00A8}, - {0x00AA, 0x00AA}, {0x00AD, 0x00AE}, {0x00B0, 0x00B4}, - {0x00B6, 0x00BA}, {0x00BC, 0x00BF}, {0x00C6, 0x00C6}, - {0x00D0, 0x00D0}, {0x00D7, 0x00D8}, {0x00DE, 0x00E1}, - {0x00E6, 0x00E6}, {0x00E8, 0x00EA}, {0x00EC, 0x00ED}, - {0x00F0, 0x00F0}, {0x00F2, 0x00F3}, {0x00F7, 0x00FA}, - {0x00FC, 0x00FC}, {0x00FE, 0x00FE}, {0x0101, 0x0101}, - {0x0111, 0x0111}, {0x0113, 0x0113}, {0x011B, 0x011B}, - {0x0126, 0x0127}, {0x012B, 0x012B}, {0x0131, 0x0133}, - {0x0138, 0x0138}, {0x013F, 0x0142}, {0x0144, 0x0144}, - {0x0148, 0x014B}, {0x014D, 0x014D}, {0x0152, 0x0153}, - {0x0166, 0x0167}, {0x016B, 0x016B}, {0x01CE, 0x01CE}, - {0x01D0, 0x01D0}, {0x01D2, 0x01D2}, {0x01D4, 0x01D4}, - {0x01D6, 0x01D6}, {0x01D8, 0x01D8}, {0x01DA, 0x01DA}, - {0x01DC, 0x01DC}, {0x0251, 0x0251}, {0x0261, 0x0261}, - {0x02C4, 0x02C4}, {0x02C7, 0x02C7}, {0x02C9, 0x02CB}, - {0x02CD, 0x02CD}, {0x02D0, 0x02D0}, {0x02D8, 0x02DB}, - {0x02DD, 0x02DD}, {0x02DF, 0x02DF}, {0x0300, 0x036F}, - {0x0391, 0x03A1}, {0x03A3, 0x03A9}, {0x03B1, 0x03C1}, - {0x03C3, 0x03C9}, {0x0401, 0x0401}, {0x0410, 0x044F}, - {0x0451, 0x0451}, {0x2010, 0x2010}, {0x2013, 0x2016}, - {0x2018, 0x2019}, {0x201C, 0x201D}, {0x2020, 0x2022}, - {0x2024, 0x2027}, {0x2030, 0x2030}, {0x2032, 0x2033}, - {0x2035, 0x2035}, {0x203B, 0x203B}, {0x203E, 0x203E}, - {0x2074, 0x2074}, {0x207F, 0x207F}, {0x2081, 0x2084}, - {0x20AC, 0x20AC}, {0x2103, 0x2103}, {0x2105, 0x2105}, - {0x2109, 0x2109}, {0x2113, 0x2113}, {0x2116, 0x2116}, - {0x2121, 0x2122}, {0x2126, 0x2126}, {0x212B, 0x212B}, - {0x2153, 0x2154}, {0x215B, 0x215E}, {0x2160, 0x216B}, - {0x2170, 0x2179}, {0x2189, 0x2189}, {0x2190, 0x2199}, - {0x21B8, 0x21B9}, {0x21D2, 0x21D2}, {0x21D4, 0x21D4}, - {0x21E7, 0x21E7}, {0x2200, 0x2200}, {0x2202, 0x2203}, - {0x2207, 0x2208}, {0x220B, 0x220B}, {0x220F, 0x220F}, - {0x2211, 0x2211}, {0x2215, 0x2215}, {0x221A, 0x221A}, - {0x221D, 0x2220}, {0x2223, 0x2223}, {0x2225, 0x2225}, - {0x2227, 0x222C}, {0x222E, 0x222E}, {0x2234, 0x2237}, - {0x223C, 0x223D}, {0x2248, 0x2248}, {0x224C, 0x224C}, - {0x2252, 0x2252}, {0x2260, 0x2261}, {0x2264, 0x2267}, - {0x226A, 0x226B}, {0x226E, 0x226F}, {0x2282, 0x2283}, - {0x2286, 0x2287}, {0x2295, 0x2295}, {0x2299, 0x2299}, - {0x22A5, 0x22A5}, {0x22BF, 0x22BF}, {0x2312, 0x2312}, - {0x2460, 0x24E9}, {0x24EB, 0x254B}, {0x2550, 0x2573}, - {0x2580, 0x258F}, {0x2592, 0x2595}, {0x25A0, 0x25A1}, - {0x25A3, 0x25A9}, {0x25B2, 0x25B3}, {0x25B6, 0x25B7}, - {0x25BC, 0x25BD}, {0x25C0, 0x25C1}, {0x25C6, 0x25C8}, - {0x25CB, 0x25CB}, {0x25CE, 0x25D1}, {0x25E2, 0x25E5}, - {0x25EF, 0x25EF}, {0x2605, 0x2606}, {0x2609, 0x2609}, - {0x260E, 0x260F}, {0x261C, 0x261C}, {0x261E, 0x261E}, - {0x2640, 0x2640}, {0x2642, 0x2642}, {0x2660, 0x2661}, - {0x2663, 0x2665}, {0x2667, 0x266A}, {0x266C, 0x266D}, - {0x266F, 0x266F}, {0x269E, 0x269F}, {0x26BF, 0x26BF}, - {0x26C6, 0x26CD}, {0x26CF, 0x26D3}, {0x26D5, 0x26E1}, - {0x26E3, 0x26E3}, {0x26E8, 0x26E9}, {0x26EB, 0x26F1}, - {0x26F4, 0x26F4}, {0x26F6, 0x26F9}, {0x26FB, 0x26FC}, - {0x26FE, 0x26FF}, {0x273D, 0x273D}, {0x2776, 0x277F}, - {0x2B56, 0x2B59}, {0x3248, 0x324F}, {0xE000, 0xF8FF}, - {0xFE00, 0xFE0F}, {0xFFFD, 0xFFFD}, {0x1F100, 0x1F10A}, - {0x1F110, 0x1F12D}, {0x1F130, 0x1F169}, {0x1F170, 0x1F18D}, - {0x1F18F, 0x1F190}, {0x1F19B, 0x1F1AC}, {0xE0100, 0xE01EF}, - {0xF0000, 0xFFFFD}, {0x100000, 0x10FFFD}, -} -var notassigned = table{ - {0x27E6, 0x27ED}, {0x2985, 0x2986}, -} - -var neutral = table{ - {0x0000, 0x001F}, {0x007F, 0x00A0}, {0x00A9, 0x00A9}, - {0x00AB, 0x00AB}, {0x00B5, 0x00B5}, {0x00BB, 0x00BB}, - {0x00C0, 0x00C5}, {0x00C7, 0x00CF}, {0x00D1, 0x00D6}, - {0x00D9, 0x00DD}, {0x00E2, 0x00E5}, {0x00E7, 0x00E7}, - {0x00EB, 0x00EB}, {0x00EE, 0x00EF}, {0x00F1, 0x00F1}, - {0x00F4, 0x00F6}, {0x00FB, 0x00FB}, {0x00FD, 0x00FD}, - {0x00FF, 0x0100}, {0x0102, 0x0110}, {0x0112, 0x0112}, - {0x0114, 0x011A}, {0x011C, 0x0125}, {0x0128, 0x012A}, - {0x012C, 0x0130}, {0x0134, 0x0137}, {0x0139, 0x013E}, - {0x0143, 0x0143}, {0x0145, 0x0147}, {0x014C, 0x014C}, - {0x014E, 0x0151}, {0x0154, 0x0165}, {0x0168, 0x016A}, - {0x016C, 0x01CD}, {0x01CF, 0x01CF}, {0x01D1, 0x01D1}, - {0x01D3, 0x01D3}, {0x01D5, 0x01D5}, {0x01D7, 0x01D7}, - {0x01D9, 0x01D9}, {0x01DB, 0x01DB}, {0x01DD, 0x0250}, - {0x0252, 0x0260}, {0x0262, 0x02C3}, {0x02C5, 0x02C6}, - {0x02C8, 0x02C8}, {0x02CC, 0x02CC}, {0x02CE, 0x02CF}, - {0x02D1, 0x02D7}, {0x02DC, 0x02DC}, {0x02DE, 0x02DE}, - {0x02E0, 0x02FF}, {0x0370, 0x0377}, {0x037A, 0x037F}, - {0x0384, 0x038A}, {0x038C, 0x038C}, {0x038E, 0x0390}, - {0x03AA, 0x03B0}, {0x03C2, 0x03C2}, {0x03CA, 0x0400}, - {0x0402, 0x040F}, {0x0450, 0x0450}, {0x0452, 0x052F}, - {0x0531, 0x0556}, {0x0559, 0x058A}, {0x058D, 0x058F}, - {0x0591, 0x05C7}, {0x05D0, 0x05EA}, {0x05EF, 0x05F4}, - {0x0600, 0x061C}, {0x061E, 0x070D}, {0x070F, 0x074A}, - {0x074D, 0x07B1}, {0x07C0, 0x07FA}, {0x07FD, 0x082D}, - {0x0830, 0x083E}, {0x0840, 0x085B}, {0x085E, 0x085E}, - {0x0860, 0x086A}, {0x08A0, 0x08B4}, {0x08B6, 0x08BD}, - {0x08D3, 0x0983}, {0x0985, 0x098C}, {0x098F, 0x0990}, - {0x0993, 0x09A8}, {0x09AA, 0x09B0}, {0x09B2, 0x09B2}, - {0x09B6, 0x09B9}, {0x09BC, 0x09C4}, {0x09C7, 0x09C8}, - {0x09CB, 0x09CE}, {0x09D7, 0x09D7}, {0x09DC, 0x09DD}, - {0x09DF, 0x09E3}, {0x09E6, 0x09FE}, {0x0A01, 0x0A03}, - {0x0A05, 0x0A0A}, {0x0A0F, 0x0A10}, {0x0A13, 0x0A28}, - {0x0A2A, 0x0A30}, {0x0A32, 0x0A33}, {0x0A35, 0x0A36}, - {0x0A38, 0x0A39}, {0x0A3C, 0x0A3C}, {0x0A3E, 0x0A42}, - {0x0A47, 0x0A48}, {0x0A4B, 0x0A4D}, {0x0A51, 0x0A51}, - {0x0A59, 0x0A5C}, {0x0A5E, 0x0A5E}, {0x0A66, 0x0A76}, - {0x0A81, 0x0A83}, {0x0A85, 0x0A8D}, {0x0A8F, 0x0A91}, - {0x0A93, 0x0AA8}, {0x0AAA, 0x0AB0}, {0x0AB2, 0x0AB3}, - {0x0AB5, 0x0AB9}, {0x0ABC, 0x0AC5}, {0x0AC7, 0x0AC9}, - {0x0ACB, 0x0ACD}, {0x0AD0, 0x0AD0}, {0x0AE0, 0x0AE3}, - {0x0AE6, 0x0AF1}, {0x0AF9, 0x0AFF}, {0x0B01, 0x0B03}, - {0x0B05, 0x0B0C}, {0x0B0F, 0x0B10}, {0x0B13, 0x0B28}, - {0x0B2A, 0x0B30}, {0x0B32, 0x0B33}, {0x0B35, 0x0B39}, - {0x0B3C, 0x0B44}, {0x0B47, 0x0B48}, {0x0B4B, 0x0B4D}, - {0x0B56, 0x0B57}, {0x0B5C, 0x0B5D}, {0x0B5F, 0x0B63}, - {0x0B66, 0x0B77}, {0x0B82, 0x0B83}, {0x0B85, 0x0B8A}, - {0x0B8E, 0x0B90}, {0x0B92, 0x0B95}, {0x0B99, 0x0B9A}, - {0x0B9C, 0x0B9C}, {0x0B9E, 0x0B9F}, {0x0BA3, 0x0BA4}, - {0x0BA8, 0x0BAA}, {0x0BAE, 0x0BB9}, {0x0BBE, 0x0BC2}, - {0x0BC6, 0x0BC8}, {0x0BCA, 0x0BCD}, {0x0BD0, 0x0BD0}, - {0x0BD7, 0x0BD7}, {0x0BE6, 0x0BFA}, {0x0C00, 0x0C0C}, - {0x0C0E, 0x0C10}, {0x0C12, 0x0C28}, {0x0C2A, 0x0C39}, - {0x0C3D, 0x0C44}, {0x0C46, 0x0C48}, {0x0C4A, 0x0C4D}, - {0x0C55, 0x0C56}, {0x0C58, 0x0C5A}, {0x0C60, 0x0C63}, - {0x0C66, 0x0C6F}, {0x0C77, 0x0C8C}, {0x0C8E, 0x0C90}, - {0x0C92, 0x0CA8}, {0x0CAA, 0x0CB3}, {0x0CB5, 0x0CB9}, - {0x0CBC, 0x0CC4}, {0x0CC6, 0x0CC8}, {0x0CCA, 0x0CCD}, - {0x0CD5, 0x0CD6}, {0x0CDE, 0x0CDE}, {0x0CE0, 0x0CE3}, - {0x0CE6, 0x0CEF}, {0x0CF1, 0x0CF2}, {0x0D00, 0x0D03}, - {0x0D05, 0x0D0C}, {0x0D0E, 0x0D10}, {0x0D12, 0x0D44}, - {0x0D46, 0x0D48}, {0x0D4A, 0x0D4F}, {0x0D54, 0x0D63}, - {0x0D66, 0x0D7F}, {0x0D82, 0x0D83}, {0x0D85, 0x0D96}, - {0x0D9A, 0x0DB1}, {0x0DB3, 0x0DBB}, {0x0DBD, 0x0DBD}, - {0x0DC0, 0x0DC6}, {0x0DCA, 0x0DCA}, {0x0DCF, 0x0DD4}, - {0x0DD6, 0x0DD6}, {0x0DD8, 0x0DDF}, {0x0DE6, 0x0DEF}, - {0x0DF2, 0x0DF4}, {0x0E01, 0x0E3A}, {0x0E3F, 0x0E5B}, - {0x0E81, 0x0E82}, {0x0E84, 0x0E84}, {0x0E86, 0x0E8A}, - {0x0E8C, 0x0EA3}, {0x0EA5, 0x0EA5}, {0x0EA7, 0x0EBD}, - {0x0EC0, 0x0EC4}, {0x0EC6, 0x0EC6}, {0x0EC8, 0x0ECD}, - {0x0ED0, 0x0ED9}, {0x0EDC, 0x0EDF}, {0x0F00, 0x0F47}, - {0x0F49, 0x0F6C}, {0x0F71, 0x0F97}, {0x0F99, 0x0FBC}, - {0x0FBE, 0x0FCC}, {0x0FCE, 0x0FDA}, {0x1000, 0x10C5}, - {0x10C7, 0x10C7}, {0x10CD, 0x10CD}, {0x10D0, 0x10FF}, - {0x1160, 0x1248}, {0x124A, 0x124D}, {0x1250, 0x1256}, - {0x1258, 0x1258}, {0x125A, 0x125D}, {0x1260, 0x1288}, - {0x128A, 0x128D}, {0x1290, 0x12B0}, {0x12B2, 0x12B5}, - {0x12B8, 0x12BE}, {0x12C0, 0x12C0}, {0x12C2, 0x12C5}, - {0x12C8, 0x12D6}, {0x12D8, 0x1310}, {0x1312, 0x1315}, - {0x1318, 0x135A}, {0x135D, 0x137C}, {0x1380, 0x1399}, - {0x13A0, 0x13F5}, {0x13F8, 0x13FD}, {0x1400, 0x169C}, - {0x16A0, 0x16F8}, {0x1700, 0x170C}, {0x170E, 0x1714}, - {0x1720, 0x1736}, {0x1740, 0x1753}, {0x1760, 0x176C}, - {0x176E, 0x1770}, {0x1772, 0x1773}, {0x1780, 0x17DD}, - {0x17E0, 0x17E9}, {0x17F0, 0x17F9}, {0x1800, 0x180E}, - {0x1810, 0x1819}, {0x1820, 0x1878}, {0x1880, 0x18AA}, - {0x18B0, 0x18F5}, {0x1900, 0x191E}, {0x1920, 0x192B}, - {0x1930, 0x193B}, {0x1940, 0x1940}, {0x1944, 0x196D}, - {0x1970, 0x1974}, {0x1980, 0x19AB}, {0x19B0, 0x19C9}, - {0x19D0, 0x19DA}, {0x19DE, 0x1A1B}, {0x1A1E, 0x1A5E}, - {0x1A60, 0x1A7C}, {0x1A7F, 0x1A89}, {0x1A90, 0x1A99}, - {0x1AA0, 0x1AAD}, {0x1AB0, 0x1ABE}, {0x1B00, 0x1B4B}, - {0x1B50, 0x1B7C}, {0x1B80, 0x1BF3}, {0x1BFC, 0x1C37}, - {0x1C3B, 0x1C49}, {0x1C4D, 0x1C88}, {0x1C90, 0x1CBA}, - {0x1CBD, 0x1CC7}, {0x1CD0, 0x1CFA}, {0x1D00, 0x1DF9}, - {0x1DFB, 0x1F15}, {0x1F18, 0x1F1D}, {0x1F20, 0x1F45}, - {0x1F48, 0x1F4D}, {0x1F50, 0x1F57}, {0x1F59, 0x1F59}, - {0x1F5B, 0x1F5B}, {0x1F5D, 0x1F5D}, {0x1F5F, 0x1F7D}, - {0x1F80, 0x1FB4}, {0x1FB6, 0x1FC4}, {0x1FC6, 0x1FD3}, - {0x1FD6, 0x1FDB}, {0x1FDD, 0x1FEF}, {0x1FF2, 0x1FF4}, - {0x1FF6, 0x1FFE}, {0x2000, 0x200F}, {0x2011, 0x2012}, - {0x2017, 0x2017}, {0x201A, 0x201B}, {0x201E, 0x201F}, - {0x2023, 0x2023}, {0x2028, 0x202F}, {0x2031, 0x2031}, - {0x2034, 0x2034}, {0x2036, 0x203A}, {0x203C, 0x203D}, - {0x203F, 0x2064}, {0x2066, 0x2071}, {0x2075, 0x207E}, - {0x2080, 0x2080}, {0x2085, 0x208E}, {0x2090, 0x209C}, - {0x20A0, 0x20A8}, {0x20AA, 0x20AB}, {0x20AD, 0x20BF}, - {0x20D0, 0x20F0}, {0x2100, 0x2102}, {0x2104, 0x2104}, - {0x2106, 0x2108}, {0x210A, 0x2112}, {0x2114, 0x2115}, - {0x2117, 0x2120}, {0x2123, 0x2125}, {0x2127, 0x212A}, - {0x212C, 0x2152}, {0x2155, 0x215A}, {0x215F, 0x215F}, - {0x216C, 0x216F}, {0x217A, 0x2188}, {0x218A, 0x218B}, - {0x219A, 0x21B7}, {0x21BA, 0x21D1}, {0x21D3, 0x21D3}, - {0x21D5, 0x21E6}, {0x21E8, 0x21FF}, {0x2201, 0x2201}, - {0x2204, 0x2206}, {0x2209, 0x220A}, {0x220C, 0x220E}, - {0x2210, 0x2210}, {0x2212, 0x2214}, {0x2216, 0x2219}, - {0x221B, 0x221C}, {0x2221, 0x2222}, {0x2224, 0x2224}, - {0x2226, 0x2226}, {0x222D, 0x222D}, {0x222F, 0x2233}, - {0x2238, 0x223B}, {0x223E, 0x2247}, {0x2249, 0x224B}, - {0x224D, 0x2251}, {0x2253, 0x225F}, {0x2262, 0x2263}, - {0x2268, 0x2269}, {0x226C, 0x226D}, {0x2270, 0x2281}, - {0x2284, 0x2285}, {0x2288, 0x2294}, {0x2296, 0x2298}, - {0x229A, 0x22A4}, {0x22A6, 0x22BE}, {0x22C0, 0x2311}, - {0x2313, 0x2319}, {0x231C, 0x2328}, {0x232B, 0x23E8}, - {0x23ED, 0x23EF}, {0x23F1, 0x23F2}, {0x23F4, 0x2426}, - {0x2440, 0x244A}, {0x24EA, 0x24EA}, {0x254C, 0x254F}, - {0x2574, 0x257F}, {0x2590, 0x2591}, {0x2596, 0x259F}, - {0x25A2, 0x25A2}, {0x25AA, 0x25B1}, {0x25B4, 0x25B5}, - {0x25B8, 0x25BB}, {0x25BE, 0x25BF}, {0x25C2, 0x25C5}, - {0x25C9, 0x25CA}, {0x25CC, 0x25CD}, {0x25D2, 0x25E1}, - {0x25E6, 0x25EE}, {0x25F0, 0x25FC}, {0x25FF, 0x2604}, - {0x2607, 0x2608}, {0x260A, 0x260D}, {0x2610, 0x2613}, - {0x2616, 0x261B}, {0x261D, 0x261D}, {0x261F, 0x263F}, - {0x2641, 0x2641}, {0x2643, 0x2647}, {0x2654, 0x265F}, - {0x2662, 0x2662}, {0x2666, 0x2666}, {0x266B, 0x266B}, - {0x266E, 0x266E}, {0x2670, 0x267E}, {0x2680, 0x2692}, - {0x2694, 0x269D}, {0x26A0, 0x26A0}, {0x26A2, 0x26A9}, - {0x26AC, 0x26BC}, {0x26C0, 0x26C3}, {0x26E2, 0x26E2}, - {0x26E4, 0x26E7}, {0x2700, 0x2704}, {0x2706, 0x2709}, - {0x270C, 0x2727}, {0x2729, 0x273C}, {0x273E, 0x274B}, - {0x274D, 0x274D}, {0x274F, 0x2752}, {0x2756, 0x2756}, - {0x2758, 0x2775}, {0x2780, 0x2794}, {0x2798, 0x27AF}, - {0x27B1, 0x27BE}, {0x27C0, 0x27E5}, {0x27EE, 0x2984}, - {0x2987, 0x2B1A}, {0x2B1D, 0x2B4F}, {0x2B51, 0x2B54}, - {0x2B5A, 0x2B73}, {0x2B76, 0x2B95}, {0x2B98, 0x2C2E}, - {0x2C30, 0x2C5E}, {0x2C60, 0x2CF3}, {0x2CF9, 0x2D25}, - {0x2D27, 0x2D27}, {0x2D2D, 0x2D2D}, {0x2D30, 0x2D67}, - {0x2D6F, 0x2D70}, {0x2D7F, 0x2D96}, {0x2DA0, 0x2DA6}, - {0x2DA8, 0x2DAE}, {0x2DB0, 0x2DB6}, {0x2DB8, 0x2DBE}, - {0x2DC0, 0x2DC6}, {0x2DC8, 0x2DCE}, {0x2DD0, 0x2DD6}, - {0x2DD8, 0x2DDE}, {0x2DE0, 0x2E4F}, {0x303F, 0x303F}, - {0x4DC0, 0x4DFF}, {0xA4D0, 0xA62B}, {0xA640, 0xA6F7}, - {0xA700, 0xA7BF}, {0xA7C2, 0xA7C6}, {0xA7F7, 0xA82B}, - {0xA830, 0xA839}, {0xA840, 0xA877}, {0xA880, 0xA8C5}, - {0xA8CE, 0xA8D9}, {0xA8E0, 0xA953}, {0xA95F, 0xA95F}, - {0xA980, 0xA9CD}, {0xA9CF, 0xA9D9}, {0xA9DE, 0xA9FE}, - {0xAA00, 0xAA36}, {0xAA40, 0xAA4D}, {0xAA50, 0xAA59}, - {0xAA5C, 0xAAC2}, {0xAADB, 0xAAF6}, {0xAB01, 0xAB06}, - {0xAB09, 0xAB0E}, {0xAB11, 0xAB16}, {0xAB20, 0xAB26}, - {0xAB28, 0xAB2E}, {0xAB30, 0xAB67}, {0xAB70, 0xABED}, - {0xABF0, 0xABF9}, {0xD7B0, 0xD7C6}, {0xD7CB, 0xD7FB}, - {0xD800, 0xDFFF}, {0xFB00, 0xFB06}, {0xFB13, 0xFB17}, - {0xFB1D, 0xFB36}, {0xFB38, 0xFB3C}, {0xFB3E, 0xFB3E}, - {0xFB40, 0xFB41}, {0xFB43, 0xFB44}, {0xFB46, 0xFBC1}, - {0xFBD3, 0xFD3F}, {0xFD50, 0xFD8F}, {0xFD92, 0xFDC7}, - {0xFDF0, 0xFDFD}, {0xFE20, 0xFE2F}, {0xFE70, 0xFE74}, - {0xFE76, 0xFEFC}, {0xFEFF, 0xFEFF}, {0xFFF9, 0xFFFC}, - {0x10000, 0x1000B}, {0x1000D, 0x10026}, {0x10028, 0x1003A}, - {0x1003C, 0x1003D}, {0x1003F, 0x1004D}, {0x10050, 0x1005D}, - {0x10080, 0x100FA}, {0x10100, 0x10102}, {0x10107, 0x10133}, - {0x10137, 0x1018E}, {0x10190, 0x1019B}, {0x101A0, 0x101A0}, - {0x101D0, 0x101FD}, {0x10280, 0x1029C}, {0x102A0, 0x102D0}, - {0x102E0, 0x102FB}, {0x10300, 0x10323}, {0x1032D, 0x1034A}, - {0x10350, 0x1037A}, {0x10380, 0x1039D}, {0x1039F, 0x103C3}, - {0x103C8, 0x103D5}, {0x10400, 0x1049D}, {0x104A0, 0x104A9}, - {0x104B0, 0x104D3}, {0x104D8, 0x104FB}, {0x10500, 0x10527}, - {0x10530, 0x10563}, {0x1056F, 0x1056F}, {0x10600, 0x10736}, - {0x10740, 0x10755}, {0x10760, 0x10767}, {0x10800, 0x10805}, - {0x10808, 0x10808}, {0x1080A, 0x10835}, {0x10837, 0x10838}, - {0x1083C, 0x1083C}, {0x1083F, 0x10855}, {0x10857, 0x1089E}, - {0x108A7, 0x108AF}, {0x108E0, 0x108F2}, {0x108F4, 0x108F5}, - {0x108FB, 0x1091B}, {0x1091F, 0x10939}, {0x1093F, 0x1093F}, - {0x10980, 0x109B7}, {0x109BC, 0x109CF}, {0x109D2, 0x10A03}, - {0x10A05, 0x10A06}, {0x10A0C, 0x10A13}, {0x10A15, 0x10A17}, - {0x10A19, 0x10A35}, {0x10A38, 0x10A3A}, {0x10A3F, 0x10A48}, - {0x10A50, 0x10A58}, {0x10A60, 0x10A9F}, {0x10AC0, 0x10AE6}, - {0x10AEB, 0x10AF6}, {0x10B00, 0x10B35}, {0x10B39, 0x10B55}, - {0x10B58, 0x10B72}, {0x10B78, 0x10B91}, {0x10B99, 0x10B9C}, - {0x10BA9, 0x10BAF}, {0x10C00, 0x10C48}, {0x10C80, 0x10CB2}, - {0x10CC0, 0x10CF2}, {0x10CFA, 0x10D27}, {0x10D30, 0x10D39}, - {0x10E60, 0x10E7E}, {0x10F00, 0x10F27}, {0x10F30, 0x10F59}, - {0x10FE0, 0x10FF6}, {0x11000, 0x1104D}, {0x11052, 0x1106F}, - {0x1107F, 0x110C1}, {0x110CD, 0x110CD}, {0x110D0, 0x110E8}, - {0x110F0, 0x110F9}, {0x11100, 0x11134}, {0x11136, 0x11146}, - {0x11150, 0x11176}, {0x11180, 0x111CD}, {0x111D0, 0x111DF}, - {0x111E1, 0x111F4}, {0x11200, 0x11211}, {0x11213, 0x1123E}, - {0x11280, 0x11286}, {0x11288, 0x11288}, {0x1128A, 0x1128D}, - {0x1128F, 0x1129D}, {0x1129F, 0x112A9}, {0x112B0, 0x112EA}, - {0x112F0, 0x112F9}, {0x11300, 0x11303}, {0x11305, 0x1130C}, - {0x1130F, 0x11310}, {0x11313, 0x11328}, {0x1132A, 0x11330}, - {0x11332, 0x11333}, {0x11335, 0x11339}, {0x1133B, 0x11344}, - {0x11347, 0x11348}, {0x1134B, 0x1134D}, {0x11350, 0x11350}, - {0x11357, 0x11357}, {0x1135D, 0x11363}, {0x11366, 0x1136C}, - {0x11370, 0x11374}, {0x11400, 0x11459}, {0x1145B, 0x1145B}, - {0x1145D, 0x1145F}, {0x11480, 0x114C7}, {0x114D0, 0x114D9}, - {0x11580, 0x115B5}, {0x115B8, 0x115DD}, {0x11600, 0x11644}, - {0x11650, 0x11659}, {0x11660, 0x1166C}, {0x11680, 0x116B8}, - {0x116C0, 0x116C9}, {0x11700, 0x1171A}, {0x1171D, 0x1172B}, - {0x11730, 0x1173F}, {0x11800, 0x1183B}, {0x118A0, 0x118F2}, - {0x118FF, 0x118FF}, {0x119A0, 0x119A7}, {0x119AA, 0x119D7}, - {0x119DA, 0x119E4}, {0x11A00, 0x11A47}, {0x11A50, 0x11AA2}, - {0x11AC0, 0x11AF8}, {0x11C00, 0x11C08}, {0x11C0A, 0x11C36}, - {0x11C38, 0x11C45}, {0x11C50, 0x11C6C}, {0x11C70, 0x11C8F}, - {0x11C92, 0x11CA7}, {0x11CA9, 0x11CB6}, {0x11D00, 0x11D06}, - {0x11D08, 0x11D09}, {0x11D0B, 0x11D36}, {0x11D3A, 0x11D3A}, - {0x11D3C, 0x11D3D}, {0x11D3F, 0x11D47}, {0x11D50, 0x11D59}, - {0x11D60, 0x11D65}, {0x11D67, 0x11D68}, {0x11D6A, 0x11D8E}, - {0x11D90, 0x11D91}, {0x11D93, 0x11D98}, {0x11DA0, 0x11DA9}, - {0x11EE0, 0x11EF8}, {0x11FC0, 0x11FF1}, {0x11FFF, 0x12399}, - {0x12400, 0x1246E}, {0x12470, 0x12474}, {0x12480, 0x12543}, - {0x13000, 0x1342E}, {0x13430, 0x13438}, {0x14400, 0x14646}, - {0x16800, 0x16A38}, {0x16A40, 0x16A5E}, {0x16A60, 0x16A69}, - {0x16A6E, 0x16A6F}, {0x16AD0, 0x16AED}, {0x16AF0, 0x16AF5}, - {0x16B00, 0x16B45}, {0x16B50, 0x16B59}, {0x16B5B, 0x16B61}, - {0x16B63, 0x16B77}, {0x16B7D, 0x16B8F}, {0x16E40, 0x16E9A}, - {0x16F00, 0x16F4A}, {0x16F4F, 0x16F87}, {0x16F8F, 0x16F9F}, - {0x1BC00, 0x1BC6A}, {0x1BC70, 0x1BC7C}, {0x1BC80, 0x1BC88}, - {0x1BC90, 0x1BC99}, {0x1BC9C, 0x1BCA3}, {0x1D000, 0x1D0F5}, - {0x1D100, 0x1D126}, {0x1D129, 0x1D1E8}, {0x1D200, 0x1D245}, - {0x1D2E0, 0x1D2F3}, {0x1D300, 0x1D356}, {0x1D360, 0x1D378}, - {0x1D400, 0x1D454}, {0x1D456, 0x1D49C}, {0x1D49E, 0x1D49F}, - {0x1D4A2, 0x1D4A2}, {0x1D4A5, 0x1D4A6}, {0x1D4A9, 0x1D4AC}, - {0x1D4AE, 0x1D4B9}, {0x1D4BB, 0x1D4BB}, {0x1D4BD, 0x1D4C3}, - {0x1D4C5, 0x1D505}, {0x1D507, 0x1D50A}, {0x1D50D, 0x1D514}, - {0x1D516, 0x1D51C}, {0x1D51E, 0x1D539}, {0x1D53B, 0x1D53E}, - {0x1D540, 0x1D544}, {0x1D546, 0x1D546}, {0x1D54A, 0x1D550}, - {0x1D552, 0x1D6A5}, {0x1D6A8, 0x1D7CB}, {0x1D7CE, 0x1DA8B}, - {0x1DA9B, 0x1DA9F}, {0x1DAA1, 0x1DAAF}, {0x1E000, 0x1E006}, - {0x1E008, 0x1E018}, {0x1E01B, 0x1E021}, {0x1E023, 0x1E024}, - {0x1E026, 0x1E02A}, {0x1E100, 0x1E12C}, {0x1E130, 0x1E13D}, - {0x1E140, 0x1E149}, {0x1E14E, 0x1E14F}, {0x1E2C0, 0x1E2F9}, - {0x1E2FF, 0x1E2FF}, {0x1E800, 0x1E8C4}, {0x1E8C7, 0x1E8D6}, - {0x1E900, 0x1E94B}, {0x1E950, 0x1E959}, {0x1E95E, 0x1E95F}, - {0x1EC71, 0x1ECB4}, {0x1ED01, 0x1ED3D}, {0x1EE00, 0x1EE03}, - {0x1EE05, 0x1EE1F}, {0x1EE21, 0x1EE22}, {0x1EE24, 0x1EE24}, - {0x1EE27, 0x1EE27}, {0x1EE29, 0x1EE32}, {0x1EE34, 0x1EE37}, - {0x1EE39, 0x1EE39}, {0x1EE3B, 0x1EE3B}, {0x1EE42, 0x1EE42}, - {0x1EE47, 0x1EE47}, {0x1EE49, 0x1EE49}, {0x1EE4B, 0x1EE4B}, - {0x1EE4D, 0x1EE4F}, {0x1EE51, 0x1EE52}, {0x1EE54, 0x1EE54}, - {0x1EE57, 0x1EE57}, {0x1EE59, 0x1EE59}, {0x1EE5B, 0x1EE5B}, - {0x1EE5D, 0x1EE5D}, {0x1EE5F, 0x1EE5F}, {0x1EE61, 0x1EE62}, - {0x1EE64, 0x1EE64}, {0x1EE67, 0x1EE6A}, {0x1EE6C, 0x1EE72}, - {0x1EE74, 0x1EE77}, {0x1EE79, 0x1EE7C}, {0x1EE7E, 0x1EE7E}, - {0x1EE80, 0x1EE89}, {0x1EE8B, 0x1EE9B}, {0x1EEA1, 0x1EEA3}, - {0x1EEA5, 0x1EEA9}, {0x1EEAB, 0x1EEBB}, {0x1EEF0, 0x1EEF1}, - {0x1F000, 0x1F003}, {0x1F005, 0x1F02B}, {0x1F030, 0x1F093}, - {0x1F0A0, 0x1F0AE}, {0x1F0B1, 0x1F0BF}, {0x1F0C1, 0x1F0CE}, - {0x1F0D1, 0x1F0F5}, {0x1F10B, 0x1F10C}, {0x1F12E, 0x1F12F}, - {0x1F16A, 0x1F16C}, {0x1F1E6, 0x1F1FF}, {0x1F321, 0x1F32C}, - {0x1F336, 0x1F336}, {0x1F37D, 0x1F37D}, {0x1F394, 0x1F39F}, - {0x1F3CB, 0x1F3CE}, {0x1F3D4, 0x1F3DF}, {0x1F3F1, 0x1F3F3}, - {0x1F3F5, 0x1F3F7}, {0x1F43F, 0x1F43F}, {0x1F441, 0x1F441}, - {0x1F4FD, 0x1F4FE}, {0x1F53E, 0x1F54A}, {0x1F54F, 0x1F54F}, - {0x1F568, 0x1F579}, {0x1F57B, 0x1F594}, {0x1F597, 0x1F5A3}, - {0x1F5A5, 0x1F5FA}, {0x1F650, 0x1F67F}, {0x1F6C6, 0x1F6CB}, - {0x1F6CD, 0x1F6CF}, {0x1F6D3, 0x1F6D4}, {0x1F6E0, 0x1F6EA}, - {0x1F6F0, 0x1F6F3}, {0x1F700, 0x1F773}, {0x1F780, 0x1F7D8}, - {0x1F800, 0x1F80B}, {0x1F810, 0x1F847}, {0x1F850, 0x1F859}, - {0x1F860, 0x1F887}, {0x1F890, 0x1F8AD}, {0x1F900, 0x1F90B}, - {0x1FA00, 0x1FA53}, {0x1FA60, 0x1FA6D}, {0xE0001, 0xE0001}, - {0xE0020, 0xE007F}, -} - -var emoji = table{ - {0x203C, 0x203C}, {0x2049, 0x2049}, {0x2122, 0x2122}, - {0x2139, 0x2139}, {0x2194, 0x2199}, {0x21A9, 0x21AA}, - {0x231A, 0x231B}, {0x2328, 0x2328}, {0x2388, 0x2388}, - {0x23CF, 0x23CF}, {0x23E9, 0x23F3}, {0x23F8, 0x23FA}, - {0x24C2, 0x24C2}, {0x25AA, 0x25AB}, {0x25B6, 0x25B6}, - {0x25C0, 0x25C0}, {0x25FB, 0x25FE}, {0x2600, 0x2605}, - {0x2607, 0x2612}, {0x2614, 0x2685}, {0x2690, 0x2705}, - {0x2708, 0x2712}, {0x2714, 0x2714}, {0x2716, 0x2716}, - {0x271D, 0x271D}, {0x2721, 0x2721}, {0x2728, 0x2728}, - {0x2733, 0x2734}, {0x2744, 0x2744}, {0x2747, 0x2747}, - {0x274C, 0x274C}, {0x274E, 0x274E}, {0x2753, 0x2755}, - {0x2757, 0x2757}, {0x2763, 0x2767}, {0x2795, 0x2797}, - {0x27A1, 0x27A1}, {0x27B0, 0x27B0}, {0x27BF, 0x27BF}, - {0x2934, 0x2935}, {0x2B05, 0x2B07}, {0x2B1B, 0x2B1C}, - {0x2B50, 0x2B50}, {0x2B55, 0x2B55}, {0x3030, 0x3030}, - {0x303D, 0x303D}, {0x3297, 0x3297}, {0x3299, 0x3299}, - {0x1F000, 0x1F0FF}, {0x1F10D, 0x1F10F}, {0x1F12F, 0x1F12F}, - {0x1F16C, 0x1F171}, {0x1F17E, 0x1F17F}, {0x1F18E, 0x1F18E}, - {0x1F191, 0x1F19A}, {0x1F1AD, 0x1F1E5}, {0x1F201, 0x1F20F}, - {0x1F21A, 0x1F21A}, {0x1F22F, 0x1F22F}, {0x1F232, 0x1F23A}, - {0x1F23C, 0x1F23F}, {0x1F249, 0x1F3FA}, {0x1F400, 0x1F53D}, - {0x1F546, 0x1F64F}, {0x1F680, 0x1F6FF}, {0x1F774, 0x1F77F}, - {0x1F7D5, 0x1F7FF}, {0x1F80C, 0x1F80F}, {0x1F848, 0x1F84F}, - {0x1F85A, 0x1F85F}, {0x1F888, 0x1F88F}, {0x1F8AE, 0x1F8FF}, - {0x1F90C, 0x1F93A}, {0x1F93C, 0x1F945}, {0x1F947, 0x1FFFD}, -} diff --git a/vendor/github.com/mattn/go-runewidth/runewidth_windows.go b/vendor/github.com/mattn/go-runewidth/runewidth_windows.go deleted file mode 100644 index d6a61777..00000000 --- a/vendor/github.com/mattn/go-runewidth/runewidth_windows.go +++ /dev/null @@ -1,28 +0,0 @@ -// +build windows -// +build !appengine - -package runewidth - -import ( - "syscall" -) - -var ( - kernel32 = syscall.NewLazyDLL("kernel32") - procGetConsoleOutputCP = kernel32.NewProc("GetConsoleOutputCP") -) - -// IsEastAsian return true if the current locale is CJK -func IsEastAsian() bool { - r1, _, _ := procGetConsoleOutputCP.Call() - if r1 == 0 { - return false - } - - switch int(r1) { - case 932, 51932, 936, 949, 950: - return true - } - - return false -} diff --git a/vendor/github.com/rivo/tview/CODE_OF_CONDUCT.md b/vendor/github.com/rivo/tview/CODE_OF_CONDUCT.md deleted file mode 100644 index 601e63b8..00000000 --- a/vendor/github.com/rivo/tview/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,73 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, gender identity and expression, level of experience, -education, socio-economic status, nationality, personal appearance, race, -religion, or sexual identity and orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or - advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or -reject comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct, or to ban temporarily or -permanently any contributor for other behaviors that they deem inappropriate, -threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at https://rentafounder.com/page/about-me/. All -complaints will be reviewed and investigated and will result in a response that -is deemed necessary and appropriate to the circumstances. The project team is -obligated to maintain confidentiality with regard to the reporter of an incident. -Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good -faith may face temporary or permanent repercussions as determined by other -members of the project's leadership. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html - -[homepage]: https://www.contributor-covenant.org diff --git a/vendor/github.com/rivo/tview/CONTRIBUTING.md b/vendor/github.com/rivo/tview/CONTRIBUTING.md deleted file mode 100644 index 92f6886d..00000000 --- a/vendor/github.com/rivo/tview/CONTRIBUTING.md +++ /dev/null @@ -1,35 +0,0 @@ -# Contributing to tview - -First of all, thank you for taking the time to contribute. - -The following provides you with some guidance on how to contribute to this project. Mainly, it is meant to save us all some time so please read it, it's not long. - -Please note that this document is work in progress so I might add to it in the future. - -## Issues - -- Please include enough information so everybody understands your request. -- Screenshots or code that illustrates your point always helps. -- It's fine to ask for help. But you should have checked out the [documentation](https://godoc.org/github.com/rivo/tview) first in any case. -- If you request a new feature, state your motivation and share a use case that you faced where you needed that new feature. It should be something that others will also need. - -## Pull Requests - -In my limited time I can spend on this project, I will always go through issues first before looking at pull requests. It takes a _lot_ of time to look at code that you submitted and I may not have that time. So be prepared to have your pull requests lying around for a long time. - -Therefore, if you have a feature request, open an issue first before sending me a pull request, and allow for some discussion. It may save you from writing code that will get rejected. If your case is strong, there is a good chance that I will add the feature for you. - -I'm very picky about the code that goes into this repo. So if you violate any of the following guidelines, there is a good chance I won't merge your pull request. - -- There must be a strong case for your additions/changes, such as: - - Bug fixes - - Features that are needed (see "Issues" above; state your motivation) - - Improvements in stability or performance (if readability does not suffer) -- Your code must follow the structure of the existing code. Don't just patch something on. Try to understand how `tview` is currently designed and follow that design. Your code needs to be consistent with existing code. -- If you're adding code that increases the work required to maintain the project, you must be willing to take responsibility for that extra work. I will ask you to maintain your part of the code in the long run. -- Function/type/variable/constant names must be as descriptive as they are right now. Follow the conventions of the package. -- All functions/types/variables/constants, even private ones, must have comments in good English. These comments must be elaborate enough so that new users of the package understand them and can follow them. Provide examples if you have to. Start all sentences upper-case, as is common in English, and end them with a period. -- A new function should be located close to related functions in the file. For example, `GetColor()` should come after (or before) `SetColor()`. -- Your changes must not decrease the project's [Go Report](https://goreportcard.com/report/github.com/rivo/tview) rating. -- No breaking changes unless there is absolutely no other way. -- If an issue accompanies your pull request, reference it in the PR's comments, e.g. "Fixes #123", so it is closed automatically when the PR is closed. diff --git a/vendor/github.com/rivo/tview/LICENSE.txt b/vendor/github.com/rivo/tview/LICENSE.txt deleted file mode 100644 index 9d694307..00000000 --- a/vendor/github.com/rivo/tview/LICENSE.txt +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2018 Oliver Kuederle - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/rivo/tview/README.md b/vendor/github.com/rivo/tview/README.md deleted file mode 100644 index 6e016ad2..00000000 --- a/vendor/github.com/rivo/tview/README.md +++ /dev/null @@ -1,62 +0,0 @@ -# Rich Interactive Widgets for Terminal UIs - -[![Godoc Reference](https://img.shields.io/badge/godoc-reference-blue.svg)](https://pkg.go.dev/github.com/rivo/tview) -[![Go Report](https://img.shields.io/badge/go%20report-A%2B-brightgreen.svg)](https://goreportcard.com/report/github.com/rivo/tview) - -This Go package provides commonly needed components for terminal based user interfaces. - -![Screenshot](tview.gif) - -Among these components are: - -- __Input forms__ (include __input/password fields__, __drop-down selections__, __checkboxes__, and __buttons__) -- Navigable multi-color __text views__ -- Sophisticated navigable __table views__ -- Flexible __tree views__ -- Selectable __lists__ -- __Grid__, __Flexbox__ and __page layouts__ -- Modal __message windows__ -- An __application__ wrapper - -They come with lots of customization options and can be easily extended to fit your needs. - -## Installation - -```bash -go get github.com/rivo/tview -``` - -## Hello World - -This basic example creates a box titled "Hello, World!" and displays it in your terminal: - -```go -package main - -import ( - "github.com/rivo/tview" -) - -func main() { - box := tview.NewBox().SetBorder(true).SetTitle("Hello, world!") - if err := tview.NewApplication().SetRoot(box, true).Run(); err != nil { - panic(err) - } -} -``` - -Check out the [GitHub Wiki](https://github.com/rivo/tview/wiki) for more examples along with screenshots. Or try the examples in the "demos" subdirectory. - -For a presentation highlighting this package, compile and run the program found in the "demos/presentation" subdirectory. - -## Documentation - -Refer to https://pkg.go.dev/github.com/rivo/tview for the package's documentation. - -## Dependencies - -This package is based on [github.com/gdamore/tcell](https://github.com/gdamore/tcell) (and its dependencies) as well as on [github.com/rivo/uniseg](https://github.com/rivo/uniseg). - -## Your Feedback - -Add your issue here on GitHub. Feel free to get in touch if you have any questions. diff --git a/vendor/github.com/rivo/tview/ansi.go b/vendor/github.com/rivo/tview/ansi.go deleted file mode 100644 index 49b2e92f..00000000 --- a/vendor/github.com/rivo/tview/ansi.go +++ /dev/null @@ -1,258 +0,0 @@ -package tview - -import ( - "bytes" - "fmt" - "io" - "strconv" - "strings" -) - -// The states of the ANSI escape code parser. -const ( - ansiText = iota - ansiEscape - ansiSubstring - ansiControlSequence -) - -// ansi is a io.Writer which translates ANSI escape codes into tview color -// tags. -type ansi struct { - io.Writer - - // Reusable buffers. - buffer *bytes.Buffer // The entire output text of one Write(). - csiParameter, csiIntermediate *bytes.Buffer // Partial CSI strings. - attributes string // The buffer's current text attributes (a tview attribute string). - - // The current state of the parser. One of the ansi constants. - state int -} - -// ANSIWriter returns an io.Writer which translates any ANSI escape codes -// written to it into tview color tags. Other escape codes don't have an effect -// and are simply removed. The translated text is written to the provided -// writer. -func ANSIWriter(writer io.Writer) io.Writer { - return &ansi{ - Writer: writer, - buffer: new(bytes.Buffer), - csiParameter: new(bytes.Buffer), - csiIntermediate: new(bytes.Buffer), - state: ansiText, - } -} - -// Write parses the given text as a string of runes, translates ANSI escape -// codes to color tags and writes them to the output writer. -func (a *ansi) Write(text []byte) (int, error) { - defer func() { - a.buffer.Reset() - }() - - for _, r := range string(text) { - switch a.state { - - // We just entered an escape sequence. - case ansiEscape: - switch r { - case '[': // Control Sequence Introducer. - a.csiParameter.Reset() - a.csiIntermediate.Reset() - a.state = ansiControlSequence - case 'c': // Reset. - fmt.Fprint(a.buffer, "[-:-:-]") - a.state = ansiText - case 'P', ']', 'X', '^', '_': // Substrings and commands. - a.state = ansiSubstring - default: // Ignore. - a.state = ansiText - } - - // CSI Sequences. - case ansiControlSequence: - switch { - case r >= 0x30 && r <= 0x3f: // Parameter bytes. - if _, err := a.csiParameter.WriteRune(r); err != nil { - return 0, err - } - case r >= 0x20 && r <= 0x2f: // Intermediate bytes. - if _, err := a.csiIntermediate.WriteRune(r); err != nil { - return 0, err - } - case r >= 0x40 && r <= 0x7e: // Final byte. - switch r { - case 'E': // Next line. - count, _ := strconv.Atoi(a.csiParameter.String()) - if count == 0 { - count = 1 - } - fmt.Fprint(a.buffer, strings.Repeat("\n", count)) - case 'm': // Select Graphic Rendition. - var background, foreground string - params := a.csiParameter.String() - fields := strings.Split(params, ";") - if len(params) == 0 || len(fields) == 1 && fields[0] == "0" { - // Reset. - a.attributes = "" - if _, err := a.buffer.WriteString("[-:-:-]"); err != nil { - return 0, err - } - break - } - lookupColor := func(colorNumber int) string { - if colorNumber < 0 || colorNumber > 15 { - return "black" - } - return []string{ - "black", - "maroon", - "green", - "olive", - "navy", - "purple", - "teal", - "silver", - "gray", - "red", - "lime", - "yellow", - "blue", - "fuchsia", - "aqua", - "white", - }[colorNumber] - } - FieldLoop: - for index, field := range fields { - switch field { - case "1", "01": - if strings.IndexRune(a.attributes, 'b') < 0 { - a.attributes += "b" - } - case "2", "02": - if strings.IndexRune(a.attributes, 'd') < 0 { - a.attributes += "d" - } - case "4", "04": - if strings.IndexRune(a.attributes, 'u') < 0 { - a.attributes += "u" - } - case "5", "05": - if strings.IndexRune(a.attributes, 'l') < 0 { - a.attributes += "l" - } - case "22": - if i := strings.IndexRune(a.attributes, 'b'); i >= 0 { - a.attributes = a.attributes[:i] + a.attributes[i+1:] - } - if i := strings.IndexRune(a.attributes, 'd'); i >= 0 { - a.attributes = a.attributes[:i] + a.attributes[i+1:] - } - case "24": - if i := strings.IndexRune(a.attributes, 'u'); i >= 0 { - a.attributes = a.attributes[:i] + a.attributes[i+1:] - } - case "25": - if i := strings.IndexRune(a.attributes, 'l'); i >= 0 { - a.attributes = a.attributes[:i] + a.attributes[i+1:] - } - case "30", "31", "32", "33", "34", "35", "36", "37": - colorNumber, _ := strconv.Atoi(field) - foreground = lookupColor(colorNumber - 30) - case "39": - foreground = "-" - case "40", "41", "42", "43", "44", "45", "46", "47": - colorNumber, _ := strconv.Atoi(field) - background = lookupColor(colorNumber - 40) - case "49": - background = "-" - case "90", "91", "92", "93", "94", "95", "96", "97": - colorNumber, _ := strconv.Atoi(field) - foreground = lookupColor(colorNumber - 82) - case "100", "101", "102", "103", "104", "105", "106", "107": - colorNumber, _ := strconv.Atoi(field) - background = lookupColor(colorNumber - 92) - case "38", "48": - var color string - if len(fields) > index+1 { - if fields[index+1] == "5" && len(fields) > index+2 { // 8-bit colors. - colorNumber, _ := strconv.Atoi(fields[index+2]) - if colorNumber <= 15 { - color = lookupColor(colorNumber) - } else if colorNumber <= 231 { - red := (colorNumber - 16) / 36 - green := ((colorNumber - 16) / 6) % 6 - blue := (colorNumber - 16) % 6 - color = fmt.Sprintf("#%02x%02x%02x", 255*red/5, 255*green/5, 255*blue/5) - } else if colorNumber <= 255 { - grey := 255 * (colorNumber - 232) / 23 - color = fmt.Sprintf("#%02x%02x%02x", grey, grey, grey) - } - } else if fields[index+1] == "2" && len(fields) > index+4 { // 24-bit colors. - red, _ := strconv.Atoi(fields[index+2]) - green, _ := strconv.Atoi(fields[index+3]) - blue, _ := strconv.Atoi(fields[index+4]) - color = fmt.Sprintf("#%02x%02x%02x", red, green, blue) - } - } - if len(color) > 0 { - if field == "38" { - foreground = color - } else { - background = color - } - } - break FieldLoop - } - } - var colon string - if len(a.attributes) > 0 { - colon = ":" - } - if len(foreground) > 0 || len(background) > 0 || len(a.attributes) > 0 { - fmt.Fprintf(a.buffer, "[%s:%s%s%s]", foreground, background, colon, a.attributes) - } - } - a.state = ansiText - default: // Undefined byte. - a.state = ansiText // Abort CSI. - } - - // We just entered a substring/command sequence. - case ansiSubstring: - if r == 27 { // Most likely the end of the substring. - a.state = ansiEscape - } // Ignore all other characters. - - // "ansiText" and all others. - default: - if r == 27 { - // This is the start of an escape sequence. - a.state = ansiEscape - } else { - // Just a regular rune. Send to buffer. - if _, err := a.buffer.WriteRune(r); err != nil { - return 0, err - } - } - } - } - - // Write buffer to target writer. - n, err := a.buffer.WriteTo(a.Writer) - if err != nil { - return int(n), err - } - return len(text), nil -} - -// TranslateANSI replaces ANSI escape sequences found in the provided string -// with tview's color tags and returns the resulting string. -func TranslateANSI(text string) string { - var buffer bytes.Buffer - writer := ANSIWriter(&buffer) - writer.Write([]byte(text)) - return buffer.String() -} diff --git a/vendor/github.com/rivo/tview/application.go b/vendor/github.com/rivo/tview/application.go deleted file mode 100644 index 67ef6dd8..00000000 --- a/vendor/github.com/rivo/tview/application.go +++ /dev/null @@ -1,728 +0,0 @@ -package tview - -import ( - "sync" - "time" - - "github.com/gdamore/tcell" -) - -const ( - // The size of the event/update/redraw channels. - queueSize = 100 - - // The minimum time between two consecutive redraws. - redrawPause = 50 * time.Millisecond -) - -// DoubleClickInterval specifies the maximum time between clicks to register a -// double click rather than click. -var DoubleClickInterval = 500 * time.Millisecond - -// MouseAction indicates one of the actions the mouse is logically doing. -type MouseAction int16 - -// Available mouse actions. -const ( - MouseMove MouseAction = iota - MouseLeftDown - MouseLeftUp - MouseLeftClick - MouseLeftDoubleClick - MouseMiddleDown - MouseMiddleUp - MouseMiddleClick - MouseMiddleDoubleClick - MouseRightDown - MouseRightUp - MouseRightClick - MouseRightDoubleClick - MouseScrollUp - MouseScrollDown - MouseScrollLeft - MouseScrollRight -) - -// queuedUpdate represented the execution of f queued by -// Application.QueueUpdate(). The "done" channel receives exactly one element -// after f has executed. -type queuedUpdate struct { - f func() - done chan struct{} -} - -// Application represents the top node of an application. -// -// It is not strictly required to use this class as none of the other classes -// depend on it. However, it provides useful tools to set up an application and -// plays nicely with all widgets. -// -// The following command displays a primitive p on the screen until Ctrl-C is -// pressed: -// -// if err := tview.NewApplication().SetRoot(p, true).Run(); err != nil { -// panic(err) -// } -type Application struct { - sync.RWMutex - - // The application's screen. Apart from Run(), this variable should never be - // set directly. Always use the screenReplacement channel after calling - // Fini(), to set a new screen (or nil to stop the application). - screen tcell.Screen - - // The primitive which currently has the keyboard focus. - focus Primitive - - // The root primitive to be seen on the screen. - root Primitive - - // Whether or not the application resizes the root primitive. - rootFullscreen bool - - // Set to true if mouse events are enabled. - enableMouse bool - - // An optional capture function which receives a key event and returns the - // event to be forwarded to the default input handler (nil if nothing should - // be forwarded). - inputCapture func(event *tcell.EventKey) *tcell.EventKey - - // An optional callback function which is invoked just before the root - // primitive is drawn. - beforeDraw func(screen tcell.Screen) bool - - // An optional callback function which is invoked after the root primitive - // was drawn. - afterDraw func(screen tcell.Screen) - - // Used to send screen events from separate goroutine to main event loop - events chan tcell.Event - - // Functions queued from goroutines, used to serialize updates to primitives. - updates chan queuedUpdate - - // An object that the screen variable will be set to after Fini() was called. - // Use this channel to set a new screen object for the application - // (screen.Init() and draw() will be called implicitly). A value of nil will - // stop the application. - screenReplacement chan tcell.Screen - - // An optional capture function which receives a mouse event and returns the - // event to be forwarded to the default mouse handler (nil if nothing should - // be forwarded). - mouseCapture func(event *tcell.EventMouse, action MouseAction) (*tcell.EventMouse, MouseAction) - - mouseCapturingPrimitive Primitive // A Primitive returned by a MouseHandler which will capture future mouse events. - lastMouseX, lastMouseY int // The last position of the mouse. - mouseDownX, mouseDownY int // The position of the mouse when its button was last pressed. - lastMouseClick time.Time // The time when a mouse button was last clicked. - lastMouseButtons tcell.ButtonMask // The last mouse button state. -} - -// NewApplication creates and returns a new application. -func NewApplication() *Application { - return &Application{ - events: make(chan tcell.Event, queueSize), - updates: make(chan queuedUpdate, queueSize), - screenReplacement: make(chan tcell.Screen, 1), - } -} - -// SetInputCapture sets a function which captures all key events before they are -// forwarded to the key event handler of the primitive which currently has -// focus. This function can then choose to forward that key event (or a -// different one) by returning it or stop the key event processing by returning -// nil. -// -// Note that this also affects the default event handling of the application -// itself: Such a handler can intercept the Ctrl-C event which closes the -// application. -func (a *Application) SetInputCapture(capture func(event *tcell.EventKey) *tcell.EventKey) *Application { - a.inputCapture = capture - return a -} - -// GetInputCapture returns the function installed with SetInputCapture() or nil -// if no such function has been installed. -func (a *Application) GetInputCapture() func(event *tcell.EventKey) *tcell.EventKey { - return a.inputCapture -} - -// SetMouseCapture sets a function which captures mouse events (consisting of -// the original tcell mouse event and the semantic mouse action) before they are -// forwarded to the appropriate mouse event handler. This function can then -// choose to forward that event (or a different one) by returning it or stop -// the event processing by returning a nil mouse event. -func (a *Application) SetMouseCapture(capture func(event *tcell.EventMouse, action MouseAction) (*tcell.EventMouse, MouseAction)) *Application { - a.mouseCapture = capture - return a -} - -// GetMouseCapture returns the function installed with SetMouseCapture() or nil -// if no such function has been installed. -func (a *Application) GetMouseCapture() func(event *tcell.EventMouse, action MouseAction) (*tcell.EventMouse, MouseAction) { - return a.mouseCapture -} - -// SetScreen allows you to provide your own tcell.Screen object. For most -// applications, this is not needed and you should be familiar with -// tcell.Screen when using this function. -// -// This function is typically called before the first call to Run(). Init() need -// not be called on the screen. -func (a *Application) SetScreen(screen tcell.Screen) *Application { - if screen == nil { - return a // Invalid input. Do nothing. - } - - a.Lock() - if a.screen == nil { - // Run() has not been called yet. - a.screen = screen - a.Unlock() - return a - } - - // Run() is already in progress. Exchange screen. - oldScreen := a.screen - a.Unlock() - oldScreen.Fini() - a.screenReplacement <- screen - - return a -} - -// EnableMouse enables mouse events. -func (a *Application) EnableMouse(enable bool) *Application { - a.Lock() - defer a.Unlock() - if enable != a.enableMouse && a.screen != nil { - if enable { - a.screen.EnableMouse() - } else { - a.screen.DisableMouse() - } - } - a.enableMouse = enable - return a -} - -// Run starts the application and thus the event loop. This function returns -// when Stop() was called. -func (a *Application) Run() error { - var ( - err error - width, height int // The current size of the screen. - lastRedraw time.Time // The time the screen was last redrawn. - redrawTimer *time.Timer // A timer to schedule the next redraw. - ) - a.Lock() - - // Make a screen if there is none yet. - if a.screen == nil { - a.screen, err = tcell.NewScreen() - if err != nil { - a.Unlock() - return err - } - if err = a.screen.Init(); err != nil { - a.Unlock() - return err - } - if a.enableMouse { - a.screen.EnableMouse() - } - } - - // We catch panics to clean up because they mess up the terminal. - defer func() { - if p := recover(); p != nil { - if a.screen != nil { - a.screen.Fini() - } - panic(p) - } - }() - - // Draw the screen for the first time. - a.Unlock() - a.draw() - - // Separate loop to wait for screen events. - var wg sync.WaitGroup - wg.Add(1) - go func() { - defer wg.Done() - for { - a.RLock() - screen := a.screen - a.RUnlock() - if screen == nil { - // We have no screen. Let's stop. - a.QueueEvent(nil) - break - } - - // Wait for next event and queue it. - event := screen.PollEvent() - if event != nil { - // Regular event. Queue. - a.QueueEvent(event) - continue - } - - // A screen was finalized (event is nil). Wait for a new scren. - screen = <-a.screenReplacement - if screen == nil { - // No new screen. We're done. - a.QueueEvent(nil) - return - } - - // We have a new screen. Keep going. - a.Lock() - a.screen = screen - a.Unlock() - - // Initialize and draw this screen. - if err := screen.Init(); err != nil { - panic(err) - } - a.draw() - } - }() - - // Start event loop. -EventLoop: - for { - select { - case event := <-a.events: - if event == nil { - break EventLoop - } - - switch event := event.(type) { - case *tcell.EventKey: - a.RLock() - p := a.focus - inputCapture := a.inputCapture - a.RUnlock() - - // Intercept keys. - if inputCapture != nil { - event = inputCapture(event) - if event == nil { - a.draw() - continue // Don't forward event. - } - } - - // Ctrl-C closes the application. - if event.Key() == tcell.KeyCtrlC { - a.Stop() - } - - // Pass other key events to the currently focused primitive. - if p != nil { - if handler := p.InputHandler(); handler != nil { - handler(event, func(p Primitive) { - a.SetFocus(p) - }) - a.draw() - } - } - case *tcell.EventResize: - if time.Since(lastRedraw) < redrawPause { - if redrawTimer != nil { - redrawTimer.Stop() - } - redrawTimer = time.AfterFunc(redrawPause, func() { - a.events <- event - }) - } - a.RLock() - screen := a.screen - a.RUnlock() - if screen == nil { - continue - } - newWidth, newHeight := screen.Size() - if newWidth == width && newHeight == height { - continue - } - width, height = newWidth, newHeight - lastRedraw = time.Now() - screen.Clear() - a.draw() - case *tcell.EventMouse: - consumed, isMouseDownAction := a.fireMouseActions(event) - if consumed { - a.draw() - } - a.lastMouseButtons = event.Buttons() - if isMouseDownAction { - a.mouseDownX, a.mouseDownY = event.Position() - } - } - - // If we have updates, now is the time to execute them. - case update := <-a.updates: - update.f() - update.done <- struct{}{} - } - } - - // Wait for the event loop to finish. - wg.Wait() - a.screen = nil - - return nil -} - -// fireMouseActions analyzes the provided mouse event, derives mouse actions -// from it and then forwards them to the corresponding primitives. -func (a *Application) fireMouseActions(event *tcell.EventMouse) (consumed, isMouseDownAction bool) { - // We want to relay follow-up events to the same target primitive. - var targetPrimitive Primitive - - // Helper function to fire a mouse action. - fire := func(action MouseAction) { - switch action { - case MouseLeftDown, MouseMiddleDown, MouseRightDown: - isMouseDownAction = true - } - - // Intercept event. - if a.mouseCapture != nil { - event, action = a.mouseCapture(event, action) - if event == nil { - consumed = true - return // Don't forward event. - } - } - - // Determine the target primitive. - var primitive, capturingPrimitive Primitive - if a.mouseCapturingPrimitive != nil { - primitive = a.mouseCapturingPrimitive - targetPrimitive = a.mouseCapturingPrimitive - } else if targetPrimitive != nil { - primitive = targetPrimitive - } else { - primitive = a.root - } - if primitive != nil { - if handler := primitive.MouseHandler(); handler != nil { - var wasConsumed bool - wasConsumed, capturingPrimitive = handler(action, event, func(p Primitive) { - a.SetFocus(p) - }) - if wasConsumed { - consumed = true - } - } - } - a.mouseCapturingPrimitive = capturingPrimitive - } - - x, y := event.Position() - buttons := event.Buttons() - clickMoved := x != a.mouseDownX || y != a.mouseDownY - buttonChanges := buttons ^ a.lastMouseButtons - - if x != a.lastMouseX || y != a.lastMouseY { - fire(MouseMove) - a.lastMouseX = x - a.lastMouseY = y - } - - for _, buttonEvent := range []struct { - button tcell.ButtonMask - down, up, click, dclick MouseAction - }{ - {tcell.Button1, MouseLeftDown, MouseLeftUp, MouseLeftClick, MouseLeftDoubleClick}, - {tcell.Button2, MouseMiddleDown, MouseMiddleUp, MouseMiddleClick, MouseMiddleDoubleClick}, - {tcell.Button3, MouseRightDown, MouseRightUp, MouseRightClick, MouseRightDoubleClick}, - } { - if buttonChanges&buttonEvent.button != 0 { - if buttons&buttonEvent.button != 0 { - fire(buttonEvent.down) - } else { - fire(buttonEvent.up) - if !clickMoved { - if a.lastMouseClick.Add(DoubleClickInterval).Before(time.Now()) { - fire(buttonEvent.click) - a.lastMouseClick = time.Now() - } else { - fire(buttonEvent.dclick) - a.lastMouseClick = time.Time{} // reset - } - } - } - } - } - - for _, wheelEvent := range []struct { - button tcell.ButtonMask - action MouseAction - }{ - {tcell.WheelUp, MouseScrollUp}, - {tcell.WheelDown, MouseScrollDown}, - {tcell.WheelLeft, MouseScrollLeft}, - {tcell.WheelRight, MouseScrollRight}} { - if buttons&wheelEvent.button != 0 { - fire(wheelEvent.action) - } - } - - return consumed, isMouseDownAction -} - -// Stop stops the application, causing Run() to return. -func (a *Application) Stop() { - a.Lock() - defer a.Unlock() - screen := a.screen - if screen == nil { - return - } - a.screen = nil - screen.Fini() - a.screenReplacement <- nil -} - -// Suspend temporarily suspends the application by exiting terminal UI mode and -// invoking the provided function "f". When "f" returns, terminal UI mode is -// entered again and the application resumes. -// -// A return value of true indicates that the application was suspended and "f" -// was called. If false is returned, the application was already suspended, -// terminal UI mode was not exited, and "f" was not called. -func (a *Application) Suspend(f func()) bool { - a.RLock() - screen := a.screen - a.RUnlock() - if screen == nil { - return false // Screen has not yet been initialized. - } - - // Enter suspended mode. - screen.Fini() - - // Wait for "f" to return. - f() - - // Make a new screen. - var err error - screen, err = tcell.NewScreen() - if err != nil { - panic(err) - } - a.screenReplacement <- screen - // One key event will get lost, see https://github.com/gdamore/tcell/issues/194 - - // Continue application loop. - return true -} - -// Draw refreshes the screen (during the next update cycle). It calls the Draw() -// function of the application's root primitive and then syncs the screen -// buffer. It is almost never necessary to call this function. Please see -// https://github.com/rivo/tview/wiki/Concurrency for details. -func (a *Application) Draw() *Application { - a.QueueUpdate(func() { - a.draw() - }) - return a -} - -// ForceDraw refreshes the screen immediately. Use this function with caution as -// it may lead to race conditions with updates to primitives in other -// goroutines. It is always preferrable to use Draw() instead. Never call this -// function from a goroutine. -// -// It is safe to call this function during queued updates and direct event -// handling. -func (a *Application) ForceDraw() *Application { - return a.draw() -} - -// draw actually does what Draw() promises to do. -func (a *Application) draw() *Application { - a.Lock() - defer a.Unlock() - - screen := a.screen - root := a.root - fullscreen := a.rootFullscreen - before := a.beforeDraw - after := a.afterDraw - - // Maybe we're not ready yet or not anymore. - if screen == nil || root == nil { - return a - } - - // Resize if requested. - if fullscreen && root != nil { - width, height := screen.Size() - root.SetRect(0, 0, width, height) - } - - // Call before handler if there is one. - if before != nil { - if before(screen) { - screen.Show() - return a - } - } - - // Draw all primitives. - root.Draw(screen) - - // Call after handler if there is one. - if after != nil { - after(screen) - } - - // Sync screen. - screen.Show() - - return a -} - -// SetBeforeDrawFunc installs a callback function which is invoked just before -// the root primitive is drawn during screen updates. If the function returns -// true, drawing will not continue, i.e. the root primitive will not be drawn -// (and an after-draw-handler will not be called). -// -// Note that the screen is not cleared by the application. To clear the screen, -// you may call screen.Clear(). -// -// Provide nil to uninstall the callback function. -func (a *Application) SetBeforeDrawFunc(handler func(screen tcell.Screen) bool) *Application { - a.beforeDraw = handler - return a -} - -// GetBeforeDrawFunc returns the callback function installed with -// SetBeforeDrawFunc() or nil if none has been installed. -func (a *Application) GetBeforeDrawFunc() func(screen tcell.Screen) bool { - return a.beforeDraw -} - -// SetAfterDrawFunc installs a callback function which is invoked after the root -// primitive was drawn during screen updates. -// -// Provide nil to uninstall the callback function. -func (a *Application) SetAfterDrawFunc(handler func(screen tcell.Screen)) *Application { - a.afterDraw = handler - return a -} - -// GetAfterDrawFunc returns the callback function installed with -// SetAfterDrawFunc() or nil if none has been installed. -func (a *Application) GetAfterDrawFunc() func(screen tcell.Screen) { - return a.afterDraw -} - -// SetRoot sets the root primitive for this application. If "fullscreen" is set -// to true, the root primitive's position will be changed to fill the screen. -// -// This function must be called at least once or nothing will be displayed when -// the application starts. -// -// It also calls SetFocus() on the primitive. -func (a *Application) SetRoot(root Primitive, fullscreen bool) *Application { - a.Lock() - a.root = root - a.rootFullscreen = fullscreen - if a.screen != nil { - a.screen.Clear() - } - a.Unlock() - - a.SetFocus(root) - - return a -} - -// ResizeToFullScreen resizes the given primitive such that it fills the entire -// screen. -func (a *Application) ResizeToFullScreen(p Primitive) *Application { - a.RLock() - width, height := a.screen.Size() - a.RUnlock() - p.SetRect(0, 0, width, height) - return a -} - -// SetFocus sets the focus on a new primitive. All key events will be redirected -// to that primitive. Callers must ensure that the primitive will handle key -// events. -// -// Blur() will be called on the previously focused primitive. Focus() will be -// called on the new primitive. -func (a *Application) SetFocus(p Primitive) *Application { - a.Lock() - if a.focus != nil { - a.focus.Blur() - } - a.focus = p - if a.screen != nil { - a.screen.HideCursor() - } - a.Unlock() - if p != nil { - p.Focus(func(p Primitive) { - a.SetFocus(p) - }) - } - - return a -} - -// GetFocus returns the primitive which has the current focus. If none has it, -// nil is returned. -func (a *Application) GetFocus() Primitive { - a.RLock() - defer a.RUnlock() - return a.focus -} - -// QueueUpdate is used to synchronize access to primitives from non-main -// goroutines. The provided function will be executed as part of the event loop -// and thus will not cause race conditions with other such update functions or -// the Draw() function. -// -// Note that Draw() is not implicitly called after the execution of f as that -// may not be desirable. You can call Draw() from f if the screen should be -// refreshed after each update. Alternatively, use QueueUpdateDraw() to follow -// up with an immediate refresh of the screen. -// -// This function returns after f has executed. -func (a *Application) QueueUpdate(f func()) *Application { - ch := make(chan struct{}) - a.updates <- queuedUpdate{f: f, done: ch} - <-ch - return a -} - -// QueueUpdateDraw works like QueueUpdate() except it refreshes the screen -// immediately after executing f. -func (a *Application) QueueUpdateDraw(f func()) *Application { - a.QueueUpdate(func() { - f() - a.draw() - }) - return a -} - -// QueueEvent sends an event to the Application event loop. -// -// It is not recommended for event to be nil. -func (a *Application) QueueEvent(event tcell.Event) *Application { - a.events <- event - return a -} diff --git a/vendor/github.com/rivo/tview/borders.go b/vendor/github.com/rivo/tview/borders.go deleted file mode 100644 index 946c8783..00000000 --- a/vendor/github.com/rivo/tview/borders.go +++ /dev/null @@ -1,45 +0,0 @@ -package tview - -// Borders defines various borders used when primitives are drawn. -// These may be changed to accommodate a different look and feel. -var Borders = struct { - Horizontal rune - Vertical rune - TopLeft rune - TopRight rune - BottomLeft rune - BottomRight rune - - LeftT rune - RightT rune - TopT rune - BottomT rune - Cross rune - - HorizontalFocus rune - VerticalFocus rune - TopLeftFocus rune - TopRightFocus rune - BottomLeftFocus rune - BottomRightFocus rune -}{ - Horizontal: BoxDrawingsLightHorizontal, - Vertical: BoxDrawingsLightVertical, - TopLeft: BoxDrawingsLightDownAndRight, - TopRight: BoxDrawingsLightDownAndLeft, - BottomLeft: BoxDrawingsLightUpAndRight, - BottomRight: BoxDrawingsLightUpAndLeft, - - LeftT: BoxDrawingsLightVerticalAndRight, - RightT: BoxDrawingsLightVerticalAndLeft, - TopT: BoxDrawingsLightDownAndHorizontal, - BottomT: BoxDrawingsLightUpAndHorizontal, - Cross: BoxDrawingsLightVerticalAndHorizontal, - - HorizontalFocus: BoxDrawingsDoubleHorizontal, - VerticalFocus: BoxDrawingsDoubleVertical, - TopLeftFocus: BoxDrawingsDoubleDownAndRight, - TopRightFocus: BoxDrawingsDoubleDownAndLeft, - BottomLeftFocus: BoxDrawingsDoubleUpAndRight, - BottomRightFocus: BoxDrawingsDoubleUpAndLeft, -} diff --git a/vendor/github.com/rivo/tview/box.go b/vendor/github.com/rivo/tview/box.go deleted file mode 100644 index 6cc34b78..00000000 --- a/vendor/github.com/rivo/tview/box.go +++ /dev/null @@ -1,412 +0,0 @@ -package tview - -import ( - "github.com/gdamore/tcell" -) - -// Box implements the Primitive interface with an empty background and optional -// elements such as a border and a title. Box itself does not hold any content -// but serves as the superclass of all other primitives. Subclasses add their -// own content, typically (but not necessarily) keeping their content within the -// box's rectangle. -// -// Box provides a number of utility functions available to all primitives. -// -// See https://github.com/rivo/tview/wiki/Box for an example. -type Box struct { - // The position of the rect. - x, y, width, height int - - // The inner rect reserved for the box's content. - innerX, innerY, innerWidth, innerHeight int - - // Border padding. - paddingTop, paddingBottom, paddingLeft, paddingRight int - - // The box's background color. - backgroundColor tcell.Color - - // Whether or not a border is drawn, reducing the box's space for content by - // two in width and height. - border bool - - // The color of the border. - borderColor tcell.Color - - // The style attributes of the border. - borderAttributes tcell.AttrMask - - // The title. Only visible if there is a border, too. - title string - - // The color of the title. - titleColor tcell.Color - - // The alignment of the title. - titleAlign int - - // Provides a way to find out if this box has focus. We always go through - // this interface because it may be overridden by implementing classes. - focus Focusable - - // Whether or not this box has focus. - hasFocus bool - - // An optional capture function which receives a key event and returns the - // event to be forwarded to the primitive's default input handler (nil if - // nothing should be forwarded). - inputCapture func(event *tcell.EventKey) *tcell.EventKey - - // An optional function which is called before the box is drawn. - draw func(screen tcell.Screen, x, y, width, height int) (int, int, int, int) - - // An optional capture function which receives a mouse event and returns the - // event to be forwarded to the primitive's default mouse event handler (at - // least one nil if nothing should be forwarded). - mouseCapture func(action MouseAction, event *tcell.EventMouse) (MouseAction, *tcell.EventMouse) -} - -// NewBox returns a Box without a border. -func NewBox() *Box { - b := &Box{ - width: 15, - height: 10, - innerX: -1, // Mark as uninitialized. - backgroundColor: Styles.PrimitiveBackgroundColor, - borderColor: Styles.BorderColor, - titleColor: Styles.TitleColor, - titleAlign: AlignCenter, - } - b.focus = b - return b -} - -// SetBorderPadding sets the size of the borders around the box content. -func (b *Box) SetBorderPadding(top, bottom, left, right int) *Box { - b.paddingTop, b.paddingBottom, b.paddingLeft, b.paddingRight = top, bottom, left, right - return b -} - -// GetRect returns the current position of the rectangle, x, y, width, and -// height. -func (b *Box) GetRect() (int, int, int, int) { - return b.x, b.y, b.width, b.height -} - -// GetInnerRect returns the position of the inner rectangle (x, y, width, -// height), without the border and without any padding. Width and height values -// will clamp to 0 and thus never be negative. -func (b *Box) GetInnerRect() (int, int, int, int) { - if b.innerX >= 0 { - return b.innerX, b.innerY, b.innerWidth, b.innerHeight - } - x, y, width, height := b.GetRect() - if b.border { - x++ - y++ - width -= 2 - height -= 2 - } - x, y, width, height = x+b.paddingLeft, - y+b.paddingTop, - width-b.paddingLeft-b.paddingRight, - height-b.paddingTop-b.paddingBottom - if width < 0 { - width = 0 - } - if height < 0 { - height = 0 - } - return x, y, width, height -} - -// SetRect sets a new position of the primitive. Note that this has no effect -// if this primitive is part of a layout (e.g. Flex, Grid) or if it was added -// like this: -// -// application.SetRoot(b, true) -func (b *Box) SetRect(x, y, width, height int) { - b.x = x - b.y = y - b.width = width - b.height = height - b.innerX = -1 // Mark inner rect as uninitialized. -} - -// SetDrawFunc sets a callback function which is invoked after the box primitive -// has been drawn. This allows you to add a more individual style to the box -// (and all primitives which extend it). -// -// The function is provided with the box's dimensions (set via SetRect()). It -// must return the box's inner dimensions (x, y, width, height) which will be -// returned by GetInnerRect(), used by descendent primitives to draw their own -// content. -func (b *Box) SetDrawFunc(handler func(screen tcell.Screen, x, y, width, height int) (int, int, int, int)) *Box { - b.draw = handler - return b -} - -// GetDrawFunc returns the callback function which was installed with -// SetDrawFunc() or nil if no such function has been installed. -func (b *Box) GetDrawFunc() func(screen tcell.Screen, x, y, width, height int) (int, int, int, int) { - return b.draw -} - -// WrapInputHandler wraps an input handler (see InputHandler()) with the -// functionality to capture input (see SetInputCapture()) before passing it -// on to the provided (default) input handler. -// -// This is only meant to be used by subclassing primitives. -func (b *Box) WrapInputHandler(inputHandler func(*tcell.EventKey, func(p Primitive))) func(*tcell.EventKey, func(p Primitive)) { - return func(event *tcell.EventKey, setFocus func(p Primitive)) { - if b.inputCapture != nil { - event = b.inputCapture(event) - } - if event != nil && inputHandler != nil { - inputHandler(event, setFocus) - } - } -} - -// InputHandler returns nil. -func (b *Box) InputHandler() func(event *tcell.EventKey, setFocus func(p Primitive)) { - return b.WrapInputHandler(nil) -} - -// SetInputCapture installs a function which captures key events before they are -// forwarded to the primitive's default key event handler. This function can -// then choose to forward that key event (or a different one) to the default -// handler by returning it. If nil is returned, the default handler will not -// be called. -// -// Providing a nil handler will remove a previously existing handler. -// -// Note that this function will not have an effect on primitives composed of -// other primitives, such as Form, Flex, or Grid. Key events are only captured -// by the primitives that have focus (e.g. InputField) and only one primitive -// can have focus at a time. Composing primitives such as Form pass the focus on -// to their contained primitives and thus never receive any key events -// themselves. Therefore, they cannot intercept key events. -func (b *Box) SetInputCapture(capture func(event *tcell.EventKey) *tcell.EventKey) *Box { - b.inputCapture = capture - return b -} - -// GetInputCapture returns the function installed with SetInputCapture() or nil -// if no such function has been installed. -func (b *Box) GetInputCapture() func(event *tcell.EventKey) *tcell.EventKey { - return b.inputCapture -} - -// WrapMouseHandler wraps a mouse event handler (see MouseHandler()) with the -// functionality to capture mouse events (see SetMouseCapture()) before passing -// them on to the provided (default) event handler. -// -// This is only meant to be used by subclassing primitives. -func (b *Box) WrapMouseHandler(mouseHandler func(MouseAction, *tcell.EventMouse, func(p Primitive)) (bool, Primitive)) func(action MouseAction, event *tcell.EventMouse, setFocus func(p Primitive)) (consumed bool, capture Primitive) { - return func(action MouseAction, event *tcell.EventMouse, setFocus func(p Primitive)) (consumed bool, capture Primitive) { - if b.mouseCapture != nil { - action, event = b.mouseCapture(action, event) - } - if event != nil && mouseHandler != nil { - consumed, capture = mouseHandler(action, event, setFocus) - } - return - } -} - -// MouseHandler returns nil. -func (b *Box) MouseHandler() func(action MouseAction, event *tcell.EventMouse, setFocus func(p Primitive)) (consumed bool, capture Primitive) { - return b.WrapMouseHandler(func(action MouseAction, event *tcell.EventMouse, setFocus func(p Primitive)) (consumed bool, capture Primitive) { - if action == MouseLeftClick && b.InRect(event.Position()) { - setFocus(b) - consumed = true - } - return - }) -} - -// SetMouseCapture sets a function which captures mouse events (consisting of -// the original tcell mouse event and the semantic mouse action) before they are -// forwarded to the primitive's default mouse event handler. This function can -// then choose to forward that event (or a different one) by returning it or -// returning a nil mouse event, in which case the default handler will not be -// called. -// -// Providing a nil handler will remove a previously existing handler. -func (b *Box) SetMouseCapture(capture func(action MouseAction, event *tcell.EventMouse) (MouseAction, *tcell.EventMouse)) *Box { - b.mouseCapture = capture - return b -} - -// InRect returns true if the given coordinate is within the bounds of the box's -// rectangle. -func (b *Box) InRect(x, y int) bool { - rectX, rectY, width, height := b.GetRect() - return x >= rectX && x < rectX+width && y >= rectY && y < rectY+height -} - -// GetMouseCapture returns the function installed with SetMouseCapture() or nil -// if no such function has been installed. -func (b *Box) GetMouseCapture() func(action MouseAction, event *tcell.EventMouse) (MouseAction, *tcell.EventMouse) { - return b.mouseCapture -} - -// SetBackgroundColor sets the box's background color. -func (b *Box) SetBackgroundColor(color tcell.Color) *Box { - b.backgroundColor = color - return b -} - -// SetBorder sets the flag indicating whether or not the box should have a -// border. -func (b *Box) SetBorder(show bool) *Box { - b.border = show - return b -} - -// SetBorderColor sets the box's border color. -func (b *Box) SetBorderColor(color tcell.Color) *Box { - b.borderColor = color - return b -} - -// SetBorderAttributes sets the border's style attributes. You can combine -// different attributes using bitmask operations: -// -// box.SetBorderAttributes(tcell.AttrUnderline | tcell.AttrBold) -func (b *Box) SetBorderAttributes(attr tcell.AttrMask) *Box { - b.borderAttributes = attr - return b -} - -// GetBorderAttributes returns the border's style attributes. -func (b *Box) GetBorderAttributes() tcell.AttrMask { - return b.borderAttributes -} - -// GetBorderColor returns the box's border color. -func (b *Box) GetBorderColor() tcell.Color { - return b.borderColor -} - -// GetBackgroundColor returns the box's background color. -func (b *Box) GetBackgroundColor() tcell.Color { - return b.backgroundColor -} - -// SetTitle sets the box's title. -func (b *Box) SetTitle(title string) *Box { - b.title = title - return b -} - -// GetTitle returns the box's current title. -func (b *Box) GetTitle() string { - return b.title -} - -// SetTitleColor sets the box's title color. -func (b *Box) SetTitleColor(color tcell.Color) *Box { - b.titleColor = color - return b -} - -// SetTitleAlign sets the alignment of the title, one of AlignLeft, AlignCenter, -// or AlignRight. -func (b *Box) SetTitleAlign(align int) *Box { - b.titleAlign = align - return b -} - -// Draw draws this primitive onto the screen. -func (b *Box) Draw(screen tcell.Screen) { - // Don't draw anything if there is no space. - if b.width <= 0 || b.height <= 0 { - return - } - - def := tcell.StyleDefault - - // Fill background. - background := def.Background(b.backgroundColor) - if b.backgroundColor != tcell.ColorDefault { - for y := b.y; y < b.y+b.height; y++ { - for x := b.x; x < b.x+b.width; x++ { - screen.SetContent(x, y, ' ', nil, background) - } - } - } - - // Draw border. - if b.border && b.width >= 2 && b.height >= 2 { - border := background.Foreground(b.borderColor) | tcell.Style(b.borderAttributes) - var vertical, horizontal, topLeft, topRight, bottomLeft, bottomRight rune - if b.focus.HasFocus() { - horizontal = Borders.HorizontalFocus - vertical = Borders.VerticalFocus - topLeft = Borders.TopLeftFocus - topRight = Borders.TopRightFocus - bottomLeft = Borders.BottomLeftFocus - bottomRight = Borders.BottomRightFocus - } else { - horizontal = Borders.Horizontal - vertical = Borders.Vertical - topLeft = Borders.TopLeft - topRight = Borders.TopRight - bottomLeft = Borders.BottomLeft - bottomRight = Borders.BottomRight - } - for x := b.x + 1; x < b.x+b.width-1; x++ { - screen.SetContent(x, b.y, horizontal, nil, border) - screen.SetContent(x, b.y+b.height-1, horizontal, nil, border) - } - for y := b.y + 1; y < b.y+b.height-1; y++ { - screen.SetContent(b.x, y, vertical, nil, border) - screen.SetContent(b.x+b.width-1, y, vertical, nil, border) - } - screen.SetContent(b.x, b.y, topLeft, nil, border) - screen.SetContent(b.x+b.width-1, b.y, topRight, nil, border) - screen.SetContent(b.x, b.y+b.height-1, bottomLeft, nil, border) - screen.SetContent(b.x+b.width-1, b.y+b.height-1, bottomRight, nil, border) - - // Draw title. - if b.title != "" && b.width >= 4 { - printed, _ := Print(screen, b.title, b.x+1, b.y, b.width-2, b.titleAlign, b.titleColor) - if len(b.title)-printed > 0 && printed > 0 { - _, _, style, _ := screen.GetContent(b.x+b.width-2, b.y) - fg, _, _ := style.Decompose() - Print(screen, string(SemigraphicsHorizontalEllipsis), b.x+b.width-2, b.y, 1, AlignLeft, fg) - } - } - } - - // Call custom draw function. - if b.draw != nil { - b.innerX, b.innerY, b.innerWidth, b.innerHeight = b.draw(screen, b.x, b.y, b.width, b.height) - } else { - // Remember the inner rect. - b.innerX = -1 - b.innerX, b.innerY, b.innerWidth, b.innerHeight = b.GetInnerRect() - } -} - -// Focus is called when this primitive receives focus. -func (b *Box) Focus(delegate func(p Primitive)) { - b.hasFocus = true -} - -// Blur is called when this primitive loses focus. -func (b *Box) Blur() { - b.hasFocus = false -} - -// HasFocus returns whether or not this primitive has focus. -func (b *Box) HasFocus() bool { - return b.hasFocus -} - -// GetFocusable returns the item's Focusable. -func (b *Box) GetFocusable() Focusable { - return b.focus -} diff --git a/vendor/github.com/rivo/tview/button.go b/vendor/github.com/rivo/tview/button.go deleted file mode 100644 index fd7c2347..00000000 --- a/vendor/github.com/rivo/tview/button.go +++ /dev/null @@ -1,157 +0,0 @@ -package tview - -import ( - "github.com/gdamore/tcell" -) - -// Button is labeled box that triggers an action when selected. -// -// See https://github.com/rivo/tview/wiki/Button for an example. -type Button struct { - *Box - - // The text to be displayed before the input area. - label string - - // The label color. - labelColor tcell.Color - - // The label color when the button is in focus. - labelColorActivated tcell.Color - - // The background color when the button is in focus. - backgroundColorActivated tcell.Color - - // An optional function which is called when the button was selected. - selected func() - - // An optional function which is called when the user leaves the button. A - // key is provided indicating which key was pressed to leave (tab or backtab). - blur func(tcell.Key) -} - -// NewButton returns a new input field. -func NewButton(label string) *Button { - box := NewBox().SetBackgroundColor(Styles.ContrastBackgroundColor) - box.SetRect(0, 0, TaggedStringWidth(label)+4, 1) - return &Button{ - Box: box, - label: label, - labelColor: Styles.PrimaryTextColor, - labelColorActivated: Styles.InverseTextColor, - backgroundColorActivated: Styles.PrimaryTextColor, - } -} - -// SetLabel sets the button text. -func (b *Button) SetLabel(label string) *Button { - b.label = label - return b -} - -// GetLabel returns the button text. -func (b *Button) GetLabel() string { - return b.label -} - -// SetLabelColor sets the color of the button text. -func (b *Button) SetLabelColor(color tcell.Color) *Button { - b.labelColor = color - return b -} - -// SetLabelColorActivated sets the color of the button text when the button is -// in focus. -func (b *Button) SetLabelColorActivated(color tcell.Color) *Button { - b.labelColorActivated = color - return b -} - -// SetBackgroundColorActivated sets the background color of the button text when -// the button is in focus. -func (b *Button) SetBackgroundColorActivated(color tcell.Color) *Button { - b.backgroundColorActivated = color - return b -} - -// SetSelectedFunc sets a handler which is called when the button was selected. -func (b *Button) SetSelectedFunc(handler func()) *Button { - b.selected = handler - return b -} - -// SetBlurFunc sets a handler which is called when the user leaves the button. -// The callback function is provided with the key that was pressed, which is one -// of the following: -// -// - KeyEscape: Leaving the button with no specific direction. -// - KeyTab: Move to the next field. -// - KeyBacktab: Move to the previous field. -func (b *Button) SetBlurFunc(handler func(key tcell.Key)) *Button { - b.blur = handler - return b -} - -// Draw draws this primitive onto the screen. -func (b *Button) Draw(screen tcell.Screen) { - // Draw the box. - borderColor := b.borderColor - backgroundColor := b.backgroundColor - if b.focus.HasFocus() { - b.backgroundColor = b.backgroundColorActivated - b.borderColor = b.labelColorActivated - defer func() { - b.borderColor = borderColor - }() - } - b.Box.Draw(screen) - b.backgroundColor = backgroundColor - - // Draw label. - x, y, width, height := b.GetInnerRect() - if width > 0 && height > 0 { - y = y + height/2 - labelColor := b.labelColor - if b.focus.HasFocus() { - labelColor = b.labelColorActivated - } - Print(screen, b.label, x, y, width, AlignCenter, labelColor) - } -} - -// InputHandler returns the handler for this primitive. -func (b *Button) InputHandler() func(event *tcell.EventKey, setFocus func(p Primitive)) { - return b.WrapInputHandler(func(event *tcell.EventKey, setFocus func(p Primitive)) { - // Process key event. - switch key := event.Key(); key { - case tcell.KeyEnter: // Selected. - if b.selected != nil { - b.selected() - } - case tcell.KeyBacktab, tcell.KeyTab, tcell.KeyEscape: // Leave. No action. - if b.blur != nil { - b.blur(key) - } - } - }) -} - -// MouseHandler returns the mouse handler for this primitive. -func (b *Button) MouseHandler() func(action MouseAction, event *tcell.EventMouse, setFocus func(p Primitive)) (consumed bool, capture Primitive) { - return b.WrapMouseHandler(func(action MouseAction, event *tcell.EventMouse, setFocus func(p Primitive)) (consumed bool, capture Primitive) { - if !b.InRect(event.Position()) { - return false, nil - } - - // Process mouse event. - if action == MouseLeftClick { - setFocus(b) - if b.selected != nil { - b.selected() - } - consumed = true - } - - return - }) -} diff --git a/vendor/github.com/rivo/tview/checkbox.go b/vendor/github.com/rivo/tview/checkbox.go deleted file mode 100644 index 7c4b5052..00000000 --- a/vendor/github.com/rivo/tview/checkbox.go +++ /dev/null @@ -1,226 +0,0 @@ -package tview - -import ( - "github.com/gdamore/tcell" -) - -// Checkbox implements a simple box for boolean values which can be checked and -// unchecked. -// -// See https://github.com/rivo/tview/wiki/Checkbox for an example. -type Checkbox struct { - *Box - - // Whether or not this box is checked. - checked bool - - // The text to be displayed before the input area. - label string - - // The screen width of the label area. A value of 0 means use the width of - // the label text. - labelWidth int - - // The label color. - labelColor tcell.Color - - // The background color of the input area. - fieldBackgroundColor tcell.Color - - // The text color of the input area. - fieldTextColor tcell.Color - - // An optional function which is called when the user changes the checked - // state of this checkbox. - changed func(checked bool) - - // An optional function which is called when the user indicated that they - // are done entering text. The key which was pressed is provided (tab, - // shift-tab, or escape). - done func(tcell.Key) - - // A callback function set by the Form class and called when the user leaves - // this form item. - finished func(tcell.Key) -} - -// NewCheckbox returns a new input field. -func NewCheckbox() *Checkbox { - return &Checkbox{ - Box: NewBox(), - labelColor: Styles.SecondaryTextColor, - fieldBackgroundColor: Styles.ContrastBackgroundColor, - fieldTextColor: Styles.PrimaryTextColor, - } -} - -// SetChecked sets the state of the checkbox. -func (c *Checkbox) SetChecked(checked bool) *Checkbox { - c.checked = checked - return c -} - -// IsChecked returns whether or not the box is checked. -func (c *Checkbox) IsChecked() bool { - return c.checked -} - -// SetLabel sets the text to be displayed before the input area. -func (c *Checkbox) SetLabel(label string) *Checkbox { - c.label = label - return c -} - -// GetLabel returns the text to be displayed before the input area. -func (c *Checkbox) GetLabel() string { - return c.label -} - -// SetLabelWidth sets the screen width of the label. A value of 0 will cause the -// primitive to use the width of the label string. -func (c *Checkbox) SetLabelWidth(width int) *Checkbox { - c.labelWidth = width - return c -} - -// SetLabelColor sets the color of the label. -func (c *Checkbox) SetLabelColor(color tcell.Color) *Checkbox { - c.labelColor = color - return c -} - -// SetFieldBackgroundColor sets the background color of the input area. -func (c *Checkbox) SetFieldBackgroundColor(color tcell.Color) *Checkbox { - c.fieldBackgroundColor = color - return c -} - -// SetFieldTextColor sets the text color of the input area. -func (c *Checkbox) SetFieldTextColor(color tcell.Color) *Checkbox { - c.fieldTextColor = color - return c -} - -// SetFormAttributes sets attributes shared by all form items. -func (c *Checkbox) SetFormAttributes(labelWidth int, labelColor, bgColor, fieldTextColor, fieldBgColor tcell.Color) FormItem { - c.labelWidth = labelWidth - c.labelColor = labelColor - c.backgroundColor = bgColor - c.fieldTextColor = fieldTextColor - c.fieldBackgroundColor = fieldBgColor - return c -} - -// GetFieldWidth returns this primitive's field width. -func (c *Checkbox) GetFieldWidth() int { - return 1 -} - -// SetChangedFunc sets a handler which is called when the checked state of this -// checkbox was changed by the user. The handler function receives the new -// state. -func (c *Checkbox) SetChangedFunc(handler func(checked bool)) *Checkbox { - c.changed = handler - return c -} - -// SetDoneFunc sets a handler which is called when the user is done using the -// checkbox. The callback function is provided with the key that was pressed, -// which is one of the following: -// -// - KeyEscape: Abort text input. -// - KeyTab: Move to the next field. -// - KeyBacktab: Move to the previous field. -func (c *Checkbox) SetDoneFunc(handler func(key tcell.Key)) *Checkbox { - c.done = handler - return c -} - -// SetFinishedFunc sets a callback invoked when the user leaves this form item. -func (c *Checkbox) SetFinishedFunc(handler func(key tcell.Key)) FormItem { - c.finished = handler - return c -} - -// Draw draws this primitive onto the screen. -func (c *Checkbox) Draw(screen tcell.Screen) { - c.Box.Draw(screen) - - // Prepare - x, y, width, height := c.GetInnerRect() - rightLimit := x + width - if height < 1 || rightLimit <= x { - return - } - - // Draw label. - if c.labelWidth > 0 { - labelWidth := c.labelWidth - if labelWidth > rightLimit-x { - labelWidth = rightLimit - x - } - Print(screen, c.label, x, y, labelWidth, AlignLeft, c.labelColor) - x += labelWidth - } else { - _, drawnWidth := Print(screen, c.label, x, y, rightLimit-x, AlignLeft, c.labelColor) - x += drawnWidth - } - - // Draw checkbox. - fieldStyle := tcell.StyleDefault.Background(c.fieldBackgroundColor).Foreground(c.fieldTextColor) - if c.focus.HasFocus() { - fieldStyle = fieldStyle.Background(c.fieldTextColor).Foreground(c.fieldBackgroundColor) - } - checkedRune := 'X' - if !c.checked { - checkedRune = ' ' - } - screen.SetContent(x, y, checkedRune, nil, fieldStyle) -} - -// InputHandler returns the handler for this primitive. -func (c *Checkbox) InputHandler() func(event *tcell.EventKey, setFocus func(p Primitive)) { - return c.WrapInputHandler(func(event *tcell.EventKey, setFocus func(p Primitive)) { - // Process key event. - switch key := event.Key(); key { - case tcell.KeyRune, tcell.KeyEnter: // Check. - if key == tcell.KeyRune && event.Rune() != ' ' { - break - } - c.checked = !c.checked - if c.changed != nil { - c.changed(c.checked) - } - case tcell.KeyTab, tcell.KeyBacktab, tcell.KeyEscape: // We're done. - if c.done != nil { - c.done(key) - } - if c.finished != nil { - c.finished(key) - } - } - }) -} - -// MouseHandler returns the mouse handler for this primitive. -func (c *Checkbox) MouseHandler() func(action MouseAction, event *tcell.EventMouse, setFocus func(p Primitive)) (consumed bool, capture Primitive) { - return c.WrapMouseHandler(func(action MouseAction, event *tcell.EventMouse, setFocus func(p Primitive)) (consumed bool, capture Primitive) { - x, y := event.Position() - _, rectY, _, _ := c.GetInnerRect() - if !c.InRect(x, y) { - return false, nil - } - - // Process mouse event. - if action == MouseLeftClick && y == rectY { - setFocus(c) - c.checked = !c.checked - if c.changed != nil { - c.changed(c.checked) - } - consumed = true - } - - return - }) -} diff --git a/vendor/github.com/rivo/tview/doc.go b/vendor/github.com/rivo/tview/doc.go deleted file mode 100644 index 4bceea2a..00000000 --- a/vendor/github.com/rivo/tview/doc.go +++ /dev/null @@ -1,180 +0,0 @@ -/* -Package tview implements rich widgets for terminal based user interfaces. The -widgets provided with this package are useful for data exploration and data -entry. - -Widgets - -The package implements the following widgets: - - - TextView: A scrollable window that display multi-colored text. Text may also - be highlighted. - - Table: A scrollable display of tabular data. Table cells, rows, or columns - may also be highlighted. - - TreeView: A scrollable display for hierarchical data. Tree nodes can be - highlighted, collapsed, expanded, and more. - - List: A navigable text list with optional keyboard shortcuts. - - InputField: One-line input fields to enter text. - - DropDown: Drop-down selection fields. - - Checkbox: Selectable checkbox for boolean values. - - Button: Buttons which get activated when the user selects them. - - Form: Forms composed of input fields, drop down selections, checkboxes, and - buttons. - - Modal: A centered window with a text message and one or more buttons. - - Grid: A grid based layout manager. - - Flex: A Flexbox based layout manager. - - Pages: A page based layout manager. - -The package also provides Application which is used to poll the event queue and -draw widgets on screen. - -Hello World - -The following is a very basic example showing a box with the title "Hello, -world!": - - package main - - import ( - "github.com/rivo/tview" - ) - - func main() { - box := tview.NewBox().SetBorder(true).SetTitle("Hello, world!") - if err := tview.NewApplication().SetRoot(box, true).Run(); err != nil { - panic(err) - } - } - -First, we create a box primitive with a border and a title. Then we create an -application, set the box as its root primitive, and run the event loop. The -application exits when the application's Stop() function is called or when -Ctrl-C is pressed. - -If we have a primitive which consumes key presses, we call the application's -SetFocus() function to redirect all key presses to that primitive. Most -primitives then offer ways to install handlers that allow you to react to any -actions performed on them. - -More Demos - -You will find more demos in the "demos" subdirectory. It also contains a -presentation (written using tview) which gives an overview of the different -widgets and how they can be used. - -Colors - -Throughout this package, colors are specified using the tcell.Color type. -Functions such as tcell.GetColor(), tcell.NewHexColor(), and tcell.NewRGBColor() -can be used to create colors from W3C color names or RGB values. - -Almost all strings which are displayed can contain color tags. Color tags are -W3C color names or six hexadecimal digits following a hash tag, wrapped in -square brackets. Examples: - - This is a [red]warning[white]! - The sky is [#8080ff]blue[#ffffff]. - -A color tag changes the color of the characters following that color tag. This -applies to almost everything from box titles, list text, form item labels, to -table cells. In a TextView, this functionality has to be switched on explicitly. -See the TextView documentation for more information. - -Color tags may contain not just the foreground (text) color but also the -background color and additional flags. In fact, the full definition of a color -tag is as follows: - - [::] - -Each of the three fields can be left blank and trailing fields can be omitted. -(Empty square brackets "[]", however, are not considered color tags.) Colors -that are not specified will be left unchanged. A field with just a dash ("-") -means "reset to default". - -You can specify the following flags (some flags may not be supported by your -terminal): - - l: blink - b: bold - d: dim - r: reverse (switch foreground and background color) - u: underline - -Examples: - - [yellow]Yellow text - [yellow:red]Yellow text on red background - [:red]Red background, text color unchanged - [yellow::u]Yellow text underlined - [::bl]Bold, blinking text - [::-]Colors unchanged, flags reset - [-]Reset foreground color - [-:-:-]Reset everything - [:]No effect - []Not a valid color tag, will print square brackets as they are - -In the rare event that you want to display a string such as "[red]" or -"[#00ff1a]" without applying its effect, you need to put an opening square -bracket before the closing square bracket. Note that the text inside the -brackets will be matched less strictly than region or colors tags. I.e. any -character that may be used in color or region tags will be recognized. Examples: - - [red[] will be output as [red] - ["123"[] will be output as ["123"] - [#6aff00[[] will be output as [#6aff00[] - [a#"[[[] will be output as [a#"[[] - [] will be output as [] (see color tags above) - [[] will be output as [[] (not an escaped tag) - -You can use the Escape() function to insert brackets automatically where needed. - -Styles - -When primitives are instantiated, they are initialized with colors taken from -the global Styles variable. You may change this variable to adapt the look and -feel of the primitives to your preferred style. - -Unicode Support - -This package supports unicode characters including wide characters. - -Concurrency - -Many functions in this package are not thread-safe. For many applications, this -may not be an issue: If your code makes changes in response to key events, it -will execute in the main goroutine and thus will not cause any race conditions. - -If you access your primitives from other goroutines, however, you will need to -synchronize execution. The easiest way to do this is to call -Application.QueueUpdate() or Application.QueueUpdateDraw() (see the function -documentation for details): - - go func() { - app.QueueUpdateDraw(func() { - table.SetCellSimple(0, 0, "Foo bar") - }) - }() - -One exception to this is the io.Writer interface implemented by TextView. You -can safely write to a TextView from any goroutine. See the TextView -documentation for details. - -You can also call Application.Draw() from any goroutine without having to wrap -it in QueueUpdate(). And, as mentioned above, key event callbacks are executed -in the main goroutine and thus should not use QueueUpdate() as that may lead to -deadlocks. - -Type Hierarchy - -All widgets listed above contain the Box type. All of Box's functions are -therefore available for all widgets, too. - -All widgets also implement the Primitive interface. There is also the Focusable -interface which is used to override functions in subclassing types. - -The tview package is based on https://github.com/gdamore/tcell. It uses types -and constants from that package (e.g. colors and keyboard values). - -This package does not process mouse input (yet). -*/ -package tview diff --git a/vendor/github.com/rivo/tview/dropdown.go b/vendor/github.com/rivo/tview/dropdown.go deleted file mode 100644 index 89d50c13..00000000 --- a/vendor/github.com/rivo/tview/dropdown.go +++ /dev/null @@ -1,547 +0,0 @@ -package tview - -import ( - "strings" - - "github.com/gdamore/tcell" -) - -// dropDownOption is one option that can be selected in a drop-down primitive. -type dropDownOption struct { - Text string // The text to be displayed in the drop-down. - Selected func() // The (optional) callback for when this option was selected. -} - -// DropDown implements a selection widget whose options become visible in a -// drop-down list when activated. -// -// See https://github.com/rivo/tview/wiki/DropDown for an example. -type DropDown struct { - *Box - - // The options from which the user can choose. - options []*dropDownOption - - // Strings to be placed before and after each drop-down option. - optionPrefix, optionSuffix string - - // The index of the currently selected option. Negative if no option is - // currently selected. - currentOption int - - // Strings to be placed beefore and after the current option. - currentOptionPrefix, currentOptionSuffix string - - // The text to be displayed when no option has yet been selected. - noSelection string - - // Set to true if the options are visible and selectable. - open bool - - // The runes typed so far to directly access one of the list items. - prefix string - - // The list element for the options. - list *List - - // The text to be displayed before the input area. - label string - - // The label color. - labelColor tcell.Color - - // The background color of the input area. - fieldBackgroundColor tcell.Color - - // The text color of the input area. - fieldTextColor tcell.Color - - // The color for prefixes. - prefixTextColor tcell.Color - - // The screen width of the label area. A value of 0 means use the width of - // the label text. - labelWidth int - - // The screen width of the input area. A value of 0 means extend as much as - // possible. - fieldWidth int - - // An optional function which is called when the user indicated that they - // are done selecting options. The key which was pressed is provided (tab, - // shift-tab, or escape). - done func(tcell.Key) - - // A callback function set by the Form class and called when the user leaves - // this form item. - finished func(tcell.Key) - - // A callback function which is called when the user changes the drop-down's - // selection. - selected func(text string, index int) - - dragging bool // Set to true when mouse dragging is in progress. -} - -// NewDropDown returns a new drop-down. -func NewDropDown() *DropDown { - list := NewList() - list.ShowSecondaryText(false). - SetMainTextColor(Styles.PrimitiveBackgroundColor). - SetSelectedTextColor(Styles.PrimitiveBackgroundColor). - SetSelectedBackgroundColor(Styles.PrimaryTextColor). - SetHighlightFullLine(true). - SetBackgroundColor(Styles.MoreContrastBackgroundColor) - - d := &DropDown{ - Box: NewBox(), - currentOption: -1, - list: list, - labelColor: Styles.SecondaryTextColor, - fieldBackgroundColor: Styles.ContrastBackgroundColor, - fieldTextColor: Styles.PrimaryTextColor, - prefixTextColor: Styles.ContrastSecondaryTextColor, - } - - d.focus = d - - return d -} - -// SetCurrentOption sets the index of the currently selected option. This may -// be a negative value to indicate that no option is currently selected. Calling -// this function will also trigger the "selected" callback (if there is one). -func (d *DropDown) SetCurrentOption(index int) *DropDown { - if index >= 0 && index < len(d.options) { - d.currentOption = index - d.list.SetCurrentItem(index) - if d.selected != nil { - d.selected(d.options[index].Text, index) - } - if d.options[index].Selected != nil { - d.options[index].Selected() - } - } else { - d.currentOption = -1 - d.list.SetCurrentItem(0) // Set to 0 because -1 means "last item". - if d.selected != nil { - d.selected("", -1) - } - } - return d -} - -// GetCurrentOption returns the index of the currently selected option as well -// as its text. If no option was selected, -1 and an empty string is returned. -func (d *DropDown) GetCurrentOption() (int, string) { - var text string - if d.currentOption >= 0 && d.currentOption < len(d.options) { - text = d.options[d.currentOption].Text - } - return d.currentOption, text -} - -// SetTextOptions sets the text to be placed before and after each drop-down -// option (prefix/suffix), the text placed before and after the currently -// selected option (currentPrefix/currentSuffix) as well as the text to be -// displayed when no option is currently selected. Per default, all of these -// strings are empty. -func (d *DropDown) SetTextOptions(prefix, suffix, currentPrefix, currentSuffix, noSelection string) *DropDown { - d.currentOptionPrefix = currentPrefix - d.currentOptionSuffix = currentSuffix - d.noSelection = noSelection - d.optionPrefix = prefix - d.optionSuffix = suffix - for index := 0; index < d.list.GetItemCount(); index++ { - d.list.SetItemText(index, prefix+d.options[index].Text+suffix, "") - } - return d -} - -// SetLabel sets the text to be displayed before the input area. -func (d *DropDown) SetLabel(label string) *DropDown { - d.label = label - return d -} - -// GetLabel returns the text to be displayed before the input area. -func (d *DropDown) GetLabel() string { - return d.label -} - -// SetLabelWidth sets the screen width of the label. A value of 0 will cause the -// primitive to use the width of the label string. -func (d *DropDown) SetLabelWidth(width int) *DropDown { - d.labelWidth = width - return d -} - -// SetLabelColor sets the color of the label. -func (d *DropDown) SetLabelColor(color tcell.Color) *DropDown { - d.labelColor = color - return d -} - -// SetFieldBackgroundColor sets the background color of the options area. -func (d *DropDown) SetFieldBackgroundColor(color tcell.Color) *DropDown { - d.fieldBackgroundColor = color - return d -} - -// SetFieldTextColor sets the text color of the options area. -func (d *DropDown) SetFieldTextColor(color tcell.Color) *DropDown { - d.fieldTextColor = color - return d -} - -// SetPrefixTextColor sets the color of the prefix string. The prefix string is -// shown when the user starts typing text, which directly selects the first -// option that starts with the typed string. -func (d *DropDown) SetPrefixTextColor(color tcell.Color) *DropDown { - d.prefixTextColor = color - return d -} - -// SetFormAttributes sets attributes shared by all form items. -func (d *DropDown) SetFormAttributes(labelWidth int, labelColor, bgColor, fieldTextColor, fieldBgColor tcell.Color) FormItem { - d.labelWidth = labelWidth - d.labelColor = labelColor - d.backgroundColor = bgColor - d.fieldTextColor = fieldTextColor - d.fieldBackgroundColor = fieldBgColor - return d -} - -// SetFieldWidth sets the screen width of the options area. A value of 0 means -// extend to as long as the longest option text. -func (d *DropDown) SetFieldWidth(width int) *DropDown { - d.fieldWidth = width - return d -} - -// GetFieldWidth returns this primitive's field screen width. -func (d *DropDown) GetFieldWidth() int { - if d.fieldWidth > 0 { - return d.fieldWidth - } - fieldWidth := 0 - for _, option := range d.options { - width := TaggedStringWidth(option.Text) - if width > fieldWidth { - fieldWidth = width - } - } - return fieldWidth -} - -// AddOption adds a new selectable option to this drop-down. The "selected" -// callback is called when this option was selected. It may be nil. -func (d *DropDown) AddOption(text string, selected func()) *DropDown { - d.options = append(d.options, &dropDownOption{Text: text, Selected: selected}) - d.list.AddItem(d.optionPrefix+text+d.optionSuffix, "", 0, nil) - return d -} - -// SetOptions replaces all current options with the ones provided and installs -// one callback function which is called when one of the options is selected. -// It will be called with the option's text and its index into the options -// slice. The "selected" parameter may be nil. -func (d *DropDown) SetOptions(texts []string, selected func(text string, index int)) *DropDown { - d.list.Clear() - d.options = nil - for index, text := range texts { - func(t string, i int) { - d.AddOption(text, nil) - }(text, index) - } - d.selected = selected - return d -} - -// SetSelectedFunc sets a handler which is called when the user changes the -// drop-down's option. This handler will be called in addition and prior to -// an option's optional individual handler. The handler is provided with the -// selected option's text and index. If "no option" was selected, these values -// are an empty string and -1. -func (d *DropDown) SetSelectedFunc(handler func(text string, index int)) *DropDown { - d.selected = handler - return d -} - -// SetDoneFunc sets a handler which is called when the user is done selecting -// options. The callback function is provided with the key that was pressed, -// which is one of the following: -// -// - KeyEscape: Abort selection. -// - KeyTab: Move to the next field. -// - KeyBacktab: Move to the previous field. -func (d *DropDown) SetDoneFunc(handler func(key tcell.Key)) *DropDown { - d.done = handler - return d -} - -// SetFinishedFunc sets a callback invoked when the user leaves this form item. -func (d *DropDown) SetFinishedFunc(handler func(key tcell.Key)) FormItem { - d.finished = handler - return d -} - -// Draw draws this primitive onto the screen. -func (d *DropDown) Draw(screen tcell.Screen) { - d.Box.Draw(screen) - - // Prepare. - x, y, width, height := d.GetInnerRect() - rightLimit := x + width - if height < 1 || rightLimit <= x { - return - } - - // Draw label. - if d.labelWidth > 0 { - labelWidth := d.labelWidth - if labelWidth > rightLimit-x { - labelWidth = rightLimit - x - } - Print(screen, d.label, x, y, labelWidth, AlignLeft, d.labelColor) - x += labelWidth - } else { - _, drawnWidth := Print(screen, d.label, x, y, rightLimit-x, AlignLeft, d.labelColor) - x += drawnWidth - } - - // What's the longest option text? - maxWidth := 0 - optionWrapWidth := TaggedStringWidth(d.optionPrefix + d.optionSuffix) - for _, option := range d.options { - strWidth := TaggedStringWidth(option.Text) + optionWrapWidth - if strWidth > maxWidth { - maxWidth = strWidth - } - } - - // Draw selection area. - fieldWidth := d.fieldWidth - if fieldWidth == 0 { - fieldWidth = maxWidth - if d.currentOption < 0 { - noSelectionWidth := TaggedStringWidth(d.noSelection) - if noSelectionWidth > fieldWidth { - fieldWidth = noSelectionWidth - } - } else if d.currentOption < len(d.options) { - currentOptionWidth := TaggedStringWidth(d.currentOptionPrefix + d.options[d.currentOption].Text + d.currentOptionSuffix) - if currentOptionWidth > fieldWidth { - fieldWidth = currentOptionWidth - } - } - } - if rightLimit-x < fieldWidth { - fieldWidth = rightLimit - x - } - fieldStyle := tcell.StyleDefault.Background(d.fieldBackgroundColor) - if d.GetFocusable().HasFocus() && !d.open { - fieldStyle = fieldStyle.Background(d.fieldTextColor) - } - for index := 0; index < fieldWidth; index++ { - screen.SetContent(x+index, y, ' ', nil, fieldStyle) - } - - // Draw selected text. - if d.open && len(d.prefix) > 0 { - // Show the prefix. - currentOptionPrefixWidth := TaggedStringWidth(d.currentOptionPrefix) - prefixWidth := stringWidth(d.prefix) - listItemText := d.options[d.list.GetCurrentItem()].Text - Print(screen, d.currentOptionPrefix, x, y, fieldWidth, AlignLeft, d.fieldTextColor) - Print(screen, d.prefix, x+currentOptionPrefixWidth, y, fieldWidth-currentOptionPrefixWidth, AlignLeft, d.prefixTextColor) - if len(d.prefix) < len(listItemText) { - Print(screen, listItemText[len(d.prefix):]+d.currentOptionSuffix, x+prefixWidth+currentOptionPrefixWidth, y, fieldWidth-prefixWidth-currentOptionPrefixWidth, AlignLeft, d.fieldTextColor) - } - } else { - color := d.fieldTextColor - text := d.noSelection - if d.currentOption >= 0 && d.currentOption < len(d.options) { - text = d.currentOptionPrefix + d.options[d.currentOption].Text + d.currentOptionSuffix - } - // Just show the current selection. - if d.GetFocusable().HasFocus() && !d.open { - color = d.fieldBackgroundColor - } - Print(screen, text, x, y, fieldWidth, AlignLeft, color) - } - - // Draw options list. - if d.HasFocus() && d.open { - // We prefer to drop down but if there is no space, maybe drop up? - lx := x - ly := y + 1 - lwidth := maxWidth - lheight := len(d.options) - _, sheight := screen.Size() - if ly+lheight >= sheight && ly-2 > lheight-ly { - ly = y - lheight - if ly < 0 { - ly = 0 - } - } - if ly+lheight >= sheight { - lheight = sheight - ly - } - d.list.SetRect(lx, ly, lwidth, lheight) - d.list.Draw(screen) - } -} - -// InputHandler returns the handler for this primitive. -func (d *DropDown) InputHandler() func(event *tcell.EventKey, setFocus func(p Primitive)) { - return d.WrapInputHandler(func(event *tcell.EventKey, setFocus func(p Primitive)) { - // Process key event. - switch key := event.Key(); key { - case tcell.KeyEnter, tcell.KeyRune, tcell.KeyDown: - d.prefix = "" - - // If the first key was a letter already, it becomes part of the prefix. - if r := event.Rune(); key == tcell.KeyRune && r != ' ' { - d.prefix += string(r) - d.evalPrefix() - } - - d.openList(setFocus) - case tcell.KeyEscape, tcell.KeyTab, tcell.KeyBacktab: - if d.done != nil { - d.done(key) - } - if d.finished != nil { - d.finished(key) - } - } - }) -} - -// evalPrefix selects an item in the drop-down list based on the current prefix. -func (d *DropDown) evalPrefix() { - if len(d.prefix) > 0 { - for index, option := range d.options { - if strings.HasPrefix(strings.ToLower(option.Text), d.prefix) { - d.list.SetCurrentItem(index) - return - } - } - - // Prefix does not match any item. Remove last rune. - r := []rune(d.prefix) - d.prefix = string(r[:len(r)-1]) - } -} - -// openList hands control over to the embedded List primitive. -func (d *DropDown) openList(setFocus func(Primitive)) { - d.open = true - optionBefore := d.currentOption - - d.list.SetSelectedFunc(func(index int, mainText, secondaryText string, shortcut rune) { - if d.dragging { - return // If we're dragging the mouse, we don't want to trigger any events. - } - - // An option was selected. Close the list again. - d.currentOption = index - d.closeList(setFocus) - - // Trigger "selected" event. - if d.selected != nil { - d.selected(d.options[d.currentOption].Text, d.currentOption) - } - if d.options[d.currentOption].Selected != nil { - d.options[d.currentOption].Selected() - } - }).SetInputCapture(func(event *tcell.EventKey) *tcell.EventKey { - if event.Key() == tcell.KeyRune { - d.prefix += string(event.Rune()) - d.evalPrefix() - } else if event.Key() == tcell.KeyBackspace || event.Key() == tcell.KeyBackspace2 { - if len(d.prefix) > 0 { - r := []rune(d.prefix) - d.prefix = string(r[:len(r)-1]) - } - d.evalPrefix() - } else if event.Key() == tcell.KeyEscape { - d.currentOption = optionBefore - d.closeList(setFocus) - } else { - d.prefix = "" - } - - return event - }) - - setFocus(d.list) -} - -// closeList closes the embedded List element by hiding it and removing focus -// from it. -func (d *DropDown) closeList(setFocus func(Primitive)) { - d.open = false - if d.list.HasFocus() { - setFocus(d) - } -} - -// Focus is called by the application when the primitive receives focus. -func (d *DropDown) Focus(delegate func(p Primitive)) { - d.Box.Focus(delegate) - if d.open { - delegate(d.list) - } -} - -// HasFocus returns whether or not this primitive has focus. -func (d *DropDown) HasFocus() bool { - if d.open { - return d.list.HasFocus() - } - return d.hasFocus -} - -// MouseHandler returns the mouse handler for this primitive. -func (d *DropDown) MouseHandler() func(action MouseAction, event *tcell.EventMouse, setFocus func(p Primitive)) (consumed bool, capture Primitive) { - return d.WrapMouseHandler(func(action MouseAction, event *tcell.EventMouse, setFocus func(p Primitive)) (consumed bool, capture Primitive) { - // Was the mouse event in the drop-down box itself (or on its label)? - x, y := event.Position() - _, rectY, _, _ := d.GetInnerRect() - inRect := y == rectY - if !d.open && !inRect { - return d.InRect(x, y), nil // No, and it's not expanded either. Ignore. - } - - // Handle dragging. Clicks are implicitly handled by this logic. - switch action { - case MouseLeftDown: - consumed = d.open || inRect - capture = d - if !d.open { - d.openList(setFocus) - d.dragging = true - } else if consumed, _ := d.list.MouseHandler()(MouseLeftClick, event, setFocus); !consumed { - d.closeList(setFocus) // Close drop-down if clicked outside of it. - } - case MouseMove: - if d.dragging { - // We pretend it's a left click so we can see the selection during - // dragging. Because we don't act upon it, it's not a problem. - d.list.MouseHandler()(MouseLeftClick, event, setFocus) - consumed = true - capture = d - } - case MouseLeftUp: - if d.dragging { - d.dragging = false - d.list.MouseHandler()(MouseLeftClick, event, setFocus) - consumed = true - } - } - - return - }) -} diff --git a/vendor/github.com/rivo/tview/flex.go b/vendor/github.com/rivo/tview/flex.go deleted file mode 100644 index 3343e863..00000000 --- a/vendor/github.com/rivo/tview/flex.go +++ /dev/null @@ -1,225 +0,0 @@ -package tview - -import ( - "github.com/gdamore/tcell" -) - -// Configuration values. -const ( - FlexRow = iota - FlexColumn -) - -// flexItem holds layout options for one item. -type flexItem struct { - Item Primitive // The item to be positioned. May be nil for an empty item. - FixedSize int // The item's fixed size which may not be changed, 0 if it has no fixed size. - Proportion int // The item's proportion. - Focus bool // Whether or not this item attracts the layout's focus. -} - -// Flex is a basic implementation of the Flexbox layout. The contained -// primitives are arranged horizontally or vertically. The way they are -// distributed along that dimension depends on their layout settings, which is -// either a fixed length or a proportional length. See AddItem() for details. -// -// See https://github.com/rivo/tview/wiki/Flex for an example. -type Flex struct { - *Box - - // The items to be positioned. - items []*flexItem - - // FlexRow or FlexColumn. - direction int - - // If set to true, Flex will use the entire screen as its available space - // instead its box dimensions. - fullScreen bool -} - -// NewFlex returns a new flexbox layout container with no primitives and its -// direction set to FlexColumn. To add primitives to this layout, see AddItem(). -// To change the direction, see SetDirection(). -// -// Note that Box, the superclass of Flex, will have its background color set to -// transparent so that any nil flex items will leave their background unchanged. -// To clear a Flex's background before any items are drawn, set it to the -// desired color: -// -// flex.SetBackgroundColor(tview.Styles.PrimitiveBackgroundColor) -func NewFlex() *Flex { - f := &Flex{ - Box: NewBox().SetBackgroundColor(tcell.ColorDefault), - direction: FlexColumn, - } - f.focus = f - return f -} - -// SetDirection sets the direction in which the contained primitives are -// distributed. This can be either FlexColumn (default) or FlexRow. -func (f *Flex) SetDirection(direction int) *Flex { - f.direction = direction - return f -} - -// SetFullScreen sets the flag which, when true, causes the flex layout to use -// the entire screen space instead of whatever size it is currently assigned to. -func (f *Flex) SetFullScreen(fullScreen bool) *Flex { - f.fullScreen = fullScreen - return f -} - -// AddItem adds a new item to the container. The "fixedSize" argument is a width -// or height that may not be changed by the layout algorithm. A value of 0 means -// that its size is flexible and may be changed. The "proportion" argument -// defines the relative size of the item compared to other flexible-size items. -// For example, items with a proportion of 2 will be twice as large as items -// with a proportion of 1. The proportion must be at least 1 if fixedSize == 0 -// (ignored otherwise). -// -// If "focus" is set to true, the item will receive focus when the Flex -// primitive receives focus. If multiple items have the "focus" flag set to -// true, the first one will receive focus. -// -// You can provide a nil value for the primitive. This will still consume screen -// space but nothing will be drawn. -func (f *Flex) AddItem(item Primitive, fixedSize, proportion int, focus bool) *Flex { - f.items = append(f.items, &flexItem{Item: item, FixedSize: fixedSize, Proportion: proportion, Focus: focus}) - return f -} - -// RemoveItem removes all items for the given primitive from the container, -// keeping the order of the remaining items intact. -func (f *Flex) RemoveItem(p Primitive) *Flex { - for index := len(f.items) - 1; index >= 0; index-- { - if f.items[index].Item == p { - f.items = append(f.items[:index], f.items[index+1:]...) - } - } - return f -} - -// Clear removes all items from the container. -func (f *Flex) Clear() *Flex { - f.items = nil - return f -} - -// ResizeItem sets a new size for the item(s) with the given primitive. If there -// are multiple Flex items with the same primitive, they will all receive the -// same size. For details regarding the size parameters, see AddItem(). -func (f *Flex) ResizeItem(p Primitive, fixedSize, proportion int) *Flex { - for _, item := range f.items { - if item.Item == p { - item.FixedSize = fixedSize - item.Proportion = proportion - } - } - return f -} - -// Draw draws this primitive onto the screen. -func (f *Flex) Draw(screen tcell.Screen) { - f.Box.Draw(screen) - - // Calculate size and position of the items. - - // Do we use the entire screen? - if f.fullScreen { - width, height := screen.Size() - f.SetRect(0, 0, width, height) - } - - // How much space can we distribute? - x, y, width, height := f.GetInnerRect() - var proportionSum int - distSize := width - if f.direction == FlexRow { - distSize = height - } - for _, item := range f.items { - if item.FixedSize > 0 { - distSize -= item.FixedSize - } else { - proportionSum += item.Proportion - } - } - - // Calculate positions and draw items. - pos := x - if f.direction == FlexRow { - pos = y - } - for _, item := range f.items { - size := item.FixedSize - if size <= 0 { - if proportionSum > 0 { - size = distSize * item.Proportion / proportionSum - distSize -= size - proportionSum -= item.Proportion - } else { - size = 0 - } - } - if item.Item != nil { - if f.direction == FlexColumn { - item.Item.SetRect(pos, y, size, height) - } else { - item.Item.SetRect(x, pos, width, size) - } - } - pos += size - - if item.Item != nil { - if item.Item.GetFocusable().HasFocus() { - defer item.Item.Draw(screen) - } else { - item.Item.Draw(screen) - } - } - } -} - -// Focus is called when this primitive receives focus. -func (f *Flex) Focus(delegate func(p Primitive)) { - for _, item := range f.items { - if item.Item != nil && item.Focus { - delegate(item.Item) - return - } - } -} - -// HasFocus returns whether or not this primitive has focus. -func (f *Flex) HasFocus() bool { - for _, item := range f.items { - if item.Item != nil && item.Item.GetFocusable().HasFocus() { - return true - } - } - return false -} - -// MouseHandler returns the mouse handler for this primitive. -func (f *Flex) MouseHandler() func(action MouseAction, event *tcell.EventMouse, setFocus func(p Primitive)) (consumed bool, capture Primitive) { - return f.WrapMouseHandler(func(action MouseAction, event *tcell.EventMouse, setFocus func(p Primitive)) (consumed bool, capture Primitive) { - if !f.InRect(event.Position()) { - return false, nil - } - - // Pass mouse events along to the first child item that takes it. - for _, item := range f.items { - if item.Item == nil { - continue - } - consumed, capture = item.Item.MouseHandler()(action, event, setFocus) - if consumed { - return - } - } - - return - }) -} diff --git a/vendor/github.com/rivo/tview/focusable.go b/vendor/github.com/rivo/tview/focusable.go deleted file mode 100644 index 99fdaaf4..00000000 --- a/vendor/github.com/rivo/tview/focusable.go +++ /dev/null @@ -1,8 +0,0 @@ -package tview - -// Focusable provides a method which determines if a primitive has focus. -// Composed primitives may be focused based on the focused state of their -// contained primitives. -type Focusable interface { - HasFocus() bool -} diff --git a/vendor/github.com/rivo/tview/form.go b/vendor/github.com/rivo/tview/form.go deleted file mode 100644 index d022fab2..00000000 --- a/vendor/github.com/rivo/tview/form.go +++ /dev/null @@ -1,663 +0,0 @@ -package tview - -import ( - "github.com/gdamore/tcell" -) - -// DefaultFormFieldWidth is the default field screen width of form elements -// whose field width is flexible (0). This is used in the Form class for -// horizontal layouts. -var DefaultFormFieldWidth = 10 - -// FormItem is the interface all form items must implement to be able to be -// included in a form. -type FormItem interface { - Primitive - - // GetLabel returns the item's label text. - GetLabel() string - - // SetFormAttributes sets a number of item attributes at once. - SetFormAttributes(labelWidth int, labelColor, bgColor, fieldTextColor, fieldBgColor tcell.Color) FormItem - - // GetFieldWidth returns the width of the form item's field (the area which - // is manipulated by the user) in number of screen cells. A value of 0 - // indicates the the field width is flexible and may use as much space as - // required. - GetFieldWidth() int - - // SetFinishedFunc sets the handler function for when the user finished - // entering data into the item. The handler may receive events for the - // Enter key (we're done), the Escape key (cancel input), the Tab key (move to - // next field), and the Backtab key (move to previous field). - SetFinishedFunc(handler func(key tcell.Key)) FormItem -} - -// Form allows you to combine multiple one-line form elements into a vertical -// or horizontal layout. Form elements include types such as InputField or -// Checkbox. These elements can be optionally followed by one or more buttons -// for which you can define form-wide actions (e.g. Save, Clear, Cancel). -// -// See https://github.com/rivo/tview/wiki/Form for an example. -type Form struct { - *Box - - // The items of the form (one row per item). - items []FormItem - - // The buttons of the form. - buttons []*Button - - // If set to true, instead of position items and buttons from top to bottom, - // they are positioned from left to right. - horizontal bool - - // The alignment of the buttons. - buttonsAlign int - - // The number of empty rows between items. - itemPadding int - - // The index of the item or button which has focus. (Items are counted first, - // buttons are counted last.) This is only used when the form itself receives - // focus so that the last element that had focus keeps it. - focusedElement int - - // The label color. - labelColor tcell.Color - - // The background color of the input area. - fieldBackgroundColor tcell.Color - - // The text color of the input area. - fieldTextColor tcell.Color - - // The background color of the buttons. - buttonBackgroundColor tcell.Color - - // The color of the button text. - buttonTextColor tcell.Color - - // An optional function which is called when the user hits Escape. - cancel func() -} - -// NewForm returns a new form. -func NewForm() *Form { - box := NewBox().SetBorderPadding(1, 1, 1, 1) - - f := &Form{ - Box: box, - itemPadding: 1, - labelColor: Styles.SecondaryTextColor, - fieldBackgroundColor: Styles.ContrastBackgroundColor, - fieldTextColor: Styles.PrimaryTextColor, - buttonBackgroundColor: Styles.ContrastBackgroundColor, - buttonTextColor: Styles.PrimaryTextColor, - } - - f.focus = f - - return f -} - -// SetItemPadding sets the number of empty rows between form items for vertical -// layouts and the number of empty cells between form items for horizontal -// layouts. -func (f *Form) SetItemPadding(padding int) *Form { - f.itemPadding = padding - return f -} - -// SetHorizontal sets the direction the form elements are laid out. If set to -// true, instead of positioning them from top to bottom (the default), they are -// positioned from left to right, moving into the next row if there is not -// enough space. -func (f *Form) SetHorizontal(horizontal bool) *Form { - f.horizontal = horizontal - return f -} - -// SetLabelColor sets the color of the labels. -func (f *Form) SetLabelColor(color tcell.Color) *Form { - f.labelColor = color - return f -} - -// SetFieldBackgroundColor sets the background color of the input areas. -func (f *Form) SetFieldBackgroundColor(color tcell.Color) *Form { - f.fieldBackgroundColor = color - return f -} - -// SetFieldTextColor sets the text color of the input areas. -func (f *Form) SetFieldTextColor(color tcell.Color) *Form { - f.fieldTextColor = color - return f -} - -// SetButtonsAlign sets how the buttons align horizontally, one of AlignLeft -// (the default), AlignCenter, and AlignRight. This is only -func (f *Form) SetButtonsAlign(align int) *Form { - f.buttonsAlign = align - return f -} - -// SetButtonBackgroundColor sets the background color of the buttons. -func (f *Form) SetButtonBackgroundColor(color tcell.Color) *Form { - f.buttonBackgroundColor = color - return f -} - -// SetButtonTextColor sets the color of the button texts. -func (f *Form) SetButtonTextColor(color tcell.Color) *Form { - f.buttonTextColor = color - return f -} - -// SetFocus shifts the focus to the form element with the given index, counting -// non-button items first and buttons last. Note that this index is only used -// when the form itself receives focus. -func (f *Form) SetFocus(index int) *Form { - if index < 0 { - f.focusedElement = 0 - } else if index >= len(f.items)+len(f.buttons) { - f.focusedElement = len(f.items) + len(f.buttons) - } else { - f.focusedElement = index - } - return f -} - -// AddInputField adds an input field to the form. It has a label, an optional -// initial value, a field width (a value of 0 extends it as far as possible), -// an optional accept function to validate the item's value (set to nil to -// accept any text), and an (optional) callback function which is invoked when -// the input field's text has changed. -func (f *Form) AddInputField(label, value string, fieldWidth int, accept func(textToCheck string, lastChar rune) bool, changed func(text string)) *Form { - f.items = append(f.items, NewInputField(). - SetLabel(label). - SetText(value). - SetFieldWidth(fieldWidth). - SetAcceptanceFunc(accept). - SetChangedFunc(changed)) - return f -} - -// AddPasswordField adds a password field to the form. This is similar to an -// input field except that the user's input not shown. Instead, a "mask" -// character is displayed. The password field has a label, an optional initial -// value, a field width (a value of 0 extends it as far as possible), and an -// (optional) callback function which is invoked when the input field's text has -// changed. -func (f *Form) AddPasswordField(label, value string, fieldWidth int, mask rune, changed func(text string)) *Form { - if mask == 0 { - mask = '*' - } - f.items = append(f.items, NewInputField(). - SetLabel(label). - SetText(value). - SetFieldWidth(fieldWidth). - SetMaskCharacter(mask). - SetChangedFunc(changed)) - return f -} - -// AddDropDown adds a drop-down element to the form. It has a label, options, -// and an (optional) callback function which is invoked when an option was -// selected. The initial option may be a negative value to indicate that no -// option is currently selected. -func (f *Form) AddDropDown(label string, options []string, initialOption int, selected func(option string, optionIndex int)) *Form { - f.items = append(f.items, NewDropDown(). - SetLabel(label). - SetOptions(options, selected). - SetCurrentOption(initialOption)) - return f -} - -// AddCheckbox adds a checkbox to the form. It has a label, an initial state, -// and an (optional) callback function which is invoked when the state of the -// checkbox was changed by the user. -func (f *Form) AddCheckbox(label string, checked bool, changed func(checked bool)) *Form { - f.items = append(f.items, NewCheckbox(). - SetLabel(label). - SetChecked(checked). - SetChangedFunc(changed)) - return f -} - -// AddButton adds a new button to the form. The "selected" function is called -// when the user selects this button. It may be nil. -func (f *Form) AddButton(label string, selected func()) *Form { - f.buttons = append(f.buttons, NewButton(label).SetSelectedFunc(selected)) - return f -} - -// GetButton returns the button at the specified 0-based index. Note that -// buttons have been specially prepared for this form and modifying some of -// their attributes may have unintended side effects. -func (f *Form) GetButton(index int) *Button { - return f.buttons[index] -} - -// RemoveButton removes the button at the specified position, starting with 0 -// for the button that was added first. -func (f *Form) RemoveButton(index int) *Form { - f.buttons = append(f.buttons[:index], f.buttons[index+1:]...) - return f -} - -// GetButtonCount returns the number of buttons in this form. -func (f *Form) GetButtonCount() int { - return len(f.buttons) -} - -// GetButtonIndex returns the index of the button with the given label, starting -// with 0 for the button that was added first. If no such label was found, -1 -// is returned. -func (f *Form) GetButtonIndex(label string) int { - for index, button := range f.buttons { - if button.GetLabel() == label { - return index - } - } - return -1 -} - -// Clear removes all input elements from the form, including the buttons if -// specified. -func (f *Form) Clear(includeButtons bool) *Form { - f.items = nil - if includeButtons { - f.ClearButtons() - } - f.focusedElement = 0 - return f -} - -// ClearButtons removes all buttons from the form. -func (f *Form) ClearButtons() *Form { - f.buttons = nil - return f -} - -// AddFormItem adds a new item to the form. This can be used to add your own -// objects to the form. Note, however, that the Form class will override some -// of its attributes to make it work in the form context. Specifically, these -// are: -// -// - The label width -// - The label color -// - The background color -// - The field text color -// - The field background color -func (f *Form) AddFormItem(item FormItem) *Form { - f.items = append(f.items, item) - return f -} - -// GetFormItemCount returns the number of items in the form (not including the -// buttons). -func (f *Form) GetFormItemCount() int { - return len(f.items) -} - -// GetFormItem returns the form item at the given position, starting with index -// 0. Elements are referenced in the order they were added. Buttons are not -// included. -func (f *Form) GetFormItem(index int) FormItem { - return f.items[index] -} - -// RemoveFormItem removes the form element at the given position, starting with -// index 0. Elements are referenced in the order they were added. Buttons are -// not included. -func (f *Form) RemoveFormItem(index int) *Form { - f.items = append(f.items[:index], f.items[index+1:]...) - return f -} - -// GetFormItemByLabel returns the first form element with the given label. If -// no such element is found, nil is returned. Buttons are not searched and will -// therefore not be returned. -func (f *Form) GetFormItemByLabel(label string) FormItem { - for _, item := range f.items { - if item.GetLabel() == label { - return item - } - } - return nil -} - -// GetFormItemIndex returns the index of the first form element with the given -// label. If no such element is found, -1 is returned. Buttons are not searched -// and will therefore not be returned. -func (f *Form) GetFormItemIndex(label string) int { - for index, item := range f.items { - if item.GetLabel() == label { - return index - } - } - return -1 -} - -// GetFocusedItemIndex returns the indices of the form element or button which -// currently has focus. If they don't, -1 is returned resepectively. -func (f *Form) GetFocusedItemIndex() (formItem, button int) { - index := f.focusIndex() - if index < 0 { - return -1, -1 - } - if index < len(f.items) { - return index, -1 - } - return -1, index - len(f.items) -} - -// SetCancelFunc sets a handler which is called when the user hits the Escape -// key. -func (f *Form) SetCancelFunc(callback func()) *Form { - f.cancel = callback - return f -} - -// Draw draws this primitive onto the screen. -func (f *Form) Draw(screen tcell.Screen) { - f.Box.Draw(screen) - - // Determine the actual item that has focus. - if index := f.focusIndex(); index >= 0 { - f.focusedElement = index - } - - // Determine the dimensions. - x, y, width, height := f.GetInnerRect() - topLimit := y - bottomLimit := y + height - rightLimit := x + width - startX := x - - // Find the longest label. - var maxLabelWidth int - for _, item := range f.items { - labelWidth := TaggedStringWidth(item.GetLabel()) - if labelWidth > maxLabelWidth { - maxLabelWidth = labelWidth - } - } - maxLabelWidth++ // Add one space. - - // Calculate positions of form items. - positions := make([]struct{ x, y, width, height int }, len(f.items)+len(f.buttons)) - var focusedPosition struct{ x, y, width, height int } - for index, item := range f.items { - // Calculate the space needed. - labelWidth := TaggedStringWidth(item.GetLabel()) - var itemWidth int - if f.horizontal { - fieldWidth := item.GetFieldWidth() - if fieldWidth == 0 { - fieldWidth = DefaultFormFieldWidth - } - labelWidth++ - itemWidth = labelWidth + fieldWidth - } else { - // We want all fields to align vertically. - labelWidth = maxLabelWidth - itemWidth = width - } - - // Advance to next line if there is no space. - if f.horizontal && x+labelWidth+1 >= rightLimit { - x = startX - y += 2 - } - - // Adjust the item's attributes. - if x+itemWidth >= rightLimit { - itemWidth = rightLimit - x - } - item.SetFormAttributes( - labelWidth, - f.labelColor, - f.backgroundColor, - f.fieldTextColor, - f.fieldBackgroundColor, - ) - - // Save position. - positions[index].x = x - positions[index].y = y - positions[index].width = itemWidth - positions[index].height = 1 - if item.GetFocusable().HasFocus() { - focusedPosition = positions[index] - } - - // Advance to next item. - if f.horizontal { - x += itemWidth + f.itemPadding - } else { - y += 1 + f.itemPadding - } - } - - // How wide are the buttons? - buttonWidths := make([]int, len(f.buttons)) - buttonsWidth := 0 - for index, button := range f.buttons { - w := TaggedStringWidth(button.GetLabel()) + 4 - buttonWidths[index] = w - buttonsWidth += w + 1 - } - buttonsWidth-- - - // Where do we place them? - if !f.horizontal && x+buttonsWidth < rightLimit { - if f.buttonsAlign == AlignRight { - x = rightLimit - buttonsWidth - } else if f.buttonsAlign == AlignCenter { - x = (x + rightLimit - buttonsWidth) / 2 - } - - // In vertical layouts, buttons always appear after an empty line. - if f.itemPadding == 0 { - y++ - } - } - - // Calculate positions of buttons. - for index, button := range f.buttons { - space := rightLimit - x - buttonWidth := buttonWidths[index] - if f.horizontal { - if space < buttonWidth-4 { - x = startX - y += 2 - space = width - } - } else { - if space < 1 { - break // No space for this button anymore. - } - } - if buttonWidth > space { - buttonWidth = space - } - button.SetLabelColor(f.buttonTextColor). - SetLabelColorActivated(f.buttonBackgroundColor). - SetBackgroundColorActivated(f.buttonTextColor). - SetBackgroundColor(f.buttonBackgroundColor) - - buttonIndex := index + len(f.items) - positions[buttonIndex].x = x - positions[buttonIndex].y = y - positions[buttonIndex].width = buttonWidth - positions[buttonIndex].height = 1 - - if button.HasFocus() { - focusedPosition = positions[buttonIndex] - } - - x += buttonWidth + 1 - } - - // Determine vertical offset based on the position of the focused item. - var offset int - if focusedPosition.y+focusedPosition.height > bottomLimit { - offset = focusedPosition.y + focusedPosition.height - bottomLimit - if focusedPosition.y-offset < topLimit { - offset = focusedPosition.y - topLimit - } - } - - // Draw items. - for index, item := range f.items { - // Set position. - y := positions[index].y - offset - height := positions[index].height - item.SetRect(positions[index].x, y, positions[index].width, height) - - // Is this item visible? - if y+height <= topLimit || y >= bottomLimit { - continue - } - - // Draw items with focus last (in case of overlaps). - if item.GetFocusable().HasFocus() { - defer item.Draw(screen) - } else { - item.Draw(screen) - } - } - - // Draw buttons. - for index, button := range f.buttons { - // Set position. - buttonIndex := index + len(f.items) - y := positions[buttonIndex].y - offset - height := positions[buttonIndex].height - button.SetRect(positions[buttonIndex].x, y, positions[buttonIndex].width, height) - - // Is this button visible? - if y+height <= topLimit || y >= bottomLimit { - continue - } - - // Draw button. - button.Draw(screen) - } -} - -// Focus is called by the application when the primitive receives focus. -func (f *Form) Focus(delegate func(p Primitive)) { - if len(f.items)+len(f.buttons) == 0 { - f.hasFocus = true - return - } - f.hasFocus = false - - // Hand on the focus to one of our child elements. - if f.focusedElement < 0 || f.focusedElement >= len(f.items)+len(f.buttons) { - f.focusedElement = 0 - } - handler := func(key tcell.Key) { - switch key { - case tcell.KeyTab, tcell.KeyEnter: - f.focusedElement++ - f.Focus(delegate) - case tcell.KeyBacktab: - f.focusedElement-- - if f.focusedElement < 0 { - f.focusedElement = len(f.items) + len(f.buttons) - 1 - } - f.Focus(delegate) - case tcell.KeyEscape: - if f.cancel != nil { - f.cancel() - } else { - f.focusedElement = 0 - f.Focus(delegate) - } - } - } - - if f.focusedElement < len(f.items) { - // We're selecting an item. - item := f.items[f.focusedElement] - item.SetFinishedFunc(handler) - delegate(item) - } else { - // We're selecting a button. - button := f.buttons[f.focusedElement-len(f.items)] - button.SetBlurFunc(handler) - delegate(button) - } -} - -// HasFocus returns whether or not this primitive has focus. -func (f *Form) HasFocus() bool { - if f.hasFocus { - return true - } - return f.focusIndex() >= 0 -} - -// focusIndex returns the index of the currently focused item, counting form -// items first, then buttons. A negative value indicates that no containeed item -// has focus. -func (f *Form) focusIndex() int { - for index, item := range f.items { - if item.GetFocusable().HasFocus() { - return index - } - } - for index, button := range f.buttons { - if button.focus.HasFocus() { - return len(f.items) + index - } - } - return -1 -} - -// MouseHandler returns the mouse handler for this primitive. -func (f *Form) MouseHandler() func(action MouseAction, event *tcell.EventMouse, setFocus func(p Primitive)) (consumed bool, capture Primitive) { - return f.WrapMouseHandler(func(action MouseAction, event *tcell.EventMouse, setFocus func(p Primitive)) (consumed bool, capture Primitive) { - if !f.InRect(event.Position()) { - return false, nil - } - - // At the end, update f.focusedElement and prepare current item/button. - defer func() { - if consumed { - index := f.focusIndex() - if index >= 0 { - f.focusedElement = index - } - f.Focus(setFocus) - } - }() - - // Determine items to pass mouse events to. - for _, item := range f.items { - consumed, capture = item.MouseHandler()(action, event, setFocus) - if consumed { - return - } - } - for _, button := range f.buttons { - consumed, capture = button.MouseHandler()(action, event, setFocus) - if consumed { - return - } - } - - // A mouse click anywhere else will return the focus to the last selected - // element. - if action == MouseLeftClick { - consumed = true - } - - return - }) -} diff --git a/vendor/github.com/rivo/tview/frame.go b/vendor/github.com/rivo/tview/frame.go deleted file mode 100644 index 1ea9d6ee..00000000 --- a/vendor/github.com/rivo/tview/frame.go +++ /dev/null @@ -1,169 +0,0 @@ -package tview - -import ( - "github.com/gdamore/tcell" -) - -// frameText holds information about a line of text shown in the frame. -type frameText struct { - Text string // The text to be displayed. - Header bool // true = place in header, false = place in footer. - Align int // One of the Align constants. - Color tcell.Color // The text color. -} - -// Frame is a wrapper which adds space around another primitive. In addition, -// the top area (header) and the bottom area (footer) may also contain text. -// -// See https://github.com/rivo/tview/wiki/Frame for an example. -type Frame struct { - *Box - - // The contained primitive. - primitive Primitive - - // The lines of text to be displayed. - text []*frameText - - // Border spacing. - top, bottom, header, footer, left, right int -} - -// NewFrame returns a new frame around the given primitive. The primitive's -// size will be changed to fit within this frame. -func NewFrame(primitive Primitive) *Frame { - box := NewBox() - - f := &Frame{ - Box: box, - primitive: primitive, - top: 1, - bottom: 1, - header: 1, - footer: 1, - left: 1, - right: 1, - } - - f.focus = f - - return f -} - -// AddText adds text to the frame. Set "header" to true if the text is to appear -// in the header, above the contained primitive. Set it to false for it to -// appear in the footer, below the contained primitive. "align" must be one of -// the Align constants. Rows in the header are printed top to bottom, rows in -// the footer are printed bottom to top. Note that long text can overlap as -// different alignments will be placed on the same row. -func (f *Frame) AddText(text string, header bool, align int, color tcell.Color) *Frame { - f.text = append(f.text, &frameText{ - Text: text, - Header: header, - Align: align, - Color: color, - }) - return f -} - -// Clear removes all text from the frame. -func (f *Frame) Clear() *Frame { - f.text = nil - return f -} - -// SetBorders sets the width of the frame borders as well as "header" and -// "footer", the vertical space between the header and footer text and the -// contained primitive (does not apply if there is no text). -func (f *Frame) SetBorders(top, bottom, header, footer, left, right int) *Frame { - f.top, f.bottom, f.header, f.footer, f.left, f.right = top, bottom, header, footer, left, right - return f -} - -// Draw draws this primitive onto the screen. -func (f *Frame) Draw(screen tcell.Screen) { - f.Box.Draw(screen) - - // Calculate start positions. - x, top, width, height := f.GetInnerRect() - bottom := top + height - 1 - x += f.left - top += f.top - bottom -= f.bottom - width -= f.left + f.right - if width <= 0 || top >= bottom { - return // No space left. - } - - // Draw text. - var rows [6]int // top-left, top-center, top-right, bottom-left, bottom-center, bottom-right. - topMax := top - bottomMin := bottom - for _, text := range f.text { - // Where do we place this text? - var y int - if text.Header { - y = top + rows[text.Align] - rows[text.Align]++ - if y >= bottomMin { - continue - } - if y+1 > topMax { - topMax = y + 1 - } - } else { - y = bottom - rows[3+text.Align] - rows[3+text.Align]++ - if y <= topMax { - continue - } - if y-1 < bottomMin { - bottomMin = y - 1 - } - } - - // Draw text. - Print(screen, text.Text, x, y, width, text.Align, text.Color) - } - - // Set the size of the contained primitive. - if topMax > top { - top = topMax + f.header - } - if bottomMin < bottom { - bottom = bottomMin - f.footer - } - if top > bottom { - return // No space for the primitive. - } - f.primitive.SetRect(x, top, width, bottom+1-top) - - // Finally, draw the contained primitive. - f.primitive.Draw(screen) -} - -// Focus is called when this primitive receives focus. -func (f *Frame) Focus(delegate func(p Primitive)) { - delegate(f.primitive) -} - -// HasFocus returns whether or not this primitive has focus. -func (f *Frame) HasFocus() bool { - focusable, ok := f.primitive.(Focusable) - if ok { - return focusable.HasFocus() - } - return false -} - -// MouseHandler returns the mouse handler for this primitive. -func (f *Frame) MouseHandler() func(action MouseAction, event *tcell.EventMouse, setFocus func(p Primitive)) (consumed bool, capture Primitive) { - return f.WrapMouseHandler(func(action MouseAction, event *tcell.EventMouse, setFocus func(p Primitive)) (consumed bool, capture Primitive) { - if !f.InRect(event.Position()) { - return false, nil - } - - // Pass mouse events on to contained primitive. - return f.primitive.MouseHandler()(action, event, setFocus) - }) -} diff --git a/vendor/github.com/rivo/tview/grid.go b/vendor/github.com/rivo/tview/grid.go deleted file mode 100644 index 5b247bfd..00000000 --- a/vendor/github.com/rivo/tview/grid.go +++ /dev/null @@ -1,684 +0,0 @@ -package tview - -import ( - "math" - - "github.com/gdamore/tcell" -) - -// gridItem represents one primitive and its possible position on a grid. -type gridItem struct { - Item Primitive // The item to be positioned. May be nil for an empty item. - Row, Column int // The top-left grid cell where the item is placed. - Width, Height int // The number of rows and columns the item occupies. - MinGridWidth, MinGridHeight int // The minimum grid width/height for which this item is visible. - Focus bool // Whether or not this item attracts the layout's focus. - - visible bool // Whether or not this item was visible the last time the grid was drawn. - x, y, w, h int // The last position of the item relative to the top-left corner of the grid. Undefined if visible is false. -} - -// Grid is an implementation of a grid-based layout. It works by defining the -// size of the rows and columns, then placing primitives into the grid. -// -// Some settings can lead to the grid exceeding its available space. SetOffset() -// can then be used to scroll in steps of rows and columns. These offset values -// can also be controlled with the arrow keys (or the "g","G", "j", "k", "h", -// and "l" keys) while the grid has focus and none of its contained primitives -// do. -// -// See https://github.com/rivo/tview/wiki/Grid for an example. -type Grid struct { - *Box - - // The items to be positioned. - items []*gridItem - - // The definition of the rows and columns of the grid. See - // SetRows()/SetColumns() for details. - rows, columns []int - - // The minimum sizes for rows and columns. - minWidth, minHeight int - - // The size of the gaps between neighboring primitives. This is automatically - // set to 1 if borders is true. - gapRows, gapColumns int - - // The number of rows and columns skipped before drawing the top-left corner - // of the grid. - rowOffset, columnOffset int - - // Whether or not borders are drawn around grid items. If this is set to true, - // a gap size of 1 is automatically assumed (which is filled with the border - // graphics). - borders bool - - // The color of the borders around grid items. - bordersColor tcell.Color -} - -// NewGrid returns a new grid-based layout container with no initial primitives. -// -// Note that Box, the superclass of Grid, will have its background color set to -// transparent so that any grid areas not covered by any primitives will leave -// their background unchanged. To clear a Grid's background before any items are -// drawn, set it to the desired color: -// -// grid.SetBackgroundColor(tview.Styles.PrimitiveBackgroundColor) -func NewGrid() *Grid { - g := &Grid{ - Box: NewBox().SetBackgroundColor(tcell.ColorDefault), - bordersColor: Styles.GraphicsColor, - } - g.focus = g - return g -} - -// SetColumns defines how the columns of the grid are distributed. Each value -// defines the size of one column, starting with the leftmost column. Values -// greater 0 represent absolute column widths (gaps not included). Values less -// or equal 0 represent proportional column widths or fractions of the remaining -// free space, where 0 is treated the same as -1. That is, a column with a value -// of -3 will have three times the width of a column with a value of -1 (or 0). -// The minimum width set with SetMinSize() is always observed. -// -// Primitives may extend beyond the columns defined explicitly with this -// function. A value of 0 is assumed for any undefined column. In fact, if you -// never call this function, all columns occupied by primitives will have the -// same width. On the other hand, unoccupied columns defined with this function -// will always take their place. -// -// Assuming a total width of the grid of 100 cells and a minimum width of 0, the -// following call will result in columns with widths of 30, 10, 15, 15, and 30 -// cells: -// -// grid.Setcolumns(30, 10, -1, -1, -2) -// -// If a primitive were then placed in the 6th and 7th column, the resulting -// widths would be: 30, 10, 10, 10, 20, 10, and 10 cells. -// -// If you then called SetMinSize() as follows: -// -// grid.SetMinSize(15, 20) -// -// The resulting widths would be: 30, 15, 15, 15, 20, 15, and 15 cells, a total -// of 125 cells, 25 cells wider than the available grid width. -func (g *Grid) SetColumns(columns ...int) *Grid { - g.columns = columns - return g -} - -// SetRows defines how the rows of the grid are distributed. These values behave -// the same as the column values provided with SetColumns(), see there for a -// definition and examples. -// -// The provided values correspond to row heights, the first value defining -// the height of the topmost row. -func (g *Grid) SetRows(rows ...int) *Grid { - g.rows = rows - return g -} - -// SetSize is a shortcut for SetRows() and SetColumns() where all row and column -// values are set to the given size values. See SetColumns() for details on sizes. -func (g *Grid) SetSize(numRows, numColumns, rowSize, columnSize int) *Grid { - g.rows = make([]int, numRows) - for index := range g.rows { - g.rows[index] = rowSize - } - g.columns = make([]int, numColumns) - for index := range g.columns { - g.columns[index] = columnSize - } - return g -} - -// SetMinSize sets an absolute minimum width for rows and an absolute minimum -// height for columns. Panics if negative values are provided. -func (g *Grid) SetMinSize(row, column int) *Grid { - if row < 0 || column < 0 { - panic("Invalid minimum row/column size") - } - g.minHeight, g.minWidth = row, column - return g -} - -// SetGap sets the size of the gaps between neighboring primitives on the grid. -// If borders are drawn (see SetBorders()), these values are ignored and a gap -// of 1 is assumed. Panics if negative values are provided. -func (g *Grid) SetGap(row, column int) *Grid { - if row < 0 || column < 0 { - panic("Invalid gap size") - } - g.gapRows, g.gapColumns = row, column - return g -} - -// SetBorders sets whether or not borders are drawn around grid items. Setting -// this value to true will cause the gap values (see SetGap()) to be ignored and -// automatically assumed to be 1 where the border graphics are drawn. -func (g *Grid) SetBorders(borders bool) *Grid { - g.borders = borders - return g -} - -// SetBordersColor sets the color of the item borders. -func (g *Grid) SetBordersColor(color tcell.Color) *Grid { - g.bordersColor = color - return g -} - -// AddItem adds a primitive and its position to the grid. The top-left corner -// of the primitive will be located in the top-left corner of the grid cell at -// the given row and column and will span "rowSpan" rows and "colSpan" columns. -// For example, for a primitive to occupy rows 2, 3, and 4 and columns 5 and 6: -// -// grid.AddItem(p, 2, 5, 3, 2, 0, 0, true) -// -// If rowSpan or colSpan is 0, the primitive will not be drawn. -// -// You can add the same primitive multiple times with different grid positions. -// The minGridWidth and minGridHeight values will then determine which of those -// positions will be used. This is similar to CSS media queries. These minimum -// values refer to the overall size of the grid. If multiple items for the same -// primitive apply, the one that has at least one highest minimum value will be -// used, or the primitive added last if those values are the same. Example: -// -// grid.AddItem(p, 0, 0, 0, 0, 0, 0, true). // Hide in small grids. -// AddItem(p, 0, 0, 1, 2, 100, 0, true). // One-column layout for medium grids. -// AddItem(p, 1, 1, 3, 2, 300, 0, true) // Multi-column layout for large grids. -// -// To use the same grid layout for all sizes, simply set minGridWidth and -// minGridHeight to 0. -// -// If the item's focus is set to true, it will receive focus when the grid -// receives focus. If there are multiple items with a true focus flag, the last -// visible one that was added will receive focus. -func (g *Grid) AddItem(p Primitive, row, column, rowSpan, colSpan, minGridHeight, minGridWidth int, focus bool) *Grid { - g.items = append(g.items, &gridItem{ - Item: p, - Row: row, - Column: column, - Height: rowSpan, - Width: colSpan, - MinGridHeight: minGridHeight, - MinGridWidth: minGridWidth, - Focus: focus, - }) - return g -} - -// RemoveItem removes all items for the given primitive from the grid, keeping -// the order of the remaining items intact. -func (g *Grid) RemoveItem(p Primitive) *Grid { - for index := len(g.items) - 1; index >= 0; index-- { - if g.items[index].Item == p { - g.items = append(g.items[:index], g.items[index+1:]...) - } - } - return g -} - -// Clear removes all items from the grid. -func (g *Grid) Clear() *Grid { - g.items = nil - return g -} - -// SetOffset sets the number of rows and columns which are skipped before -// drawing the first grid cell in the top-left corner. As the grid will never -// completely move off the screen, these values may be adjusted the next time -// the grid is drawn. The actual position of the grid may also be adjusted such -// that contained primitives that have focus remain visible. -func (g *Grid) SetOffset(rows, columns int) *Grid { - g.rowOffset, g.columnOffset = rows, columns - return g -} - -// GetOffset returns the current row and column offset (see SetOffset() for -// details). -func (g *Grid) GetOffset() (rows, columns int) { - return g.rowOffset, g.columnOffset -} - -// Focus is called when this primitive receives focus. -func (g *Grid) Focus(delegate func(p Primitive)) { - for _, item := range g.items { - if item.Focus { - delegate(item.Item) - return - } - } - g.hasFocus = true -} - -// Blur is called when this primitive loses focus. -func (g *Grid) Blur() { - g.hasFocus = false -} - -// HasFocus returns whether or not this primitive has focus. -func (g *Grid) HasFocus() bool { - for _, item := range g.items { - if item.visible && item.Item.GetFocusable().HasFocus() { - return true - } - } - return g.hasFocus -} - -// InputHandler returns the handler for this primitive. -func (g *Grid) InputHandler() func(event *tcell.EventKey, setFocus func(p Primitive)) { - return g.WrapInputHandler(func(event *tcell.EventKey, setFocus func(p Primitive)) { - switch event.Key() { - case tcell.KeyRune: - switch event.Rune() { - case 'g': - g.rowOffset, g.columnOffset = 0, 0 - case 'G': - g.rowOffset = math.MaxInt32 - case 'j': - g.rowOffset++ - case 'k': - g.rowOffset-- - case 'h': - g.columnOffset-- - case 'l': - g.columnOffset++ - } - case tcell.KeyHome: - g.rowOffset, g.columnOffset = 0, 0 - case tcell.KeyEnd: - g.rowOffset = math.MaxInt32 - case tcell.KeyUp: - g.rowOffset-- - case tcell.KeyDown: - g.rowOffset++ - case tcell.KeyLeft: - g.columnOffset-- - case tcell.KeyRight: - g.columnOffset++ - } - }) -} - -// Draw draws this primitive onto the screen. -func (g *Grid) Draw(screen tcell.Screen) { - g.Box.Draw(screen) - x, y, width, height := g.GetInnerRect() - screenWidth, screenHeight := screen.Size() - - // Make a list of items which apply. - items := make(map[Primitive]*gridItem) - for _, item := range g.items { - item.visible = false - if item.Width <= 0 || item.Height <= 0 || width < item.MinGridWidth || height < item.MinGridHeight { - continue - } - previousItem, ok := items[item.Item] - if ok && item.MinGridWidth < previousItem.MinGridWidth && item.MinGridHeight < previousItem.MinGridHeight { - continue - } - items[item.Item] = item - } - - // How many rows and columns do we have? - rows := len(g.rows) - columns := len(g.columns) - for _, item := range items { - rowEnd := item.Row + item.Height - if rowEnd > rows { - rows = rowEnd - } - columnEnd := item.Column + item.Width - if columnEnd > columns { - columns = columnEnd - } - } - if rows == 0 || columns == 0 { - return // No content. - } - - // Where are they located? - rowPos := make([]int, rows) - rowHeight := make([]int, rows) - columnPos := make([]int, columns) - columnWidth := make([]int, columns) - - // How much space do we distribute? - remainingWidth := width - remainingHeight := height - proportionalWidth := 0 - proportionalHeight := 0 - for index, row := range g.rows { - if row > 0 { - if row < g.minHeight { - row = g.minHeight - } - remainingHeight -= row - rowHeight[index] = row - } else if row == 0 { - proportionalHeight++ - } else { - proportionalHeight += -row - } - } - for index, column := range g.columns { - if column > 0 { - if column < g.minWidth { - column = g.minWidth - } - remainingWidth -= column - columnWidth[index] = column - } else if column == 0 { - proportionalWidth++ - } else { - proportionalWidth += -column - } - } - if g.borders { - remainingHeight -= rows + 1 - remainingWidth -= columns + 1 - } else { - remainingHeight -= (rows - 1) * g.gapRows - remainingWidth -= (columns - 1) * g.gapColumns - } - if rows > len(g.rows) { - proportionalHeight += rows - len(g.rows) - } - if columns > len(g.columns) { - proportionalWidth += columns - len(g.columns) - } - - // Distribute proportional rows/columns. - for index := 0; index < rows; index++ { - row := 0 - if index < len(g.rows) { - row = g.rows[index] - } - if row > 0 { - if row < g.minHeight { - row = g.minHeight - } - continue // Not proportional. We already know the width. - } else if row == 0 { - row = 1 - } else { - row = -row - } - rowAbs := row * remainingHeight / proportionalHeight - remainingHeight -= rowAbs - proportionalHeight -= row - if rowAbs < g.minHeight { - rowAbs = g.minHeight - } - rowHeight[index] = rowAbs - } - for index := 0; index < columns; index++ { - column := 0 - if index < len(g.columns) { - column = g.columns[index] - } - if column > 0 { - if column < g.minWidth { - column = g.minWidth - } - continue // Not proportional. We already know the height. - } else if column == 0 { - column = 1 - } else { - column = -column - } - columnAbs := column * remainingWidth / proportionalWidth - remainingWidth -= columnAbs - proportionalWidth -= column - if columnAbs < g.minWidth { - columnAbs = g.minWidth - } - columnWidth[index] = columnAbs - } - - // Calculate row/column positions. - var columnX, rowY int - if g.borders { - columnX++ - rowY++ - } - for index, row := range rowHeight { - rowPos[index] = rowY - gap := g.gapRows - if g.borders { - gap = 1 - } - rowY += row + gap - } - for index, column := range columnWidth { - columnPos[index] = columnX - gap := g.gapColumns - if g.borders { - gap = 1 - } - columnX += column + gap - } - - // Calculate primitive positions. - var focus *gridItem // The item which has focus. - for primitive, item := range items { - px := columnPos[item.Column] - py := rowPos[item.Row] - var pw, ph int - for index := 0; index < item.Height; index++ { - ph += rowHeight[item.Row+index] - } - for index := 0; index < item.Width; index++ { - pw += columnWidth[item.Column+index] - } - if g.borders { - pw += item.Width - 1 - ph += item.Height - 1 - } else { - pw += (item.Width - 1) * g.gapColumns - ph += (item.Height - 1) * g.gapRows - } - item.x, item.y, item.w, item.h = px, py, pw, ph - item.visible = true - if primitive.GetFocusable().HasFocus() { - focus = item - } - } - - // Calculate screen offsets. - var offsetX, offsetY int - add := 1 - if !g.borders { - add = g.gapRows - } - for index, height := range rowHeight { - if index >= g.rowOffset { - break - } - offsetY += height + add - } - if !g.borders { - add = g.gapColumns - } - for index, width := range columnWidth { - if index >= g.columnOffset { - break - } - offsetX += width + add - } - - // Line up the last row/column with the end of the available area. - var border int - if g.borders { - border = 1 - } - last := len(rowPos) - 1 - if rowPos[last]+rowHeight[last]+border-offsetY < height { - offsetY = rowPos[last] - height + rowHeight[last] + border - } - last = len(columnPos) - 1 - if columnPos[last]+columnWidth[last]+border-offsetX < width { - offsetX = columnPos[last] - width + columnWidth[last] + border - } - - // The focused item must be within the visible area. - if focus != nil { - if focus.y+focus.h-offsetY >= height { - offsetY = focus.y - height + focus.h - } - if focus.y-offsetY < 0 { - offsetY = focus.y - } - if focus.x+focus.w-offsetX >= width { - offsetX = focus.x - width + focus.w - } - if focus.x-offsetX < 0 { - offsetX = focus.x - } - } - - // Adjust row/column offsets based on this value. - var from, to int - for index, pos := range rowPos { - if pos-offsetY < 0 { - from = index + 1 - } - if pos-offsetY < height { - to = index - } - } - if g.rowOffset < from { - g.rowOffset = from - } - if g.rowOffset > to { - g.rowOffset = to - } - from, to = 0, 0 - for index, pos := range columnPos { - if pos-offsetX < 0 { - from = index + 1 - } - if pos-offsetX < width { - to = index - } - } - if g.columnOffset < from { - g.columnOffset = from - } - if g.columnOffset > to { - g.columnOffset = to - } - - // Draw primitives and borders. - for primitive, item := range items { - // Final primitive position. - if !item.visible { - continue - } - item.x -= offsetX - item.y -= offsetY - if item.x >= width || item.x+item.w <= 0 || item.y >= height || item.y+item.h <= 0 { - item.visible = false - continue - } - if item.x+item.w > width { - item.w = width - item.x - } - if item.y+item.h > height { - item.h = height - item.y - } - if item.x < 0 { - item.w += item.x - item.x = 0 - } - if item.y < 0 { - item.h += item.y - item.y = 0 - } - if item.w <= 0 || item.h <= 0 { - item.visible = false - continue - } - item.x += x - item.y += y - primitive.SetRect(item.x, item.y, item.w, item.h) - - // Draw primitive. - if item == focus { - defer primitive.Draw(screen) - } else { - primitive.Draw(screen) - } - - // Draw border around primitive. - if g.borders { - for bx := item.x; bx < item.x+item.w; bx++ { // Top/bottom lines. - if bx < 0 || bx >= screenWidth { - continue - } - by := item.y - 1 - if by >= 0 && by < screenHeight { - PrintJoinedSemigraphics(screen, bx, by, Borders.Horizontal, g.bordersColor) - } - by = item.y + item.h - if by >= 0 && by < screenHeight { - PrintJoinedSemigraphics(screen, bx, by, Borders.Horizontal, g.bordersColor) - } - } - for by := item.y; by < item.y+item.h; by++ { // Left/right lines. - if by < 0 || by >= screenHeight { - continue - } - bx := item.x - 1 - if bx >= 0 && bx < screenWidth { - PrintJoinedSemigraphics(screen, bx, by, Borders.Vertical, g.bordersColor) - } - bx = item.x + item.w - if bx >= 0 && bx < screenWidth { - PrintJoinedSemigraphics(screen, bx, by, Borders.Vertical, g.bordersColor) - } - } - bx, by := item.x-1, item.y-1 // Top-left corner. - if bx >= 0 && bx < screenWidth && by >= 0 && by < screenHeight { - PrintJoinedSemigraphics(screen, bx, by, Borders.TopLeft, g.bordersColor) - } - bx, by = item.x+item.w, item.y-1 // Top-right corner. - if bx >= 0 && bx < screenWidth && by >= 0 && by < screenHeight { - PrintJoinedSemigraphics(screen, bx, by, Borders.TopRight, g.bordersColor) - } - bx, by = item.x-1, item.y+item.h // Bottom-left corner. - if bx >= 0 && bx < screenWidth && by >= 0 && by < screenHeight { - PrintJoinedSemigraphics(screen, bx, by, Borders.BottomLeft, g.bordersColor) - } - bx, by = item.x+item.w, item.y+item.h // Bottom-right corner. - if bx >= 0 && bx < screenWidth && by >= 0 && by < screenHeight { - PrintJoinedSemigraphics(screen, bx, by, Borders.BottomRight, g.bordersColor) - } - } - } -} - -// MouseHandler returns the mouse handler for this primitive. -func (g *Grid) MouseHandler() func(action MouseAction, event *tcell.EventMouse, setFocus func(p Primitive)) (consumed bool, capture Primitive) { - return g.WrapMouseHandler(func(action MouseAction, event *tcell.EventMouse, setFocus func(p Primitive)) (consumed bool, capture Primitive) { - if !g.InRect(event.Position()) { - return false, nil - } - - // Pass mouse events along to the first child item that takes it. - for _, item := range g.items { - if item.Item == nil { - continue - } - consumed, capture = item.Item.MouseHandler()(action, event, setFocus) - if consumed { - return - } - } - - return - }) -} diff --git a/vendor/github.com/rivo/tview/inputfield.go b/vendor/github.com/rivo/tview/inputfield.go deleted file mode 100644 index d497bf9c..00000000 --- a/vendor/github.com/rivo/tview/inputfield.go +++ /dev/null @@ -1,625 +0,0 @@ -package tview - -import ( - "math" - "regexp" - "strings" - "sync" - "unicode/utf8" - - "github.com/gdamore/tcell" -) - -// InputField is a one-line box (three lines if there is a title) where the -// user can enter text. Use SetAcceptanceFunc() to accept or reject input, -// SetChangedFunc() to listen for changes, and SetMaskCharacter() to hide input -// from onlookers (e.g. for password input). -// -// The following keys can be used for navigation and editing: -// -// - Left arrow: Move left by one character. -// - Right arrow: Move right by one character. -// - Home, Ctrl-A, Alt-a: Move to the beginning of the line. -// - End, Ctrl-E, Alt-e: Move to the end of the line. -// - Alt-left, Alt-b: Move left by one word. -// - Alt-right, Alt-f: Move right by one word. -// - Backspace: Delete the character before the cursor. -// - Delete: Delete the character after the cursor. -// - Ctrl-K: Delete from the cursor to the end of the line. -// - Ctrl-W: Delete the last word before the cursor. -// - Ctrl-U: Delete the entire line. -// -// See https://github.com/rivo/tview/wiki/InputField for an example. -type InputField struct { - *Box - - // The text that was entered. - text string - - // The text to be displayed before the input area. - label string - - // The text to be displayed in the input area when "text" is empty. - placeholder string - - // The label color. - labelColor tcell.Color - - // The background color of the input area. - fieldBackgroundColor tcell.Color - - // The text color of the input area. - fieldTextColor tcell.Color - - // The text color of the placeholder. - placeholderTextColor tcell.Color - - // The screen width of the label area. A value of 0 means use the width of - // the label text. - labelWidth int - - // The screen width of the input area. A value of 0 means extend as much as - // possible. - fieldWidth int - - // A character to mask entered text (useful for password fields). A value of 0 - // disables masking. - maskCharacter rune - - // The cursor position as a byte index into the text string. - cursorPos int - - // An optional autocomplete function which receives the current text of the - // input field and returns a slice of strings to be displayed in a drop-down - // selection. - autocomplete func(text string) []string - - // The List object which shows the selectable autocomplete entries. If not - // nil, the list's main texts represent the current autocomplete entries. - autocompleteList *List - autocompleteListMutex sync.Mutex - - // An optional function which may reject the last character that was entered. - accept func(text string, ch rune) bool - - // An optional function which is called when the input has changed. - changed func(text string) - - // An optional function which is called when the user indicated that they - // are done entering text. The key which was pressed is provided (tab, - // shift-tab, enter, or escape). - done func(tcell.Key) - - // A callback function set by the Form class and called when the user leaves - // this form item. - finished func(tcell.Key) - - fieldX int // The x-coordinate of the input field as determined during the last call to Draw(). - offset int // The number of bytes of the text string skipped ahead while drawing. -} - -// NewInputField returns a new input field. -func NewInputField() *InputField { - return &InputField{ - Box: NewBox(), - labelColor: Styles.SecondaryTextColor, - fieldBackgroundColor: Styles.ContrastBackgroundColor, - fieldTextColor: Styles.PrimaryTextColor, - placeholderTextColor: Styles.ContrastSecondaryTextColor, - } -} - -// SetText sets the current text of the input field. -func (i *InputField) SetText(text string) *InputField { - i.text = text - i.cursorPos = len(text) - if i.changed != nil { - i.changed(text) - } - return i -} - -// GetText returns the current text of the input field. -func (i *InputField) GetText() string { - return i.text -} - -// SetLabel sets the text to be displayed before the input area. -func (i *InputField) SetLabel(label string) *InputField { - i.label = label - return i -} - -// GetLabel returns the text to be displayed before the input area. -func (i *InputField) GetLabel() string { - return i.label -} - -// SetLabelWidth sets the screen width of the label. A value of 0 will cause the -// primitive to use the width of the label string. -func (i *InputField) SetLabelWidth(width int) *InputField { - i.labelWidth = width - return i -} - -// SetPlaceholder sets the text to be displayed when the input text is empty. -func (i *InputField) SetPlaceholder(text string) *InputField { - i.placeholder = text - return i -} - -// SetLabelColor sets the color of the label. -func (i *InputField) SetLabelColor(color tcell.Color) *InputField { - i.labelColor = color - return i -} - -// SetFieldBackgroundColor sets the background color of the input area. -func (i *InputField) SetFieldBackgroundColor(color tcell.Color) *InputField { - i.fieldBackgroundColor = color - return i -} - -// SetFieldTextColor sets the text color of the input area. -func (i *InputField) SetFieldTextColor(color tcell.Color) *InputField { - i.fieldTextColor = color - return i -} - -// SetPlaceholderTextColor sets the text color of placeholder text. -func (i *InputField) SetPlaceholderTextColor(color tcell.Color) *InputField { - i.placeholderTextColor = color - return i -} - -// SetFormAttributes sets attributes shared by all form items. -func (i *InputField) SetFormAttributes(labelWidth int, labelColor, bgColor, fieldTextColor, fieldBgColor tcell.Color) FormItem { - i.labelWidth = labelWidth - i.labelColor = labelColor - i.backgroundColor = bgColor - i.fieldTextColor = fieldTextColor - i.fieldBackgroundColor = fieldBgColor - return i -} - -// SetFieldWidth sets the screen width of the input area. A value of 0 means -// extend as much as possible. -func (i *InputField) SetFieldWidth(width int) *InputField { - i.fieldWidth = width - return i -} - -// GetFieldWidth returns this primitive's field width. -func (i *InputField) GetFieldWidth() int { - return i.fieldWidth -} - -// SetMaskCharacter sets a character that masks user input on a screen. A value -// of 0 disables masking. -func (i *InputField) SetMaskCharacter(mask rune) *InputField { - i.maskCharacter = mask - return i -} - -// SetAutocompleteFunc sets an autocomplete callback function which may return -// strings to be selected from a drop-down based on the current text of the -// input field. The drop-down appears only if len(entries) > 0. The callback is -// invoked in this function and whenever the current text changes or when -// Autocomplete() is called. Entries are cleared when the user selects an entry -// or presses Escape. -func (i *InputField) SetAutocompleteFunc(callback func(currentText string) (entries []string)) *InputField { - i.autocomplete = callback - i.Autocomplete() - return i -} - -// Autocomplete invokes the autocomplete callback (if there is one). If the -// length of the returned autocomplete entries slice is greater than 0, the -// input field will present the user with a corresponding drop-down list the -// next time the input field is drawn. -// -// It is safe to call this function from any goroutine. Note that the input -// field is not redrawn automatically unless called from the main goroutine -// (e.g. in response to events). -func (i *InputField) Autocomplete() *InputField { - i.autocompleteListMutex.Lock() - defer i.autocompleteListMutex.Unlock() - if i.autocomplete == nil { - return i - } - - // Do we have any autocomplete entries? - entries := i.autocomplete(i.text) - if len(entries) == 0 { - // No entries, no list. - i.autocompleteList = nil - return i - } - - // Make a list if we have none. - if i.autocompleteList == nil { - i.autocompleteList = NewList() - i.autocompleteList.ShowSecondaryText(false). - SetMainTextColor(Styles.PrimitiveBackgroundColor). - SetSelectedTextColor(Styles.PrimitiveBackgroundColor). - SetSelectedBackgroundColor(Styles.PrimaryTextColor). - SetHighlightFullLine(true). - SetBackgroundColor(Styles.MoreContrastBackgroundColor) - } - - // Fill it with the entries. - currentEntry := -1 - i.autocompleteList.Clear() - for index, entry := range entries { - i.autocompleteList.AddItem(entry, "", 0, nil) - if currentEntry < 0 && entry == i.text { - currentEntry = index - } - } - - // Set the selection if we have one. - if currentEntry >= 0 { - i.autocompleteList.SetCurrentItem(currentEntry) - } - - return i -} - -// SetAcceptanceFunc sets a handler which may reject the last character that was -// entered (by returning false). -// -// This package defines a number of variables prefixed with InputField which may -// be used for common input (e.g. numbers, maximum text length). -func (i *InputField) SetAcceptanceFunc(handler func(textToCheck string, lastChar rune) bool) *InputField { - i.accept = handler - return i -} - -// SetChangedFunc sets a handler which is called whenever the text of the input -// field has changed. It receives the current text (after the change). -func (i *InputField) SetChangedFunc(handler func(text string)) *InputField { - i.changed = handler - return i -} - -// SetDoneFunc sets a handler which is called when the user is done entering -// text. The callback function is provided with the key that was pressed, which -// is one of the following: -// -// - KeyEnter: Done entering text. -// - KeyEscape: Abort text input. -// - KeyTab: Move to the next field. -// - KeyBacktab: Move to the previous field. -func (i *InputField) SetDoneFunc(handler func(key tcell.Key)) *InputField { - i.done = handler - return i -} - -// SetFinishedFunc sets a callback invoked when the user leaves this form item. -func (i *InputField) SetFinishedFunc(handler func(key tcell.Key)) FormItem { - i.finished = handler - return i -} - -// Draw draws this primitive onto the screen. -func (i *InputField) Draw(screen tcell.Screen) { - i.Box.Draw(screen) - - // Prepare - x, y, width, height := i.GetInnerRect() - rightLimit := x + width - if height < 1 || rightLimit <= x { - return - } - - // Draw label. - if i.labelWidth > 0 { - labelWidth := i.labelWidth - if labelWidth > rightLimit-x { - labelWidth = rightLimit - x - } - Print(screen, i.label, x, y, labelWidth, AlignLeft, i.labelColor) - x += labelWidth - } else { - _, drawnWidth := Print(screen, i.label, x, y, rightLimit-x, AlignLeft, i.labelColor) - x += drawnWidth - } - - // Draw input area. - i.fieldX = x - fieldWidth := i.fieldWidth - if fieldWidth == 0 { - fieldWidth = math.MaxInt32 - } - if rightLimit-x < fieldWidth { - fieldWidth = rightLimit - x - } - fieldStyle := tcell.StyleDefault.Background(i.fieldBackgroundColor) - for index := 0; index < fieldWidth; index++ { - screen.SetContent(x+index, y, ' ', nil, fieldStyle) - } - - // Text. - var cursorScreenPos int - text := i.text - if text == "" && i.placeholder != "" { - // Draw placeholder text. - Print(screen, Escape(i.placeholder), x, y, fieldWidth, AlignLeft, i.placeholderTextColor) - i.offset = 0 - } else { - // Draw entered text. - if i.maskCharacter > 0 { - text = strings.Repeat(string(i.maskCharacter), utf8.RuneCountInString(i.text)) - } - if fieldWidth >= stringWidth(text) { - // We have enough space for the full text. - Print(screen, Escape(text), x, y, fieldWidth, AlignLeft, i.fieldTextColor) - i.offset = 0 - iterateString(text, func(main rune, comb []rune, textPos, textWidth, screenPos, screenWidth int) bool { - if textPos >= i.cursorPos { - return true - } - cursorScreenPos += screenWidth - return false - }) - } else { - // The text doesn't fit. Where is the cursor? - if i.cursorPos < 0 { - i.cursorPos = 0 - } else if i.cursorPos > len(text) { - i.cursorPos = len(text) - } - // Shift the text so the cursor is inside the field. - var shiftLeft int - if i.offset > i.cursorPos { - i.offset = i.cursorPos - } else if subWidth := stringWidth(text[i.offset:i.cursorPos]); subWidth > fieldWidth-1 { - shiftLeft = subWidth - fieldWidth + 1 - } - currentOffset := i.offset - iterateString(text, func(main rune, comb []rune, textPos, textWidth, screenPos, screenWidth int) bool { - if textPos >= currentOffset { - if shiftLeft > 0 { - i.offset = textPos + textWidth - shiftLeft -= screenWidth - } else { - if textPos+textWidth > i.cursorPos { - return true - } - cursorScreenPos += screenWidth - } - } - return false - }) - Print(screen, Escape(text[i.offset:]), x, y, fieldWidth, AlignLeft, i.fieldTextColor) - } - } - - // Draw autocomplete list. - i.autocompleteListMutex.Lock() - defer i.autocompleteListMutex.Unlock() - if i.autocompleteList != nil { - // How much space do we need? - lheight := i.autocompleteList.GetItemCount() - lwidth := 0 - for index := 0; index < lheight; index++ { - entry, _ := i.autocompleteList.GetItemText(index) - width := TaggedStringWidth(entry) - if width > lwidth { - lwidth = width - } - } - - // We prefer to drop down but if there is no space, maybe drop up? - lx := x - ly := y + 1 - _, sheight := screen.Size() - if ly+lheight >= sheight && ly-2 > lheight-ly { - ly = y - lheight - if ly < 0 { - ly = 0 - } - } - if ly+lheight >= sheight { - lheight = sheight - ly - } - i.autocompleteList.SetRect(lx, ly, lwidth, lheight) - i.autocompleteList.Draw(screen) - } - - // Set cursor. - if i.focus.HasFocus() { - screen.ShowCursor(x+cursorScreenPos, y) - } -} - -// InputHandler returns the handler for this primitive. -func (i *InputField) InputHandler() func(event *tcell.EventKey, setFocus func(p Primitive)) { - return i.WrapInputHandler(func(event *tcell.EventKey, setFocus func(p Primitive)) { - // Trigger changed events. - currentText := i.text - defer func() { - if i.text != currentText { - i.Autocomplete() - if i.changed != nil { - i.changed(i.text) - } - } - }() - - // Movement functions. - home := func() { i.cursorPos = 0 } - end := func() { i.cursorPos = len(i.text) } - moveLeft := func() { - iterateStringReverse(i.text[:i.cursorPos], func(main rune, comb []rune, textPos, textWidth, screenPos, screenWidth int) bool { - i.cursorPos -= textWidth - return true - }) - } - moveRight := func() { - iterateString(i.text[i.cursorPos:], func(main rune, comb []rune, textPos, textWidth, screenPos, screenWidth int) bool { - i.cursorPos += textWidth - return true - }) - } - moveWordLeft := func() { - i.cursorPos = len(regexp.MustCompile(`\S+\s*$`).ReplaceAllString(i.text[:i.cursorPos], "")) - } - moveWordRight := func() { - i.cursorPos = len(i.text) - len(regexp.MustCompile(`^\s*\S+\s*`).ReplaceAllString(i.text[i.cursorPos:], "")) - } - - // Add character function. Returns whether or not the rune character is - // accepted. - add := func(r rune) bool { - newText := i.text[:i.cursorPos] + string(r) + i.text[i.cursorPos:] - if i.accept != nil && !i.accept(newText, r) { - return false - } - i.text = newText - i.cursorPos += len(string(r)) - return true - } - - // Finish up. - finish := func(key tcell.Key) { - if i.done != nil { - i.done(key) - } - if i.finished != nil { - i.finished(key) - } - } - - // Process key event. - i.autocompleteListMutex.Lock() - defer i.autocompleteListMutex.Unlock() - switch key := event.Key(); key { - case tcell.KeyRune: // Regular character. - if event.Modifiers()&tcell.ModAlt > 0 { - // We accept some Alt- key combinations. - switch event.Rune() { - case 'a': // Home. - home() - case 'e': // End. - end() - case 'b': // Move word left. - moveWordLeft() - case 'f': // Move word right. - moveWordRight() - default: - if !add(event.Rune()) { - return - } - } - } else { - // Other keys are simply accepted as regular characters. - if !add(event.Rune()) { - return - } - } - case tcell.KeyCtrlU: // Delete all. - i.text = "" - i.cursorPos = 0 - case tcell.KeyCtrlK: // Delete until the end of the line. - i.text = i.text[:i.cursorPos] - case tcell.KeyCtrlW: // Delete last word. - lastWord := regexp.MustCompile(`\S+\s*$`) - newText := lastWord.ReplaceAllString(i.text[:i.cursorPos], "") + i.text[i.cursorPos:] - i.cursorPos -= len(i.text) - len(newText) - i.text = newText - case tcell.KeyBackspace, tcell.KeyBackspace2: // Delete character before the cursor. - iterateStringReverse(i.text[:i.cursorPos], func(main rune, comb []rune, textPos, textWidth, screenPos, screenWidth int) bool { - i.text = i.text[:textPos] + i.text[textPos+textWidth:] - i.cursorPos -= textWidth - return true - }) - if i.offset >= i.cursorPos { - i.offset = 0 - } - case tcell.KeyDelete: // Delete character after the cursor. - iterateString(i.text[i.cursorPos:], func(main rune, comb []rune, textPos, textWidth, screenPos, screenWidth int) bool { - i.text = i.text[:i.cursorPos] + i.text[i.cursorPos+textWidth:] - return true - }) - case tcell.KeyLeft: - if event.Modifiers()&tcell.ModAlt > 0 { - moveWordLeft() - } else { - moveLeft() - } - case tcell.KeyRight: - if event.Modifiers()&tcell.ModAlt > 0 { - moveWordRight() - } else { - moveRight() - } - case tcell.KeyHome, tcell.KeyCtrlA: - home() - case tcell.KeyEnd, tcell.KeyCtrlE: - end() - case tcell.KeyEnter, tcell.KeyEscape: // We might be done. - if i.autocompleteList != nil { - i.autocompleteList = nil - } else { - finish(key) - } - case tcell.KeyDown, tcell.KeyTab: // Autocomplete selection. - if i.autocompleteList != nil { - count := i.autocompleteList.GetItemCount() - newEntry := i.autocompleteList.GetCurrentItem() + 1 - if newEntry >= count { - newEntry = 0 - } - i.autocompleteList.SetCurrentItem(newEntry) - currentText, _ = i.autocompleteList.GetItemText(newEntry) // Don't trigger changed function twice. - i.SetText(currentText) - } else { - finish(key) - } - case tcell.KeyUp, tcell.KeyBacktab: // Autocomplete selection. - if i.autocompleteList != nil { - newEntry := i.autocompleteList.GetCurrentItem() - 1 - if newEntry < 0 { - newEntry = i.autocompleteList.GetItemCount() - 1 - } - i.autocompleteList.SetCurrentItem(newEntry) - currentText, _ = i.autocompleteList.GetItemText(newEntry) // Don't trigger changed function twice. - i.SetText(currentText) - } else { - finish(key) - } - } - }) -} - -// MouseHandler returns the mouse handler for this primitive. -func (i *InputField) MouseHandler() func(action MouseAction, event *tcell.EventMouse, setFocus func(p Primitive)) (consumed bool, capture Primitive) { - return i.WrapMouseHandler(func(action MouseAction, event *tcell.EventMouse, setFocus func(p Primitive)) (consumed bool, capture Primitive) { - x, y := event.Position() - _, rectY, _, _ := i.GetInnerRect() - if !i.InRect(x, y) { - return false, nil - } - - // Process mouse event. - if action == MouseLeftClick && y == rectY { - // Determine where to place the cursor. - if x >= i.fieldX { - if !iterateString(i.text[i.offset:], func(main rune, comb []rune, textPos int, textWidth int, screenPos int, screenWidth int) bool { - if x-i.fieldX < screenPos+screenWidth { - i.cursorPos = textPos + i.offset - return true - } - return false - }) { - i.cursorPos = len(i.text) - } - } - setFocus(i) - consumed = true - } - - return - }) -} diff --git a/vendor/github.com/rivo/tview/list.go b/vendor/github.com/rivo/tview/list.go deleted file mode 100644 index 692eb117..00000000 --- a/vendor/github.com/rivo/tview/list.go +++ /dev/null @@ -1,628 +0,0 @@ -package tview - -import ( - "fmt" - "strings" - - "github.com/gdamore/tcell" -) - -// listItem represents one item in a List. -type listItem struct { - MainText string // The main text of the list item. - SecondaryText string // A secondary text to be shown underneath the main text. - Shortcut rune // The key to select the list item directly, 0 if there is no shortcut. - Selected func() // The optional function which is called when the item is selected. -} - -// List displays rows of items, each of which can be selected. -// -// See https://github.com/rivo/tview/wiki/List for an example. -type List struct { - *Box - - // The items of the list. - items []*listItem - - // The index of the currently selected item. - currentItem int - - // Whether or not to show the secondary item texts. - showSecondaryText bool - - // The item main text color. - mainTextColor tcell.Color - - // The item secondary text color. - secondaryTextColor tcell.Color - - // The item shortcut text color. - shortcutColor tcell.Color - - // The text color for selected items. - selectedTextColor tcell.Color - - // The background color for selected items. - selectedBackgroundColor tcell.Color - - // If true, the selection is only shown when the list has focus. - selectedFocusOnly bool - - // If true, the entire row is highlighted when selected. - highlightFullLine bool - - // Whether or not navigating the list will wrap around. - wrapAround bool - - // The number of list items skipped at the top before the first item is drawn. - offset int - - // An optional function which is called when the user has navigated to a list - // item. - changed func(index int, mainText, secondaryText string, shortcut rune) - - // An optional function which is called when a list item was selected. This - // function will be called even if the list item defines its own callback. - selected func(index int, mainText, secondaryText string, shortcut rune) - - // An optional function which is called when the user presses the Escape key. - done func() -} - -// NewList returns a new form. -func NewList() *List { - return &List{ - Box: NewBox(), - showSecondaryText: true, - wrapAround: true, - mainTextColor: Styles.PrimaryTextColor, - secondaryTextColor: Styles.TertiaryTextColor, - shortcutColor: Styles.SecondaryTextColor, - selectedTextColor: Styles.PrimitiveBackgroundColor, - selectedBackgroundColor: Styles.PrimaryTextColor, - } -} - -// SetCurrentItem sets the currently selected item by its index, starting at 0 -// for the first item. If a negative index is provided, items are referred to -// from the back (-1 = last item, -2 = second-to-last item, and so on). Out of -// range indices are clamped to the beginning/end. -// -// Calling this function triggers a "changed" event if the selection changes. -func (l *List) SetCurrentItem(index int) *List { - if index < 0 { - index = len(l.items) + index - } - if index >= len(l.items) { - index = len(l.items) - 1 - } - if index < 0 { - index = 0 - } - - if index != l.currentItem && l.changed != nil { - item := l.items[index] - l.changed(index, item.MainText, item.SecondaryText, item.Shortcut) - } - - l.currentItem = index - - return l -} - -// GetCurrentItem returns the index of the currently selected list item, -// starting at 0 for the first item. -func (l *List) GetCurrentItem() int { - return l.currentItem -} - -// RemoveItem removes the item with the given index (starting at 0) from the -// list. If a negative index is provided, items are referred to from the back -// (-1 = last item, -2 = second-to-last item, and so on). Out of range indices -// are clamped to the beginning/end, i.e. unless the list is empty, an item is -// always removed. -// -// The currently selected item is shifted accordingly. If it is the one that is -// removed, a "changed" event is fired. -func (l *List) RemoveItem(index int) *List { - if len(l.items) == 0 { - return l - } - - // Adjust index. - if index < 0 { - index = len(l.items) + index - } - if index >= len(l.items) { - index = len(l.items) - 1 - } - if index < 0 { - index = 0 - } - - // Remove item. - l.items = append(l.items[:index], l.items[index+1:]...) - - // If there is nothing left, we're done. - if len(l.items) == 0 { - return l - } - - // Shift current item. - previousCurrentItem := l.currentItem - if l.currentItem >= index { - l.currentItem-- - } - - // Fire "changed" event for removed items. - if previousCurrentItem == index && l.changed != nil { - item := l.items[l.currentItem] - l.changed(l.currentItem, item.MainText, item.SecondaryText, item.Shortcut) - } - - return l -} - -// SetMainTextColor sets the color of the items' main text. -func (l *List) SetMainTextColor(color tcell.Color) *List { - l.mainTextColor = color - return l -} - -// SetSecondaryTextColor sets the color of the items' secondary text. -func (l *List) SetSecondaryTextColor(color tcell.Color) *List { - l.secondaryTextColor = color - return l -} - -// SetShortcutColor sets the color of the items' shortcut. -func (l *List) SetShortcutColor(color tcell.Color) *List { - l.shortcutColor = color - return l -} - -// SetSelectedTextColor sets the text color of selected items. -func (l *List) SetSelectedTextColor(color tcell.Color) *List { - l.selectedTextColor = color - return l -} - -// SetSelectedBackgroundColor sets the background color of selected items. -func (l *List) SetSelectedBackgroundColor(color tcell.Color) *List { - l.selectedBackgroundColor = color - return l -} - -// SetSelectedFocusOnly sets a flag which determines when the currently selected -// list item is highlighted. If set to true, selected items are only highlighted -// when the list has focus. If set to false, they are always highlighted. -func (l *List) SetSelectedFocusOnly(focusOnly bool) *List { - l.selectedFocusOnly = focusOnly - return l -} - -// SetHighlightFullLine sets a flag which determines whether the colored -// background of selected items spans the entire width of the view. If set to -// true, the highlight spans the entire view. If set to false, only the text of -// the selected item from beginning to end is highlighted. -func (l *List) SetHighlightFullLine(highlight bool) *List { - l.highlightFullLine = highlight - return l -} - -// ShowSecondaryText determines whether or not to show secondary item texts. -func (l *List) ShowSecondaryText(show bool) *List { - l.showSecondaryText = show - return l -} - -// SetWrapAround sets the flag that determines whether navigating the list will -// wrap around. That is, navigating downwards on the last item will move the -// selection to the first item (similarly in the other direction). If set to -// false, the selection won't change when navigating downwards on the last item -// or navigating upwards on the first item. -func (l *List) SetWrapAround(wrapAround bool) *List { - l.wrapAround = wrapAround - return l -} - -// SetChangedFunc sets the function which is called when the user navigates to -// a list item. The function receives the item's index in the list of items -// (starting with 0), its main text, secondary text, and its shortcut rune. -// -// This function is also called when the first item is added or when -// SetCurrentItem() is called. -func (l *List) SetChangedFunc(handler func(index int, mainText string, secondaryText string, shortcut rune)) *List { - l.changed = handler - return l -} - -// SetSelectedFunc sets the function which is called when the user selects a -// list item by pressing Enter on the current selection. The function receives -// the item's index in the list of items (starting with 0), its main text, -// secondary text, and its shortcut rune. -func (l *List) SetSelectedFunc(handler func(int, string, string, rune)) *List { - l.selected = handler - return l -} - -// SetDoneFunc sets a function which is called when the user presses the Escape -// key. -func (l *List) SetDoneFunc(handler func()) *List { - l.done = handler - return l -} - -// AddItem calls InsertItem() with an index of -1. -func (l *List) AddItem(mainText, secondaryText string, shortcut rune, selected func()) *List { - l.InsertItem(-1, mainText, secondaryText, shortcut, selected) - return l -} - -// InsertItem adds a new item to the list at the specified index. An index of 0 -// will insert the item at the beginning, an index of 1 before the second item, -// and so on. An index of GetItemCount() or higher will insert the item at the -// end of the list. Negative indices are also allowed: An index of -1 will -// insert the item at the end of the list, an index of -2 before the last item, -// and so on. An index of -GetItemCount()-1 or lower will insert the item at the -// beginning. -// -// An item has a main text which will be highlighted when selected. It also has -// a secondary text which is shown underneath the main text (if it is set to -// visible) but which may remain empty. -// -// The shortcut is a key binding. If the specified rune is entered, the item -// is selected immediately. Set to 0 for no binding. -// -// The "selected" callback will be invoked when the user selects the item. You -// may provide nil if no such callback is needed or if all events are handled -// through the selected callback set with SetSelectedFunc(). -// -// The currently selected item will shift its position accordingly. If the list -// was previously empty, a "changed" event is fired because the new item becomes -// selected. -func (l *List) InsertItem(index int, mainText, secondaryText string, shortcut rune, selected func()) *List { - item := &listItem{ - MainText: mainText, - SecondaryText: secondaryText, - Shortcut: shortcut, - Selected: selected, - } - - // Shift index to range. - if index < 0 { - index = len(l.items) + index + 1 - } - if index < 0 { - index = 0 - } else if index > len(l.items) { - index = len(l.items) - } - - // Shift current item. - if l.currentItem < len(l.items) && l.currentItem >= index { - l.currentItem++ - } - - // Insert item (make space for the new item, then shift and insert). - l.items = append(l.items, nil) - if index < len(l.items)-1 { // -1 because l.items has already grown by one item. - copy(l.items[index+1:], l.items[index:]) - } - l.items[index] = item - - // Fire a "change" event for the first item in the list. - if len(l.items) == 1 && l.changed != nil { - item := l.items[0] - l.changed(0, item.MainText, item.SecondaryText, item.Shortcut) - } - - return l -} - -// GetItemCount returns the number of items in the list. -func (l *List) GetItemCount() int { - return len(l.items) -} - -// GetItemText returns an item's texts (main and secondary). Panics if the index -// is out of range. -func (l *List) GetItemText(index int) (main, secondary string) { - return l.items[index].MainText, l.items[index].SecondaryText -} - -// SetItemText sets an item's main and secondary text. Panics if the index is -// out of range. -func (l *List) SetItemText(index int, main, secondary string) *List { - item := l.items[index] - item.MainText = main - item.SecondaryText = secondary - return l -} - -// FindItems searches the main and secondary texts for the given strings and -// returns a list of item indices in which those strings are found. One of the -// two search strings may be empty, it will then be ignored. Indices are always -// returned in ascending order. -// -// If mustContainBoth is set to true, mainSearch must be contained in the main -// text AND secondarySearch must be contained in the secondary text. If it is -// false, only one of the two search strings must be contained. -// -// Set ignoreCase to true for case-insensitive search. -func (l *List) FindItems(mainSearch, secondarySearch string, mustContainBoth, ignoreCase bool) (indices []int) { - if mainSearch == "" && secondarySearch == "" { - return - } - - if ignoreCase { - mainSearch = strings.ToLower(mainSearch) - secondarySearch = strings.ToLower(secondarySearch) - } - - for index, item := range l.items { - mainText := item.MainText - secondaryText := item.SecondaryText - if ignoreCase { - mainText = strings.ToLower(mainText) - secondaryText = strings.ToLower(secondaryText) - } - - // strings.Contains() always returns true for a "" search. - mainContained := strings.Contains(mainText, mainSearch) - secondaryContained := strings.Contains(secondaryText, secondarySearch) - if mustContainBoth && mainContained && secondaryContained || - !mustContainBoth && (mainText != "" && mainContained || secondaryText != "" && secondaryContained) { - indices = append(indices, index) - } - } - - return -} - -// Clear removes all items from the list. -func (l *List) Clear() *List { - l.items = nil - l.currentItem = 0 - return l -} - -// Draw draws this primitive onto the screen. -func (l *List) Draw(screen tcell.Screen) { - l.Box.Draw(screen) - - // Determine the dimensions. - x, y, width, height := l.GetInnerRect() - bottomLimit := y + height - _, totalHeight := screen.Size() - if bottomLimit > totalHeight { - bottomLimit = totalHeight - } - - // Do we show any shortcuts? - var showShortcuts bool - for _, item := range l.items { - if item.Shortcut != 0 { - showShortcuts = true - x += 4 - width -= 4 - break - } - } - - // Adjust offset to keep the current selection in view. - if l.currentItem < l.offset { - l.offset = l.currentItem - } else if l.showSecondaryText { - if 2*(l.currentItem-l.offset) >= height-1 { - l.offset = (2*l.currentItem + 3 - height) / 2 - } - } else { - if l.currentItem-l.offset >= height { - l.offset = l.currentItem + 1 - height - } - } - - // Draw the list items. - for index, item := range l.items { - if index < l.offset { - continue - } - - if y >= bottomLimit { - break - } - - // Shortcuts. - if showShortcuts && item.Shortcut != 0 { - Print(screen, fmt.Sprintf("(%s)", string(item.Shortcut)), x-5, y, 4, AlignRight, l.shortcutColor) - } - - // Main text. - Print(screen, item.MainText, x, y, width, AlignLeft, l.mainTextColor) - - // Background color of selected text. - if index == l.currentItem && (!l.selectedFocusOnly || l.HasFocus()) { - textWidth := width - if !l.highlightFullLine { - if w := TaggedStringWidth(item.MainText); w < textWidth { - textWidth = w - } - } - - for bx := 0; bx < textWidth; bx++ { - m, c, style, _ := screen.GetContent(x+bx, y) - fg, _, _ := style.Decompose() - if fg == l.mainTextColor { - fg = l.selectedTextColor - } - style = style.Background(l.selectedBackgroundColor).Foreground(fg) - screen.SetContent(x+bx, y, m, c, style) - } - } - - y++ - - if y >= bottomLimit { - break - } - - // Secondary text. - if l.showSecondaryText { - Print(screen, item.SecondaryText, x, y, width, AlignLeft, l.secondaryTextColor) - y++ - } - } -} - -// InputHandler returns the handler for this primitive. -func (l *List) InputHandler() func(event *tcell.EventKey, setFocus func(p Primitive)) { - return l.WrapInputHandler(func(event *tcell.EventKey, setFocus func(p Primitive)) { - if event.Key() == tcell.KeyEscape { - if l.done != nil { - l.done() - } - return - } else if len(l.items) == 0 { - return - } - - previousItem := l.currentItem - - switch key := event.Key(); key { - case tcell.KeyTab, tcell.KeyDown, tcell.KeyRight: - l.currentItem++ - case tcell.KeyBacktab, tcell.KeyUp, tcell.KeyLeft: - l.currentItem-- - case tcell.KeyHome: - l.currentItem = 0 - case tcell.KeyEnd: - l.currentItem = len(l.items) - 1 - case tcell.KeyPgDn: - _, _, _, height := l.GetInnerRect() - l.currentItem += height - case tcell.KeyPgUp: - _, _, _, height := l.GetInnerRect() - l.currentItem -= height - case tcell.KeyEnter: - if l.currentItem >= 0 && l.currentItem < len(l.items) { - item := l.items[l.currentItem] - if item.Selected != nil { - item.Selected() - } - if l.selected != nil { - l.selected(l.currentItem, item.MainText, item.SecondaryText, item.Shortcut) - } - } - case tcell.KeyRune: - ch := event.Rune() - if ch != ' ' { - // It's not a space bar. Is it a shortcut? - var found bool - for index, item := range l.items { - if item.Shortcut == ch { - // We have a shortcut. - found = true - l.currentItem = index - break - } - } - if !found { - break - } - } - item := l.items[l.currentItem] - if item.Selected != nil { - item.Selected() - } - if l.selected != nil { - l.selected(l.currentItem, item.MainText, item.SecondaryText, item.Shortcut) - } - } - - if l.currentItem < 0 { - if l.wrapAround { - l.currentItem = len(l.items) - 1 - } else { - l.currentItem = 0 - } - } else if l.currentItem >= len(l.items) { - if l.wrapAround { - l.currentItem = 0 - } else { - l.currentItem = len(l.items) - 1 - } - } - - if l.currentItem != previousItem && l.currentItem < len(l.items) && l.changed != nil { - item := l.items[l.currentItem] - l.changed(l.currentItem, item.MainText, item.SecondaryText, item.Shortcut) - } - }) -} - -// indexAtPoint returns the index of the list item found at the given position -// or a negative value if there is no such list item. -func (l *List) indexAtPoint(x, y int) int { - rectX, rectY, width, height := l.GetInnerRect() - if rectX < 0 || rectX >= rectX+width || y < rectY || y >= rectY+height { - return -1 - } - - index := y - rectY - if l.showSecondaryText { - index /= 2 - } - index += l.offset - - if index >= len(l.items) { - return -1 - } - return index -} - -// MouseHandler returns the mouse handler for this primitive. -func (l *List) MouseHandler() func(action MouseAction, event *tcell.EventMouse, setFocus func(p Primitive)) (consumed bool, capture Primitive) { - return l.WrapMouseHandler(func(action MouseAction, event *tcell.EventMouse, setFocus func(p Primitive)) (consumed bool, capture Primitive) { - if !l.InRect(event.Position()) { - return false, nil - } - - // Process mouse event. - switch action { - case MouseLeftClick: - setFocus(l) - index := l.indexAtPoint(event.Position()) - if index != -1 { - item := l.items[index] - if item.Selected != nil { - item.Selected() - } - if l.selected != nil { - l.selected(index, item.MainText, item.SecondaryText, item.Shortcut) - } - if index != l.currentItem && l.changed != nil { - l.changed(index, item.MainText, item.SecondaryText, item.Shortcut) - } - l.currentItem = index - } - consumed = true - case MouseScrollUp: - if l.offset > 0 { - l.offset-- - } - consumed = true - case MouseScrollDown: - lines := len(l.items) - l.offset - if l.showSecondaryText { - lines *= 2 - } - if _, _, _, height := l.GetInnerRect(); lines > height { - l.offset++ - } - consumed = true - } - - return - }) -} diff --git a/vendor/github.com/rivo/tview/modal.go b/vendor/github.com/rivo/tview/modal.go deleted file mode 100644 index f5341132..00000000 --- a/vendor/github.com/rivo/tview/modal.go +++ /dev/null @@ -1,190 +0,0 @@ -package tview - -import ( - "github.com/gdamore/tcell" -) - -// Modal is a centered message window used to inform the user or prompt them -// for an immediate decision. It needs to have at least one button (added via -// AddButtons()) or it will never disappear. -// -// See https://github.com/rivo/tview/wiki/Modal for an example. -type Modal struct { - *Box - - // The frame embedded in the modal. - frame *Frame - - // The form embedded in the modal's frame. - form *Form - - // The message text (original, not word-wrapped). - text string - - // The text color. - textColor tcell.Color - - // The optional callback for when the user clicked one of the buttons. It - // receives the index of the clicked button and the button's label. - done func(buttonIndex int, buttonLabel string) -} - -// NewModal returns a new modal message window. -func NewModal() *Modal { - m := &Modal{ - Box: NewBox(), - textColor: Styles.PrimaryTextColor, - } - m.form = NewForm(). - SetButtonsAlign(AlignCenter). - SetButtonBackgroundColor(Styles.PrimitiveBackgroundColor). - SetButtonTextColor(Styles.PrimaryTextColor) - m.form.SetBackgroundColor(Styles.ContrastBackgroundColor).SetBorderPadding(0, 0, 0, 0) - m.form.SetCancelFunc(func() { - if m.done != nil { - m.done(-1, "") - } - }) - m.frame = NewFrame(m.form).SetBorders(0, 0, 1, 0, 0, 0) - m.frame.SetBorder(true). - SetBackgroundColor(Styles.ContrastBackgroundColor). - SetBorderPadding(1, 1, 1, 1) - m.focus = m - return m -} - -// SetBackgroundColor sets the color of the modal frame background. -func (m *Modal) SetBackgroundColor(color tcell.Color) *Modal { - m.form.SetBackgroundColor(color) - m.frame.SetBackgroundColor(color) - return m -} - -// SetTextColor sets the color of the message text. -func (m *Modal) SetTextColor(color tcell.Color) *Modal { - m.textColor = color - return m -} - -// SetButtonBackgroundColor sets the background color of the buttons. -func (m *Modal) SetButtonBackgroundColor(color tcell.Color) *Modal { - m.form.SetButtonBackgroundColor(color) - return m -} - -// SetButtonTextColor sets the color of the button texts. -func (m *Modal) SetButtonTextColor(color tcell.Color) *Modal { - m.form.SetButtonTextColor(color) - return m -} - -// SetDoneFunc sets a handler which is called when one of the buttons was -// pressed. It receives the index of the button as well as its label text. The -// handler is also called when the user presses the Escape key. The index will -// then be negative and the label text an emptry string. -func (m *Modal) SetDoneFunc(handler func(buttonIndex int, buttonLabel string)) *Modal { - m.done = handler - return m -} - -// SetText sets the message text of the window. The text may contain line -// breaks. Note that words are wrapped, too, based on the final size of the -// window. -func (m *Modal) SetText(text string) *Modal { - m.text = text - return m -} - -// AddButtons adds buttons to the window. There must be at least one button and -// a "done" handler so the window can be closed again. -func (m *Modal) AddButtons(labels []string) *Modal { - for index, label := range labels { - func(i int, l string) { - m.form.AddButton(label, func() { - if m.done != nil { - m.done(i, l) - } - }) - button := m.form.GetButton(m.form.GetButtonCount() - 1) - button.SetInputCapture(func(event *tcell.EventKey) *tcell.EventKey { - switch event.Key() { - case tcell.KeyDown, tcell.KeyRight: - return tcell.NewEventKey(tcell.KeyTab, 0, tcell.ModNone) - case tcell.KeyUp, tcell.KeyLeft: - return tcell.NewEventKey(tcell.KeyBacktab, 0, tcell.ModNone) - } - return event - }) - }(index, label) - } - return m -} - -// ClearButtons removes all buttons from the window. -func (m *Modal) ClearButtons() *Modal { - m.form.ClearButtons() - return m -} - -// SetFocus shifts the focus to the button with the given index. -func (m *Modal) SetFocus(index int) *Modal { - m.form.SetFocus(index) - return m -} - -// Focus is called when this primitive receives focus. -func (m *Modal) Focus(delegate func(p Primitive)) { - delegate(m.form) -} - -// HasFocus returns whether or not this primitive has focus. -func (m *Modal) HasFocus() bool { - return m.form.HasFocus() -} - -// Draw draws this primitive onto the screen. -func (m *Modal) Draw(screen tcell.Screen) { - // Calculate the width of this modal. - buttonsWidth := 0 - for _, button := range m.form.buttons { - buttonsWidth += TaggedStringWidth(button.label) + 4 + 2 - } - buttonsWidth -= 2 - screenWidth, screenHeight := screen.Size() - width := screenWidth / 3 - if width < buttonsWidth { - width = buttonsWidth - } - // width is now without the box border. - - // Reset the text and find out how wide it is. - m.frame.Clear() - lines := WordWrap(m.text, width) - for _, line := range lines { - m.frame.AddText(line, true, AlignCenter, m.textColor) - } - - // Set the modal's position and size. - height := len(lines) + 6 - width += 4 - x := (screenWidth - width) / 2 - y := (screenHeight - height) / 2 - m.SetRect(x, y, width, height) - - // Draw the frame. - m.frame.SetRect(x, y, width, height) - m.frame.Draw(screen) -} - -// MouseHandler returns the mouse handler for this primitive. -func (m *Modal) MouseHandler() func(action MouseAction, event *tcell.EventMouse, setFocus func(p Primitive)) (consumed bool, capture Primitive) { - return m.WrapMouseHandler(func(action MouseAction, event *tcell.EventMouse, setFocus func(p Primitive)) (consumed bool, capture Primitive) { - // Pass mouse events on to the form. - consumed, capture = m.form.MouseHandler()(action, event, setFocus) - if !consumed && action == MouseLeftClick && m.InRect(event.Position()) { - setFocus(m) - consumed = true - } - return - }) -} diff --git a/vendor/github.com/rivo/tview/pages.go b/vendor/github.com/rivo/tview/pages.go deleted file mode 100644 index 09550453..00000000 --- a/vendor/github.com/rivo/tview/pages.go +++ /dev/null @@ -1,302 +0,0 @@ -package tview - -import ( - "github.com/gdamore/tcell" -) - -// page represents one page of a Pages object. -type page struct { - Name string // The page's name. - Item Primitive // The page's primitive. - Resize bool // Whether or not to resize the page when it is drawn. - Visible bool // Whether or not this page is visible. -} - -// Pages is a container for other primitives often used as the application's -// root primitive. It allows to easily switch the visibility of the contained -// primitives. -// -// See https://github.com/rivo/tview/wiki/Pages for an example. -type Pages struct { - *Box - - // The contained pages. (Visible) pages are drawn from back to front. - pages []*page - - // We keep a reference to the function which allows us to set the focus to - // a newly visible page. - setFocus func(p Primitive) - - // An optional handler which is called whenever the visibility or the order of - // pages changes. - changed func() -} - -// NewPages returns a new Pages object. -func NewPages() *Pages { - p := &Pages{ - Box: NewBox(), - } - p.focus = p - return p -} - -// SetChangedFunc sets a handler which is called whenever the visibility or the -// order of any visible pages changes. This can be used to redraw the pages. -func (p *Pages) SetChangedFunc(handler func()) *Pages { - p.changed = handler - return p -} - -// GetPageCount returns the number of pages currently stored in this object. -func (p *Pages) GetPageCount() int { - return len(p.pages) -} - -// AddPage adds a new page with the given name and primitive. If there was -// previously a page with the same name, it is overwritten. Leaving the name -// empty may cause conflicts in other functions so always specify a non-empty -// name. -// -// Visible pages will be drawn in the order they were added (unless that order -// was changed in one of the other functions). If "resize" is set to true, the -// primitive will be set to the size available to the Pages primitive whenever -// the pages are drawn. -func (p *Pages) AddPage(name string, item Primitive, resize, visible bool) *Pages { - hasFocus := p.HasFocus() - for index, pg := range p.pages { - if pg.Name == name { - p.pages = append(p.pages[:index], p.pages[index+1:]...) - break - } - } - p.pages = append(p.pages, &page{Item: item, Name: name, Resize: resize, Visible: visible}) - if p.changed != nil { - p.changed() - } - if hasFocus { - p.Focus(p.setFocus) - } - return p -} - -// AddAndSwitchToPage calls AddPage(), then SwitchToPage() on that newly added -// page. -func (p *Pages) AddAndSwitchToPage(name string, item Primitive, resize bool) *Pages { - p.AddPage(name, item, resize, true) - p.SwitchToPage(name) - return p -} - -// RemovePage removes the page with the given name. If that page was the only -// visible page, visibility is assigned to the last page. -func (p *Pages) RemovePage(name string) *Pages { - var isVisible bool - hasFocus := p.HasFocus() - for index, page := range p.pages { - if page.Name == name { - isVisible = page.Visible - p.pages = append(p.pages[:index], p.pages[index+1:]...) - if page.Visible && p.changed != nil { - p.changed() - } - break - } - } - if isVisible { - for index, page := range p.pages { - if index < len(p.pages)-1 { - if page.Visible { - break // There is a remaining visible page. - } - } else { - page.Visible = true // We need at least one visible page. - } - } - } - if hasFocus { - p.Focus(p.setFocus) - } - return p -} - -// HasPage returns true if a page with the given name exists in this object. -func (p *Pages) HasPage(name string) bool { - for _, page := range p.pages { - if page.Name == name { - return true - } - } - return false -} - -// ShowPage sets a page's visibility to "true" (in addition to any other pages -// which are already visible). -func (p *Pages) ShowPage(name string) *Pages { - for _, page := range p.pages { - if page.Name == name { - page.Visible = true - if p.changed != nil { - p.changed() - } - break - } - } - if p.HasFocus() { - p.Focus(p.setFocus) - } - return p -} - -// HidePage sets a page's visibility to "false". -func (p *Pages) HidePage(name string) *Pages { - for _, page := range p.pages { - if page.Name == name { - page.Visible = false - if p.changed != nil { - p.changed() - } - break - } - } - if p.HasFocus() { - p.Focus(p.setFocus) - } - return p -} - -// SwitchToPage sets a page's visibility to "true" and all other pages' -// visibility to "false". -func (p *Pages) SwitchToPage(name string) *Pages { - for _, page := range p.pages { - if page.Name == name { - page.Visible = true - } else { - page.Visible = false - } - } - if p.changed != nil { - p.changed() - } - if p.HasFocus() { - p.Focus(p.setFocus) - } - return p -} - -// SendToFront changes the order of the pages such that the page with the given -// name comes last, causing it to be drawn last with the next update (if -// visible). -func (p *Pages) SendToFront(name string) *Pages { - for index, page := range p.pages { - if page.Name == name { - if index < len(p.pages)-1 { - p.pages = append(append(p.pages[:index], p.pages[index+1:]...), page) - } - if page.Visible && p.changed != nil { - p.changed() - } - break - } - } - if p.HasFocus() { - p.Focus(p.setFocus) - } - return p -} - -// SendToBack changes the order of the pages such that the page with the given -// name comes first, causing it to be drawn first with the next update (if -// visible). -func (p *Pages) SendToBack(name string) *Pages { - for index, pg := range p.pages { - if pg.Name == name { - if index > 0 { - p.pages = append(append([]*page{pg}, p.pages[:index]...), p.pages[index+1:]...) - } - if pg.Visible && p.changed != nil { - p.changed() - } - break - } - } - if p.HasFocus() { - p.Focus(p.setFocus) - } - return p -} - -// GetFrontPage returns the front-most visible page. If there are no visible -// pages, ("", nil) is returned. -func (p *Pages) GetFrontPage() (name string, item Primitive) { - for index := len(p.pages) - 1; index >= 0; index-- { - if p.pages[index].Visible { - return p.pages[index].Name, p.pages[index].Item - } - } - return -} - -// HasFocus returns whether or not this primitive has focus. -func (p *Pages) HasFocus() bool { - for _, page := range p.pages { - if page.Item.GetFocusable().HasFocus() { - return true - } - } - return false -} - -// Focus is called by the application when the primitive receives focus. -func (p *Pages) Focus(delegate func(p Primitive)) { - if delegate == nil { - return // We cannot delegate so we cannot focus. - } - p.setFocus = delegate - var topItem Primitive - for _, page := range p.pages { - if page.Visible { - topItem = page.Item - } - } - if topItem != nil { - delegate(topItem) - } -} - -// Draw draws this primitive onto the screen. -func (p *Pages) Draw(screen tcell.Screen) { - p.Box.Draw(screen) - for _, page := range p.pages { - if !page.Visible { - continue - } - if page.Resize { - x, y, width, height := p.GetInnerRect() - page.Item.SetRect(x, y, width, height) - } - page.Item.Draw(screen) - } -} - -// MouseHandler returns the mouse handler for this primitive. -func (p *Pages) MouseHandler() func(action MouseAction, event *tcell.EventMouse, setFocus func(p Primitive)) (consumed bool, capture Primitive) { - return p.WrapMouseHandler(func(action MouseAction, event *tcell.EventMouse, setFocus func(p Primitive)) (consumed bool, capture Primitive) { - if !p.InRect(event.Position()) { - return false, nil - } - - // Pass mouse events along to the last visible page item that takes it. - for index := len(p.pages) - 1; index >= 0; index-- { - page := p.pages[index] - if page.Visible { - consumed, capture = page.Item.MouseHandler()(action, event, setFocus) - if consumed { - return - } - } - } - - return - }) -} diff --git a/vendor/github.com/rivo/tview/primitive.go b/vendor/github.com/rivo/tview/primitive.go deleted file mode 100644 index 416d7082..00000000 --- a/vendor/github.com/rivo/tview/primitive.go +++ /dev/null @@ -1,57 +0,0 @@ -package tview - -import "github.com/gdamore/tcell" - -// Primitive is the top-most interface for all graphical primitives. -type Primitive interface { - // Draw draws this primitive onto the screen. Implementers can call the - // screen's ShowCursor() function but should only do so when they have focus. - // (They will need to keep track of this themselves.) - Draw(screen tcell.Screen) - - // GetRect returns the current position of the primitive, x, y, width, and - // height. - GetRect() (int, int, int, int) - - // SetRect sets a new position of the primitive. - SetRect(x, y, width, height int) - - // InputHandler returns a handler which receives key events when it has focus. - // It is called by the Application class. - // - // A value of nil may also be returned, in which case this primitive cannot - // receive focus and will not process any key events. - // - // The handler will receive the key event and a function that allows it to - // set the focus to a different primitive, so that future key events are sent - // to that primitive. - // - // The Application's Draw() function will be called automatically after the - // handler returns. - // - // The Box class provides functionality to intercept keyboard input. If you - // subclass from Box, it is recommended that you wrap your handler using - // Box.WrapInputHandler() so you inherit that functionality. - InputHandler() func(event *tcell.EventKey, setFocus func(p Primitive)) - - // Focus is called by the application when the primitive receives focus. - // Implementers may call delegate() to pass the focus on to another primitive. - Focus(delegate func(p Primitive)) - - // Blur is called by the application when the primitive loses focus. - Blur() - - // GetFocusable returns the item's Focusable. - GetFocusable() Focusable - - // MouseHandler returns a handler which receives mouse events. - // It is called by the Application class. - // - // A value of nil may also be returned to stop the downward propagation of - // mouse events. - // - // The Box class provides functionality to intercept mouse events. If you - // subclass from Box, it is recommended that you wrap your handler using - // Box.WrapMouseHandler() so you inherit that functionality. - MouseHandler() func(action MouseAction, event *tcell.EventMouse, setFocus func(p Primitive)) (consumed bool, capture Primitive) -} diff --git a/vendor/github.com/rivo/tview/semigraphics.go b/vendor/github.com/rivo/tview/semigraphics.go deleted file mode 100644 index 3b66c5fc..00000000 --- a/vendor/github.com/rivo/tview/semigraphics.go +++ /dev/null @@ -1,296 +0,0 @@ -package tview - -import "github.com/gdamore/tcell" - -// Semigraphics provides an easy way to access unicode characters for drawing. -// -// Named like the unicode characters, 'Semigraphics'-prefix used if unicode block -// isn't prefixed itself. -const ( - // Block: General Punctation U+2000-U+206F (http://unicode.org/charts/PDF/U2000.pdf) - SemigraphicsHorizontalEllipsis rune = '\u2026' // … - - // Block: Box Drawing U+2500-U+257F (http://unicode.org/charts/PDF/U2500.pdf) - BoxDrawingsLightHorizontal rune = '\u2500' // ─ - BoxDrawingsHeavyHorizontal rune = '\u2501' // ━ - BoxDrawingsLightVertical rune = '\u2502' // │ - BoxDrawingsHeavyVertical rune = '\u2503' // ┃ - BoxDrawingsLightTripleDashHorizontal rune = '\u2504' // ┄ - BoxDrawingsHeavyTripleDashHorizontal rune = '\u2505' // ┅ - BoxDrawingsLightTripleDashVertical rune = '\u2506' // ┆ - BoxDrawingsHeavyTripleDashVertical rune = '\u2507' // ┇ - BoxDrawingsLightQuadrupleDashHorizontal rune = '\u2508' // ┈ - BoxDrawingsHeavyQuadrupleDashHorizontal rune = '\u2509' // ┉ - BoxDrawingsLightQuadrupleDashVertical rune = '\u250a' // ┊ - BoxDrawingsHeavyQuadrupleDashVertical rune = '\u250b' // ┋ - BoxDrawingsLightDownAndRight rune = '\u250c' // ┌ - BoxDrawingsDownLighAndRightHeavy rune = '\u250d' // ┍ - BoxDrawingsDownHeavyAndRightLight rune = '\u250e' // ┎ - BoxDrawingsHeavyDownAndRight rune = '\u250f' // ┏ - BoxDrawingsLightDownAndLeft rune = '\u2510' // ┐ - BoxDrawingsDownLighAndLeftHeavy rune = '\u2511' // ┑ - BoxDrawingsDownHeavyAndLeftLight rune = '\u2512' // ┒ - BoxDrawingsHeavyDownAndLeft rune = '\u2513' // ┓ - BoxDrawingsLightUpAndRight rune = '\u2514' // └ - BoxDrawingsUpLightAndRightHeavy rune = '\u2515' // ┕ - BoxDrawingsUpHeavyAndRightLight rune = '\u2516' // ┖ - BoxDrawingsHeavyUpAndRight rune = '\u2517' // ┗ - BoxDrawingsLightUpAndLeft rune = '\u2518' // ┘ - BoxDrawingsUpLightAndLeftHeavy rune = '\u2519' // ┙ - BoxDrawingsUpHeavyAndLeftLight rune = '\u251a' // ┚ - BoxDrawingsHeavyUpAndLeft rune = '\u251b' // ┛ - BoxDrawingsLightVerticalAndRight rune = '\u251c' // ├ - BoxDrawingsVerticalLightAndRightHeavy rune = '\u251d' // ┝ - BoxDrawingsUpHeavyAndRightDownLight rune = '\u251e' // ┞ - BoxDrawingsDownHeacyAndRightUpLight rune = '\u251f' // ┟ - BoxDrawingsVerticalHeavyAndRightLight rune = '\u2520' // ┠ - BoxDrawingsDownLightAnbdRightUpHeavy rune = '\u2521' // ┡ - BoxDrawingsUpLightAndRightDownHeavy rune = '\u2522' // ┢ - BoxDrawingsHeavyVerticalAndRight rune = '\u2523' // ┣ - BoxDrawingsLightVerticalAndLeft rune = '\u2524' // ┤ - BoxDrawingsVerticalLightAndLeftHeavy rune = '\u2525' // ┥ - BoxDrawingsUpHeavyAndLeftDownLight rune = '\u2526' // ┦ - BoxDrawingsDownHeavyAndLeftUpLight rune = '\u2527' // ┧ - BoxDrawingsVerticalheavyAndLeftLight rune = '\u2528' // ┨ - BoxDrawingsDownLightAndLeftUpHeavy rune = '\u2529' // ┨ - BoxDrawingsUpLightAndLeftDownHeavy rune = '\u252a' // ┪ - BoxDrawingsHeavyVerticalAndLeft rune = '\u252b' // ┫ - BoxDrawingsLightDownAndHorizontal rune = '\u252c' // ┬ - BoxDrawingsLeftHeavyAndRightDownLight rune = '\u252d' // ┭ - BoxDrawingsRightHeavyAndLeftDownLight rune = '\u252e' // ┮ - BoxDrawingsDownLightAndHorizontalHeavy rune = '\u252f' // ┯ - BoxDrawingsDownHeavyAndHorizontalLight rune = '\u2530' // ┰ - BoxDrawingsRightLightAndLeftDownHeavy rune = '\u2531' // ┱ - BoxDrawingsLeftLightAndRightDownHeavy rune = '\u2532' // ┲ - BoxDrawingsHeavyDownAndHorizontal rune = '\u2533' // ┳ - BoxDrawingsLightUpAndHorizontal rune = '\u2534' // ┴ - BoxDrawingsLeftHeavyAndRightUpLight rune = '\u2535' // ┵ - BoxDrawingsRightHeavyAndLeftUpLight rune = '\u2536' // ┶ - BoxDrawingsUpLightAndHorizontalHeavy rune = '\u2537' // ┷ - BoxDrawingsUpHeavyAndHorizontalLight rune = '\u2538' // ┸ - BoxDrawingsRightLightAndLeftUpHeavy rune = '\u2539' // ┹ - BoxDrawingsLeftLightAndRightUpHeavy rune = '\u253a' // ┺ - BoxDrawingsHeavyUpAndHorizontal rune = '\u253b' // ┻ - BoxDrawingsLightVerticalAndHorizontal rune = '\u253c' // ┼ - BoxDrawingsLeftHeavyAndRightVerticalLight rune = '\u253d' // ┽ - BoxDrawingsRightHeavyAndLeftVerticalLight rune = '\u253e' // ┾ - BoxDrawingsVerticalLightAndHorizontalHeavy rune = '\u253f' // ┿ - BoxDrawingsUpHeavyAndDownHorizontalLight rune = '\u2540' // ╀ - BoxDrawingsDownHeavyAndUpHorizontalLight rune = '\u2541' // ╁ - BoxDrawingsVerticalHeavyAndHorizontalLight rune = '\u2542' // ╂ - BoxDrawingsLeftUpHeavyAndRightDownLight rune = '\u2543' // ╃ - BoxDrawingsRightUpHeavyAndLeftDownLight rune = '\u2544' // ╄ - BoxDrawingsLeftDownHeavyAndRightUpLight rune = '\u2545' // ╅ - BoxDrawingsRightDownHeavyAndLeftUpLight rune = '\u2546' // ╆ - BoxDrawingsDownLightAndUpHorizontalHeavy rune = '\u2547' // ╇ - BoxDrawingsUpLightAndDownHorizontalHeavy rune = '\u2548' // ╈ - BoxDrawingsRightLightAndLeftVerticalHeavy rune = '\u2549' // ╉ - BoxDrawingsLeftLightAndRightVerticalHeavy rune = '\u254a' // ╊ - BoxDrawingsHeavyVerticalAndHorizontal rune = '\u254b' // ╋ - BoxDrawingsLightDoubleDashHorizontal rune = '\u254c' // ╌ - BoxDrawingsHeavyDoubleDashHorizontal rune = '\u254d' // ╍ - BoxDrawingsLightDoubleDashVertical rune = '\u254e' // ╎ - BoxDrawingsHeavyDoubleDashVertical rune = '\u254f' // ╏ - BoxDrawingsDoubleHorizontal rune = '\u2550' // ═ - BoxDrawingsDoubleVertical rune = '\u2551' // ║ - BoxDrawingsDownSingleAndRightDouble rune = '\u2552' // ╒ - BoxDrawingsDownDoubleAndRightSingle rune = '\u2553' // ╓ - BoxDrawingsDoubleDownAndRight rune = '\u2554' // ╔ - BoxDrawingsDownSingleAndLeftDouble rune = '\u2555' // ╕ - BoxDrawingsDownDoubleAndLeftSingle rune = '\u2556' // ╖ - BoxDrawingsDoubleDownAndLeft rune = '\u2557' // ╗ - BoxDrawingsUpSingleAndRightDouble rune = '\u2558' // ╘ - BoxDrawingsUpDoubleAndRightSingle rune = '\u2559' // ╙ - BoxDrawingsDoubleUpAndRight rune = '\u255a' // ╚ - BoxDrawingsUpSingleAndLeftDouble rune = '\u255b' // ╛ - BoxDrawingsUpDobuleAndLeftSingle rune = '\u255c' // ╜ - BoxDrawingsDoubleUpAndLeft rune = '\u255d' // ╝ - BoxDrawingsVerticalSingleAndRightDouble rune = '\u255e' // ╞ - BoxDrawingsVerticalDoubleAndRightSingle rune = '\u255f' // ╟ - BoxDrawingsDoubleVerticalAndRight rune = '\u2560' // ╠ - BoxDrawingsVerticalSingleAndLeftDouble rune = '\u2561' // ╡ - BoxDrawingsVerticalDoubleAndLeftSingle rune = '\u2562' // ╢ - BoxDrawingsDoubleVerticalAndLeft rune = '\u2563' // ╣ - BoxDrawingsDownSingleAndHorizontalDouble rune = '\u2564' // ╤ - BoxDrawingsDownDoubleAndHorizontalSingle rune = '\u2565' // ╥ - BoxDrawingsDoubleDownAndHorizontal rune = '\u2566' // ╦ - BoxDrawingsUpSingleAndHorizontalDouble rune = '\u2567' // ╧ - BoxDrawingsUpDoubleAndHorizontalSingle rune = '\u2568' // ╨ - BoxDrawingsDoubleUpAndHorizontal rune = '\u2569' // ╩ - BoxDrawingsVerticalSingleAndHorizontalDouble rune = '\u256a' // ╪ - BoxDrawingsVerticalDoubleAndHorizontalSingle rune = '\u256b' // ╫ - BoxDrawingsDoubleVerticalAndHorizontal rune = '\u256c' // ╬ - BoxDrawingsLightArcDownAndRight rune = '\u256d' // ╭ - BoxDrawingsLightArcDownAndLeft rune = '\u256e' // ╮ - BoxDrawingsLightArcUpAndLeft rune = '\u256f' // ╯ - BoxDrawingsLightArcUpAndRight rune = '\u2570' // ╰ - BoxDrawingsLightDiagonalUpperRightToLowerLeft rune = '\u2571' // ╱ - BoxDrawingsLightDiagonalUpperLeftToLowerRight rune = '\u2572' // ╲ - BoxDrawingsLightDiagonalCross rune = '\u2573' // ╳ - BoxDrawingsLightLeft rune = '\u2574' // ╴ - BoxDrawingsLightUp rune = '\u2575' // ╵ - BoxDrawingsLightRight rune = '\u2576' // ╶ - BoxDrawingsLightDown rune = '\u2577' // ╷ - BoxDrawingsHeavyLeft rune = '\u2578' // ╸ - BoxDrawingsHeavyUp rune = '\u2579' // ╹ - BoxDrawingsHeavyRight rune = '\u257a' // ╺ - BoxDrawingsHeavyDown rune = '\u257b' // ╻ - BoxDrawingsLightLeftAndHeavyRight rune = '\u257c' // ╼ - BoxDrawingsLightUpAndHeavyDown rune = '\u257d' // ╽ - BoxDrawingsHeavyLeftAndLightRight rune = '\u257e' // ╾ - BoxDrawingsHeavyUpAndLightDown rune = '\u257f' // ╿ -) - -// SemigraphicJoints is a map for joining semigraphic (or otherwise) runes. -// So far only light lines are supported but if you want to change the border -// styling you need to provide the joints, too. -// The matching will be sorted ascending by rune value, so you don't need to -// provide all rune combinations, -// e.g. (─) + (│) = (┼) will also match (│) + (─) = (┼) -var SemigraphicJoints = map[string]rune{ - // (─) + (│) = (┼) - string([]rune{BoxDrawingsLightHorizontal, BoxDrawingsLightVertical}): BoxDrawingsLightVerticalAndHorizontal, - // (─) + (┌) = (┬) - string([]rune{BoxDrawingsLightHorizontal, BoxDrawingsLightDownAndRight}): BoxDrawingsLightDownAndHorizontal, - // (─) + (┐) = (┬) - string([]rune{BoxDrawingsLightHorizontal, BoxDrawingsLightDownAndLeft}): BoxDrawingsLightDownAndHorizontal, - // (─) + (└) = (┴) - string([]rune{BoxDrawingsLightHorizontal, BoxDrawingsLightUpAndRight}): BoxDrawingsLightUpAndHorizontal, - // (─) + (┘) = (┴) - string([]rune{BoxDrawingsLightHorizontal, BoxDrawingsLightUpAndLeft}): BoxDrawingsLightUpAndHorizontal, - // (─) + (├) = (┼) - string([]rune{BoxDrawingsLightHorizontal, BoxDrawingsLightVerticalAndRight}): BoxDrawingsLightVerticalAndHorizontal, - // (─) + (┤) = (┼) - string([]rune{BoxDrawingsLightHorizontal, BoxDrawingsLightVerticalAndLeft}): BoxDrawingsLightVerticalAndHorizontal, - // (─) + (┬) = (┬) - string([]rune{BoxDrawingsLightHorizontal, BoxDrawingsLightDownAndHorizontal}): BoxDrawingsLightDownAndHorizontal, - // (─) + (┴) = (┴) - string([]rune{BoxDrawingsLightHorizontal, BoxDrawingsLightUpAndHorizontal}): BoxDrawingsLightUpAndHorizontal, - // (─) + (┼) = (┼) - string([]rune{BoxDrawingsLightHorizontal, BoxDrawingsLightVerticalAndHorizontal}): BoxDrawingsLightVerticalAndHorizontal, - - // (│) + (┌) = (├) - string([]rune{BoxDrawingsLightVertical, BoxDrawingsLightDownAndRight}): BoxDrawingsLightVerticalAndRight, - // (│) + (┐) = (┤) - string([]rune{BoxDrawingsLightVertical, BoxDrawingsLightDownAndLeft}): BoxDrawingsLightVerticalAndLeft, - // (│) + (└) = (├) - string([]rune{BoxDrawingsLightVertical, BoxDrawingsLightUpAndRight}): BoxDrawingsLightVerticalAndRight, - // (│) + (┘) = (┤) - string([]rune{BoxDrawingsLightVertical, BoxDrawingsLightUpAndLeft}): BoxDrawingsLightVerticalAndLeft, - // (│) + (├) = (├) - string([]rune{BoxDrawingsLightVertical, BoxDrawingsLightVerticalAndRight}): BoxDrawingsLightVerticalAndRight, - // (│) + (┤) = (┤) - string([]rune{BoxDrawingsLightVertical, BoxDrawingsLightVerticalAndLeft}): BoxDrawingsLightVerticalAndLeft, - // (│) + (┬) = (┼) - string([]rune{BoxDrawingsLightVertical, BoxDrawingsLightDownAndHorizontal}): BoxDrawingsLightVerticalAndHorizontal, - // (│) + (┴) = (┼) - string([]rune{BoxDrawingsLightVertical, BoxDrawingsLightUpAndHorizontal}): BoxDrawingsLightVerticalAndHorizontal, - // (│) + (┼) = (┼) - string([]rune{BoxDrawingsLightVertical, BoxDrawingsLightVerticalAndHorizontal}): BoxDrawingsLightVerticalAndHorizontal, - - // (┌) + (┐) = (┬) - string([]rune{BoxDrawingsLightDownAndRight, BoxDrawingsLightDownAndLeft}): BoxDrawingsLightDownAndHorizontal, - // (┌) + (└) = (├) - string([]rune{BoxDrawingsLightDownAndRight, BoxDrawingsLightUpAndRight}): BoxDrawingsLightVerticalAndRight, - // (┌) + (┘) = (┼) - string([]rune{BoxDrawingsLightDownAndRight, BoxDrawingsLightUpAndLeft}): BoxDrawingsLightVerticalAndHorizontal, - // (┌) + (├) = (├) - string([]rune{BoxDrawingsLightDownAndRight, BoxDrawingsLightVerticalAndRight}): BoxDrawingsLightVerticalAndRight, - // (┌) + (┤) = (┼) - string([]rune{BoxDrawingsLightDownAndRight, BoxDrawingsLightVerticalAndLeft}): BoxDrawingsLightVerticalAndHorizontal, - // (┌) + (┬) = (┬) - string([]rune{BoxDrawingsLightDownAndRight, BoxDrawingsLightDownAndHorizontal}): BoxDrawingsLightDownAndHorizontal, - // (┌) + (┴) = (┼) - string([]rune{BoxDrawingsLightDownAndRight, BoxDrawingsLightUpAndHorizontal}): BoxDrawingsLightVerticalAndHorizontal, - // (┌) + (┴) = (┼) - string([]rune{BoxDrawingsLightDownAndRight, BoxDrawingsLightVerticalAndHorizontal}): BoxDrawingsLightVerticalAndHorizontal, - - // (┐) + (└) = (┼) - string([]rune{BoxDrawingsLightDownAndLeft, BoxDrawingsLightUpAndRight}): BoxDrawingsLightVerticalAndHorizontal, - // (┐) + (┘) = (┤) - string([]rune{BoxDrawingsLightDownAndLeft, BoxDrawingsLightUpAndLeft}): BoxDrawingsLightVerticalAndLeft, - // (┐) + (├) = (┼) - string([]rune{BoxDrawingsLightDownAndLeft, BoxDrawingsLightVerticalAndRight}): BoxDrawingsLightVerticalAndHorizontal, - // (┐) + (┤) = (┤) - string([]rune{BoxDrawingsLightDownAndLeft, BoxDrawingsLightVerticalAndLeft}): BoxDrawingsLightVerticalAndLeft, - // (┐) + (┬) = (┬) - string([]rune{BoxDrawingsLightDownAndLeft, BoxDrawingsLightDownAndHorizontal}): BoxDrawingsLightDownAndHorizontal, - // (┐) + (┴) = (┼) - string([]rune{BoxDrawingsLightDownAndLeft, BoxDrawingsLightUpAndHorizontal}): BoxDrawingsLightVerticalAndHorizontal, - // (┐) + (┼) = (┼) - string([]rune{BoxDrawingsLightDownAndLeft, BoxDrawingsLightVerticalAndHorizontal}): BoxDrawingsLightVerticalAndHorizontal, - - // (└) + (┘) = (┴) - string([]rune{BoxDrawingsLightUpAndRight, BoxDrawingsLightUpAndLeft}): BoxDrawingsLightUpAndHorizontal, - // (└) + (├) = (├) - string([]rune{BoxDrawingsLightUpAndRight, BoxDrawingsLightVerticalAndRight}): BoxDrawingsLightVerticalAndRight, - // (└) + (┤) = (┼) - string([]rune{BoxDrawingsLightUpAndRight, BoxDrawingsLightVerticalAndLeft}): BoxDrawingsLightVerticalAndHorizontal, - // (└) + (┬) = (┼) - string([]rune{BoxDrawingsLightUpAndRight, BoxDrawingsLightDownAndHorizontal}): BoxDrawingsLightVerticalAndHorizontal, - // (└) + (┴) = (┴) - string([]rune{BoxDrawingsLightUpAndRight, BoxDrawingsLightUpAndHorizontal}): BoxDrawingsLightUpAndHorizontal, - // (└) + (┼) = (┼) - string([]rune{BoxDrawingsLightUpAndRight, BoxDrawingsLightVerticalAndHorizontal}): BoxDrawingsLightVerticalAndHorizontal, - - // (┘) + (├) = (┼) - string([]rune{BoxDrawingsLightUpAndLeft, BoxDrawingsLightVerticalAndRight}): BoxDrawingsLightVerticalAndHorizontal, - // (┘) + (┤) = (┤) - string([]rune{BoxDrawingsLightUpAndLeft, BoxDrawingsLightVerticalAndLeft}): BoxDrawingsLightVerticalAndLeft, - // (┘) + (┬) = (┼) - string([]rune{BoxDrawingsLightUpAndLeft, BoxDrawingsLightDownAndHorizontal}): BoxDrawingsLightVerticalAndHorizontal, - // (┘) + (┴) = (┴) - string([]rune{BoxDrawingsLightUpAndLeft, BoxDrawingsLightUpAndHorizontal}): BoxDrawingsLightUpAndHorizontal, - // (┘) + (┼) = (┼) - string([]rune{BoxDrawingsLightUpAndLeft, BoxDrawingsLightVerticalAndHorizontal}): BoxDrawingsLightVerticalAndHorizontal, - - // (├) + (┤) = (┼) - string([]rune{BoxDrawingsLightVerticalAndRight, BoxDrawingsLightVerticalAndLeft}): BoxDrawingsLightVerticalAndHorizontal, - // (├) + (┬) = (┼) - string([]rune{BoxDrawingsLightVerticalAndRight, BoxDrawingsLightDownAndHorizontal}): BoxDrawingsLightVerticalAndHorizontal, - // (├) + (┴) = (┼) - string([]rune{BoxDrawingsLightVerticalAndRight, BoxDrawingsLightUpAndHorizontal}): BoxDrawingsLightVerticalAndHorizontal, - // (├) + (┼) = (┼) - string([]rune{BoxDrawingsLightVerticalAndRight, BoxDrawingsLightVerticalAndHorizontal}): BoxDrawingsLightVerticalAndHorizontal, - - // (┤) + (┬) = (┼) - string([]rune{BoxDrawingsLightVerticalAndLeft, BoxDrawingsLightDownAndHorizontal}): BoxDrawingsLightVerticalAndHorizontal, - // (┤) + (┴) = (┼) - string([]rune{BoxDrawingsLightVerticalAndLeft, BoxDrawingsLightUpAndHorizontal}): BoxDrawingsLightVerticalAndHorizontal, - // (┤) + (┼) = (┼) - string([]rune{BoxDrawingsLightVerticalAndLeft, BoxDrawingsLightVerticalAndHorizontal}): BoxDrawingsLightVerticalAndHorizontal, - - // (┬) + (┴) = (┼) - string([]rune{BoxDrawingsLightDownAndHorizontal, BoxDrawingsLightUpAndHorizontal}): BoxDrawingsLightVerticalAndHorizontal, - // (┬) + (┼) = (┼) - string([]rune{BoxDrawingsLightDownAndHorizontal, BoxDrawingsLightVerticalAndHorizontal}): BoxDrawingsLightVerticalAndHorizontal, - - // (┴) + (┼) = (┼) - string([]rune{BoxDrawingsLightUpAndHorizontal, BoxDrawingsLightVerticalAndHorizontal}): BoxDrawingsLightVerticalAndHorizontal, -} - -// PrintJoinedSemigraphics prints a semigraphics rune into the screen at the given -// position with the given color, joining it with any existing semigraphics -// rune. Background colors are preserved. At this point, only regular single -// line borders are supported. -func PrintJoinedSemigraphics(screen tcell.Screen, x, y int, ch rune, color tcell.Color) { - previous, _, style, _ := screen.GetContent(x, y) - style = style.Foreground(color) - - // What's the resulting rune? - var result rune - if ch == previous { - result = ch - } else { - if ch < previous { - previous, ch = ch, previous - } - result = SemigraphicJoints[string([]rune{previous, ch})] - } - if result == 0 { - result = ch - } - - // We only print something if we have something. - screen.SetContent(x, y, result, nil, style) -} diff --git a/vendor/github.com/rivo/tview/styles.go b/vendor/github.com/rivo/tview/styles.go deleted file mode 100644 index 4f0448f1..00000000 --- a/vendor/github.com/rivo/tview/styles.go +++ /dev/null @@ -1,35 +0,0 @@ -package tview - -import "github.com/gdamore/tcell" - -// Theme defines the colors used when primitives are initialized. -type Theme struct { - PrimitiveBackgroundColor tcell.Color // Main background color for primitives. - ContrastBackgroundColor tcell.Color // Background color for contrasting elements. - MoreContrastBackgroundColor tcell.Color // Background color for even more contrasting elements. - BorderColor tcell.Color // Box borders. - TitleColor tcell.Color // Box titles. - GraphicsColor tcell.Color // Graphics. - PrimaryTextColor tcell.Color // Primary text. - SecondaryTextColor tcell.Color // Secondary text (e.g. labels). - TertiaryTextColor tcell.Color // Tertiary text (e.g. subtitles, notes). - InverseTextColor tcell.Color // Text on primary-colored backgrounds. - ContrastSecondaryTextColor tcell.Color // Secondary text on ContrastBackgroundColor-colored backgrounds. -} - -// Styles defines the theme for applications. The default is for a black -// background and some basic colors: black, white, yellow, green, cyan, and -// blue. -var Styles = Theme{ - PrimitiveBackgroundColor: tcell.ColorBlack, - ContrastBackgroundColor: tcell.ColorBlue, - MoreContrastBackgroundColor: tcell.ColorGreen, - BorderColor: tcell.ColorWhite, - TitleColor: tcell.ColorWhite, - GraphicsColor: tcell.ColorWhite, - PrimaryTextColor: tcell.ColorWhite, - SecondaryTextColor: tcell.ColorYellow, - TertiaryTextColor: tcell.ColorGreen, - InverseTextColor: tcell.ColorBlue, - ContrastSecondaryTextColor: tcell.ColorDarkCyan, -} diff --git a/vendor/github.com/rivo/tview/table.go b/vendor/github.com/rivo/tview/table.go deleted file mode 100644 index 992ccdaa..00000000 --- a/vendor/github.com/rivo/tview/table.go +++ /dev/null @@ -1,1266 +0,0 @@ -package tview - -import ( - "sort" - - "github.com/gdamore/tcell" - colorful "github.com/lucasb-eyer/go-colorful" -) - -// TableCell represents one cell inside a Table. You can instantiate this type -// directly but all colors (background and text) will be set to their default -// which is black. -type TableCell struct { - // The reference object. - Reference interface{} - - // The text to be displayed in the table cell. - Text string - - // The alignment of the cell text. One of AlignLeft (default), AlignCenter, - // or AlignRight. - Align int - - // The maximum width of the cell in screen space. This is used to give a - // column a maximum width. Any cell text whose screen width exceeds this width - // is cut off. Set to 0 if there is no maximum width. - MaxWidth int - - // If the total table width is less than the available width, this value is - // used to add extra width to a column. See SetExpansion() for details. - Expansion int - - // The color of the cell text. - Color tcell.Color - - // The background color of the cell. - BackgroundColor tcell.Color - - // The style attributes of the cell. - Attributes tcell.AttrMask - - // If set to true, this cell cannot be selected. - NotSelectable bool - - // The position and width of the cell the last time table was drawn. - x, y, width int -} - -// NewTableCell returns a new table cell with sensible defaults. That is, left -// aligned text with the primary text color (see Styles) and a transparent -// background (using the background of the Table). -func NewTableCell(text string) *TableCell { - return &TableCell{ - Text: text, - Align: AlignLeft, - Color: Styles.PrimaryTextColor, - BackgroundColor: tcell.ColorDefault, - } -} - -// SetText sets the cell's text. -func (c *TableCell) SetText(text string) *TableCell { - c.Text = text - return c -} - -// SetAlign sets the cell's text alignment, one of AlignLeft, AlignCenter, or -// AlignRight. -func (c *TableCell) SetAlign(align int) *TableCell { - c.Align = align - return c -} - -// SetMaxWidth sets maximum width of the cell in screen space. This is used to -// give a column a maximum width. Any cell text whose screen width exceeds this -// width is cut off. Set to 0 if there is no maximum width. -func (c *TableCell) SetMaxWidth(maxWidth int) *TableCell { - c.MaxWidth = maxWidth - return c -} - -// SetExpansion sets the value by which the column of this cell expands if the -// available width for the table is more than the table width (prior to applying -// this expansion value). This is a proportional value. The amount of unused -// horizontal space is divided into widths to be added to each column. How much -// extra width a column receives depends on the expansion value: A value of 0 -// (the default) will not cause the column to increase in width. Other values -// are proportional, e.g. a value of 2 will cause a column to grow by twice -// the amount of a column with a value of 1. -// -// Since this value affects an entire column, the maximum over all visible cells -// in that column is used. -// -// This function panics if a negative value is provided. -func (c *TableCell) SetExpansion(expansion int) *TableCell { - if expansion < 0 { - panic("Table cell expansion values may not be negative") - } - c.Expansion = expansion - return c -} - -// SetTextColor sets the cell's text color. -func (c *TableCell) SetTextColor(color tcell.Color) *TableCell { - c.Color = color - return c -} - -// SetBackgroundColor sets the cell's background color. Set to -// tcell.ColorDefault to use the table's background color. -func (c *TableCell) SetBackgroundColor(color tcell.Color) *TableCell { - c.BackgroundColor = color - return c -} - -// SetAttributes sets the cell's text attributes. You can combine different -// attributes using bitmask operations: -// -// cell.SetAttributes(tcell.AttrUnderline | tcell.AttrBold) -func (c *TableCell) SetAttributes(attr tcell.AttrMask) *TableCell { - c.Attributes = attr - return c -} - -// SetStyle sets the cell's style (foreground color, background color, and -// attributes) all at once. -func (c *TableCell) SetStyle(style tcell.Style) *TableCell { - c.Color, c.BackgroundColor, c.Attributes = style.Decompose() - return c -} - -// SetSelectable sets whether or not this cell can be selected by the user. -func (c *TableCell) SetSelectable(selectable bool) *TableCell { - c.NotSelectable = !selectable - return c -} - -// SetReference allows you to store a reference of any type in this cell. This -// will allow you to establish a mapping between the cell and your -// actual data. -func (c *TableCell) SetReference(reference interface{}) *TableCell { - c.Reference = reference - return c -} - -// GetReference returns this cell's reference object. -func (c *TableCell) GetReference() interface{} { - return c.Reference -} - -// GetLastPosition returns the position of the table cell the last time it was -// drawn on screen. If the cell is not on screen, the return values are -// undefined. -// -// Because the Table class will attempt to keep selected cells on screen, this -// function is most useful in response to a "selected" event (see -// SetSelectedFunc()) or a "selectionChanged" event (see -// SetSelectionChangedFunc()). -func (c *TableCell) GetLastPosition() (x, y, width int) { - return c.x, c.y, c.width -} - -// Table visualizes two-dimensional data consisting of rows and columns. Each -// Table cell is defined via SetCell() by the TableCell type. They can be added -// dynamically to the table and changed any time. -// -// The most compact display of a table is without borders. Each row will then -// occupy one row on screen and columns are separated by the rune defined via -// SetSeparator() (a space character by default). -// -// When borders are turned on (via SetBorders()), each table cell is surrounded -// by lines. Therefore one table row will require two rows on screen. -// -// Columns will use as much horizontal space as they need. You can constrain -// their size with the MaxWidth parameter of the TableCell type. -// -// Fixed Columns -// -// You can define fixed rows and rolumns via SetFixed(). They will always stay -// in their place, even when the table is scrolled. Fixed rows are always the -// top rows. Fixed columns are always the leftmost columns. -// -// Selections -// -// You can call SetSelectable() to set columns and/or rows to "selectable". If -// the flag is set only for columns, entire columns can be selected by the user. -// If it is set only for rows, entire rows can be selected. If both flags are -// set, individual cells can be selected. The "selected" handler set via -// SetSelectedFunc() is invoked when the user presses Enter on a selection. -// -// Navigation -// -// If the table extends beyond the available space, it can be navigated with -// key bindings similar to Vim: -// -// - h, left arrow: Move left by one column. -// - l, right arrow: Move right by one column. -// - j, down arrow: Move down by one row. -// - k, up arrow: Move up by one row. -// - g, home: Move to the top. -// - G, end: Move to the bottom. -// - Ctrl-F, page down: Move down by one page. -// - Ctrl-B, page up: Move up by one page. -// -// When there is no selection, this affects the entire table (except for fixed -// rows and columns). When there is a selection, the user moves the selection. -// The class will attempt to keep the selection from moving out of the screen. -// -// Use SetInputCapture() to override or modify keyboard input. -// -// See https://github.com/rivo/tview/wiki/Table for an example. -type Table struct { - *Box - - // Whether or not this table has borders around each cell. - borders bool - - // The color of the borders or the separator. - bordersColor tcell.Color - - // If there are no borders, the column separator. - separator rune - - // The cells of the table. Rows first, then columns. - cells [][]*TableCell - - // The rightmost column in the data set. - lastColumn int - - // If true, when calculating the widths of the columns, all rows are evaluated - // instead of only the visible ones. - evaluateAllRows bool - - // The number of fixed rows / columns. - fixedRows, fixedColumns int - - // Whether or not rows or columns can be selected. If both are set to true, - // cells can be selected. - rowsSelectable, columnsSelectable bool - - // The currently selected row and column. - selectedRow, selectedColumn int - - // The number of rows/columns by which the table is scrolled down/to the - // right. - rowOffset, columnOffset int - - // If set to true, the table's last row will always be visible. - trackEnd bool - - // The number of visible rows the last time the table was drawn. - visibleRows int - - // The indices of the visible columns as of the last time the table was drawn. - visibleColumnIndices []int - - // The net widths of the visible columns as of the last time the table was - // drawn. - visibleColumnWidths []int - - // The style of the selected rows. If this value is 0, selected rows are - // simply inverted. - selectedStyle tcell.Style - - // An optional function which gets called when the user presses Enter on a - // selected cell. If entire rows selected, the column value is undefined. - // Likewise for entire columns. - selected func(row, column int) - - // An optional function which gets called when the user changes the selection. - // If entire rows selected, the column value is undefined. - // Likewise for entire columns. - selectionChanged func(row, column int) - - // An optional function which gets called when the user presses Escape, Tab, - // or Backtab. Also when the user presses Enter if nothing is selectable. - done func(key tcell.Key) -} - -// NewTable returns a new table. -func NewTable() *Table { - return &Table{ - Box: NewBox(), - bordersColor: Styles.GraphicsColor, - separator: ' ', - lastColumn: -1, - } -} - -// Clear removes all table data. -func (t *Table) Clear() *Table { - t.cells = nil - t.lastColumn = -1 - return t -} - -// SetBorders sets whether or not each cell in the table is surrounded by a -// border. -func (t *Table) SetBorders(show bool) *Table { - t.borders = show - return t -} - -// SetBordersColor sets the color of the cell borders. -func (t *Table) SetBordersColor(color tcell.Color) *Table { - t.bordersColor = color - return t -} - -// SetSelectedStyle sets a specific style for selected cells. If no such style -// is set, per default, selected cells are inverted (i.e. their foreground and -// background colors are swapped). -// -// To reset a previous setting to its default, make the following call: -// -// table.SetSelectedStyle(tcell.ColorDefault, tcell.ColorDefault, 0) -func (t *Table) SetSelectedStyle(foregroundColor, backgroundColor tcell.Color, attributes tcell.AttrMask) *Table { - t.selectedStyle = tcell.StyleDefault.Foreground(foregroundColor).Background(backgroundColor) | tcell.Style(attributes) - return t -} - -// SetSeparator sets the character used to fill the space between two -// neighboring cells. This is a space character ' ' per default but you may -// want to set it to Borders.Vertical (or any other rune) if the column -// separation should be more visible. If cell borders are activated, this is -// ignored. -// -// Separators have the same color as borders. -func (t *Table) SetSeparator(separator rune) *Table { - t.separator = separator - return t -} - -// SetFixed sets the number of fixed rows and columns which are always visible -// even when the rest of the cells are scrolled out of view. Rows are always the -// top-most ones. Columns are always the left-most ones. -func (t *Table) SetFixed(rows, columns int) *Table { - t.fixedRows, t.fixedColumns = rows, columns - return t -} - -// SetSelectable sets the flags which determine what can be selected in a table. -// There are three selection modi: -// -// - rows = false, columns = false: Nothing can be selected. -// - rows = true, columns = false: Rows can be selected. -// - rows = false, columns = true: Columns can be selected. -// - rows = true, columns = true: Individual cells can be selected. -func (t *Table) SetSelectable(rows, columns bool) *Table { - t.rowsSelectable, t.columnsSelectable = rows, columns - return t -} - -// GetSelectable returns what can be selected in a table. Refer to -// SetSelectable() for details. -func (t *Table) GetSelectable() (rows, columns bool) { - return t.rowsSelectable, t.columnsSelectable -} - -// GetSelection returns the position of the current selection. -// If entire rows are selected, the column index is undefined. -// Likewise for entire columns. -func (t *Table) GetSelection() (row, column int) { - return t.selectedRow, t.selectedColumn -} - -// Select sets the selected cell. Depending on the selection settings -// specified via SetSelectable(), this may be an entire row or column, or even -// ignored completely. The "selection changed" event is fired if such a callback -// is available (even if the selection ends up being the same as before and even -// if cells are not selectable). -func (t *Table) Select(row, column int) *Table { - t.selectedRow, t.selectedColumn = row, column - if t.selectionChanged != nil { - t.selectionChanged(row, column) - } - return t -} - -// SetOffset sets how many rows and columns should be skipped when drawing the -// table. This is useful for large tables that do not fit on the screen. -// Navigating a selection can change these values. -// -// Fixed rows and columns are never skipped. -func (t *Table) SetOffset(row, column int) *Table { - t.rowOffset, t.columnOffset = row, column - t.trackEnd = false - return t -} - -// GetOffset returns the current row and column offset. This indicates how many -// rows and columns the table is scrolled down and to the right. -func (t *Table) GetOffset() (row, column int) { - return t.rowOffset, t.columnOffset -} - -// SetEvaluateAllRows sets a flag which determines the rows to be evaluated when -// calculating the widths of the table's columns. When false, only visible rows -// are evaluated. When true, all rows in the table are evaluated. -// -// Set this flag to true to avoid shifting column widths when the table is -// scrolled. (May be slower for large tables.) -func (t *Table) SetEvaluateAllRows(all bool) *Table { - t.evaluateAllRows = all - return t -} - -// SetSelectedFunc sets a handler which is called whenever the user presses the -// Enter key on a selected cell/row/column. The handler receives the position of -// the selection and its cell contents. If entire rows are selected, the column -// index is undefined. Likewise for entire columns. -func (t *Table) SetSelectedFunc(handler func(row, column int)) *Table { - t.selected = handler - return t -} - -// SetSelectionChangedFunc sets a handler which is called whenever the current -// selection changes. The handler receives the position of the new selection. -// If entire rows are selected, the column index is undefined. Likewise for -// entire columns. -func (t *Table) SetSelectionChangedFunc(handler func(row, column int)) *Table { - t.selectionChanged = handler - return t -} - -// SetDoneFunc sets a handler which is called whenever the user presses the -// Escape, Tab, or Backtab key. If nothing is selected, it is also called when -// user presses the Enter key (because pressing Enter on a selection triggers -// the "selected" handler set via SetSelectedFunc()). -func (t *Table) SetDoneFunc(handler func(key tcell.Key)) *Table { - t.done = handler - return t -} - -// SetCell sets the content of a cell the specified position. It is ok to -// directly instantiate a TableCell object. If the cell has content, at least -// the Text and Color fields should be set. -// -// Note that setting cells in previously unknown rows and columns will -// automatically extend the internal table representation, e.g. starting with -// a row of 100,000 will immediately create 100,000 empty rows. -// -// To avoid unnecessary garbage collection, fill columns from left to right. -func (t *Table) SetCell(row, column int, cell *TableCell) *Table { - if row >= len(t.cells) { - t.cells = append(t.cells, make([][]*TableCell, row-len(t.cells)+1)...) - } - rowLen := len(t.cells[row]) - if column >= rowLen { - t.cells[row] = append(t.cells[row], make([]*TableCell, column-rowLen+1)...) - for c := rowLen; c < column; c++ { - t.cells[row][c] = &TableCell{} - } - } - t.cells[row][column] = cell - if column > t.lastColumn { - t.lastColumn = column - } - return t -} - -// SetCellSimple calls SetCell() with the given text, left-aligned, in white. -func (t *Table) SetCellSimple(row, column int, text string) *Table { - t.SetCell(row, column, NewTableCell(text)) - return t -} - -// GetCell returns the contents of the cell at the specified position. A valid -// TableCell object is always returned but it will be uninitialized if the cell -// was not previously set. Such an uninitialized object will not automatically -// be inserted. Therefore, repeated calls to this function may return different -// pointers for uninitialized cells. -func (t *Table) GetCell(row, column int) *TableCell { - if row >= len(t.cells) || column >= len(t.cells[row]) { - return &TableCell{} - } - return t.cells[row][column] -} - -// RemoveRow removes the row at the given position from the table. If there is -// no such row, this has no effect. -func (t *Table) RemoveRow(row int) *Table { - if row < 0 || row >= len(t.cells) { - return t - } - - t.cells = append(t.cells[:row], t.cells[row+1:]...) - - return t -} - -// RemoveColumn removes the column at the given position from the table. If -// there is no such column, this has no effect. -func (t *Table) RemoveColumn(column int) *Table { - for row := range t.cells { - if column < 0 || column >= len(t.cells[row]) { - continue - } - t.cells[row] = append(t.cells[row][:column], t.cells[row][column+1:]...) - } - - return t -} - -// InsertRow inserts a row before the row with the given index. Cells on the -// given row and below will be shifted to the bottom by one row. If "row" is -// equal or larger than the current number of rows, this function has no effect. -func (t *Table) InsertRow(row int) *Table { - if row >= len(t.cells) { - return t - } - t.cells = append(t.cells, nil) // Extend by one. - copy(t.cells[row+1:], t.cells[row:]) // Shift down. - t.cells[row] = nil // New row is uninitialized. - return t -} - -// InsertColumn inserts a column before the column with the given index. Cells -// in the given column and to its right will be shifted to the right by one -// column. Rows that have fewer initialized cells than "column" will remain -// unchanged. -func (t *Table) InsertColumn(column int) *Table { - for row := range t.cells { - if column >= len(t.cells[row]) { - continue - } - t.cells[row] = append(t.cells[row], nil) // Extend by one. - copy(t.cells[row][column+1:], t.cells[row][column:]) // Shift to the right. - t.cells[row][column] = &TableCell{} // New element is an uninitialized table cell. - } - return t -} - -// GetRowCount returns the number of rows in the table. -func (t *Table) GetRowCount() int { - return len(t.cells) -} - -// GetColumnCount returns the (maximum) number of columns in the table. -func (t *Table) GetColumnCount() int { - if len(t.cells) == 0 { - return 0 - } - return t.lastColumn + 1 -} - -// cellAt returns the row and column located at the given screen coordinates. -// Each returned value may be negative if there is no row and/or cell. This -// function will also process coordinates outside the table's inner rectangle so -// callers will need to check for bounds themselves. -func (t *Table) cellAt(x, y int) (row, column int) { - rectX, rectY, _, _ := t.GetInnerRect() - - // Determine row as seen on screen. - if t.borders { - row = (y - rectY - 1) / 2 - } else { - row = y - rectY - } - - // Respect fixed rows and row offset. - if row >= 0 { - if row >= t.fixedRows { - row += t.rowOffset - } - if row >= len(t.cells) { - row = -1 - } - } - - // Saerch for the clicked column. - column = -1 - if x >= rectX { - columnX := rectX - if t.borders { - columnX++ - } - for index, width := range t.visibleColumnWidths { - columnX += width + 1 - if x < columnX { - column = t.visibleColumnIndices[index] - break - } - } - } - - return -} - -// ScrollToBeginning scrolls the table to the beginning to that the top left -// corner of the table is shown. Note that this position may be corrected if -// there is a selection. -func (t *Table) ScrollToBeginning() *Table { - t.trackEnd = false - t.columnOffset = 0 - t.rowOffset = 0 - return t -} - -// ScrollToEnd scrolls the table to the beginning to that the bottom left corner -// of the table is shown. Adding more rows to the table will cause it to -// automatically scroll with the new data. Note that this position may be -// corrected if there is a selection. -func (t *Table) ScrollToEnd() *Table { - t.trackEnd = true - t.columnOffset = 0 - t.rowOffset = len(t.cells) - return t -} - -// Draw draws this primitive onto the screen. -func (t *Table) Draw(screen tcell.Screen) { - t.Box.Draw(screen) - - // What's our available screen space? - _, totalHeight := screen.Size() - x, y, width, height := t.GetInnerRect() - if t.borders { - t.visibleRows = height / 2 - } else { - t.visibleRows = height - } - - // Return the cell at the specified position (nil if it doesn't exist). - getCell := func(row, column int) *TableCell { - if row < 0 || column < 0 || row >= len(t.cells) || column >= len(t.cells[row]) { - return nil - } - return t.cells[row][column] - } - - // If this cell is not selectable, find the next one. - if t.rowsSelectable || t.columnsSelectable { - if t.selectedColumn < 0 { - t.selectedColumn = 0 - } - if t.selectedRow < 0 { - t.selectedRow = 0 - } - for t.selectedRow < len(t.cells) { - cell := getCell(t.selectedRow, t.selectedColumn) - if cell == nil || !cell.NotSelectable { - break - } - t.selectedColumn++ - if t.selectedColumn > t.lastColumn { - t.selectedColumn = 0 - t.selectedRow++ - } - } - } - - // Clamp row offsets. - if t.rowsSelectable { - if t.selectedRow >= t.fixedRows && t.selectedRow < t.fixedRows+t.rowOffset { - t.rowOffset = t.selectedRow - t.fixedRows - t.trackEnd = false - } - if t.borders { - if 2*(t.selectedRow+1-t.rowOffset) >= height { - t.rowOffset = t.selectedRow + 1 - height/2 - t.trackEnd = false - } - } else { - if t.selectedRow+1-t.rowOffset >= height { - t.rowOffset = t.selectedRow + 1 - height - t.trackEnd = false - } - } - } - if t.borders { - if 2*(len(t.cells)-t.rowOffset) < height { - t.trackEnd = true - } - } else { - if len(t.cells)-t.rowOffset < height { - t.trackEnd = true - } - } - if t.trackEnd { - if t.borders { - t.rowOffset = len(t.cells) - height/2 - } else { - t.rowOffset = len(t.cells) - height - } - } - if t.rowOffset < 0 { - t.rowOffset = 0 - } - - // Clamp column offset. (Only left side here. The right side is more - // difficult and we'll do it below.) - if t.columnsSelectable && t.selectedColumn >= t.fixedColumns && t.selectedColumn < t.fixedColumns+t.columnOffset { - t.columnOffset = t.selectedColumn - t.fixedColumns - } - if t.columnOffset < 0 { - t.columnOffset = 0 - } - if t.selectedColumn < 0 { - t.selectedColumn = 0 - } - - // Determine the indices and widths of the columns and rows which fit on the - // screen. - var ( - columns, rows, allRows, widths []int - tableHeight, tableWidth int - ) - rowStep := 1 - if t.borders { - rowStep = 2 // With borders, every table row takes two screen rows. - tableWidth = 1 // We start at the second character because of the left table border. - } - if t.evaluateAllRows { - allRows = make([]int, len(t.cells)) - for row := range t.cells { - allRows[row] = row - } - } - indexRow := func(row int) bool { // Determine if this row is visible, store its index. - if tableHeight >= height { - return false - } - rows = append(rows, row) - tableHeight += rowStep - return true - } - for row := 0; row < t.fixedRows && row < len(t.cells); row++ { // Do the fixed rows first. - if !indexRow(row) { - break - } - } - for row := t.fixedRows + t.rowOffset; row < len(t.cells); row++ { // Then the remaining rows. - if !indexRow(row) { - break - } - } - var ( - skipped, lastTableWidth, expansionTotal int - expansions []int - ) -ColumnLoop: - for column := 0; ; column++ { - // If we've moved beyond the right border, we stop or skip a column. - for tableWidth-1 >= width { // -1 because we include one extra column if the separator falls on the right end of the box. - // We've moved beyond the available space. - if column < t.fixedColumns { - break ColumnLoop // We're in the fixed area. We're done. - } - if !t.columnsSelectable && skipped >= t.columnOffset { - break ColumnLoop // There is no selection and we've already reached the offset. - } - if t.columnsSelectable && t.selectedColumn-skipped == t.fixedColumns { - break ColumnLoop // The selected column reached the leftmost point before disappearing. - } - if t.columnsSelectable && skipped >= t.columnOffset && - (t.selectedColumn < column && lastTableWidth < width-1 && tableWidth < width-1 || t.selectedColumn < column-1) { - break ColumnLoop // We've skipped as many as requested and the selection is visible. - } - if len(columns) <= t.fixedColumns { - break // Nothing to skip. - } - - // We need to skip a column. - skipped++ - lastTableWidth -= widths[t.fixedColumns] + 1 - tableWidth -= widths[t.fixedColumns] + 1 - columns = append(columns[:t.fixedColumns], columns[t.fixedColumns+1:]...) - widths = append(widths[:t.fixedColumns], widths[t.fixedColumns+1:]...) - expansions = append(expansions[:t.fixedColumns], expansions[t.fixedColumns+1:]...) - } - - // What's this column's width (without expansion)? - maxWidth := -1 - expansion := 0 - evaluationRows := rows - if t.evaluateAllRows { - evaluationRows = allRows - } - for _, row := range evaluationRows { - if cell := getCell(row, column); cell != nil { - _, _, _, _, _, _, cellWidth := decomposeString(cell.Text, true, false) - if cell.MaxWidth > 0 && cell.MaxWidth < cellWidth { - cellWidth = cell.MaxWidth - } - if cellWidth > maxWidth { - maxWidth = cellWidth - } - if cell.Expansion > expansion { - expansion = cell.Expansion - } - } - } - if maxWidth < 0 { - break // No more cells found in this column. - } - - // Store new column info at the end. - columns = append(columns, column) - widths = append(widths, maxWidth) - lastTableWidth = tableWidth - tableWidth += maxWidth + 1 - expansions = append(expansions, expansion) - expansionTotal += expansion - } - t.columnOffset = skipped - - // If we have space left, distribute it. - if tableWidth < width { - toDistribute := width - tableWidth - for index, expansion := range expansions { - if expansionTotal <= 0 { - break - } - expWidth := toDistribute * expansion / expansionTotal - widths[index] += expWidth - toDistribute -= expWidth - expansionTotal -= expansion - } - } - - // Helper function which draws border runes. - borderStyle := tcell.StyleDefault.Background(t.backgroundColor).Foreground(t.bordersColor) - drawBorder := func(colX, rowY int, ch rune) { - screen.SetContent(x+colX, y+rowY, ch, nil, borderStyle) - } - - // Draw the cells (and borders). - var columnX int - if !t.borders { - columnX-- - } - for columnIndex, column := range columns { - columnWidth := widths[columnIndex] - for rowY, row := range rows { - if t.borders { - // Draw borders. - rowY *= 2 - for pos := 0; pos < columnWidth && columnX+1+pos < width; pos++ { - drawBorder(columnX+pos+1, rowY, Borders.Horizontal) - } - ch := Borders.Cross - if columnIndex == 0 { - if rowY == 0 { - ch = Borders.TopLeft - } else { - ch = Borders.LeftT - } - } else if rowY == 0 { - ch = Borders.TopT - } - drawBorder(columnX, rowY, ch) - rowY++ - if rowY >= height || y+rowY >= totalHeight { - break // No space for the text anymore. - } - drawBorder(columnX, rowY, Borders.Vertical) - } else if columnIndex > 0 { - // Draw separator. - drawBorder(columnX, rowY, t.separator) - } - - // Get the cell. - cell := getCell(row, column) - if cell == nil { - continue - } - - // Draw text. - finalWidth := columnWidth - if columnX+1+columnWidth >= width { - finalWidth = width - columnX - 1 - } - cell.x, cell.y, cell.width = x+columnX+1, y+rowY, finalWidth - _, printed := printWithStyle(screen, cell.Text, x+columnX+1, y+rowY, finalWidth, cell.Align, tcell.StyleDefault.Foreground(cell.Color)|tcell.Style(cell.Attributes)) - if TaggedStringWidth(cell.Text)-printed > 0 && printed > 0 { - _, _, style, _ := screen.GetContent(x+columnX+finalWidth, y+rowY) - printWithStyle(screen, string(SemigraphicsHorizontalEllipsis), x+columnX+finalWidth, y+rowY, 1, AlignLeft, style) - } - } - - // Draw bottom border. - if rowY := 2 * len(rows); t.borders && rowY < height { - for pos := 0; pos < columnWidth && columnX+1+pos < width; pos++ { - drawBorder(columnX+pos+1, rowY, Borders.Horizontal) - } - ch := Borders.BottomT - if columnIndex == 0 { - ch = Borders.BottomLeft - } - drawBorder(columnX, rowY, ch) - } - - columnX += columnWidth + 1 - } - - // Draw right border. - if t.borders && len(t.cells) > 0 && columnX < width { - for rowY := range rows { - rowY *= 2 - if rowY+1 < height { - drawBorder(columnX, rowY+1, Borders.Vertical) - } - ch := Borders.RightT - if rowY == 0 { - ch = Borders.TopRight - } - drawBorder(columnX, rowY, ch) - } - if rowY := 2 * len(rows); rowY < height { - drawBorder(columnX, rowY, Borders.BottomRight) - } - } - - // Helper function which colors the background of a box. - // backgroundColor == tcell.ColorDefault => Don't color the background. - // textColor == tcell.ColorDefault => Don't change the text color. - // attr == 0 => Don't change attributes. - // invert == true => Ignore attr, set text to backgroundColor or t.backgroundColor; - // set background to textColor. - colorBackground := func(fromX, fromY, w, h int, backgroundColor, textColor tcell.Color, attr tcell.AttrMask, invert bool) { - for by := 0; by < h && fromY+by < y+height; by++ { - for bx := 0; bx < w && fromX+bx < x+width; bx++ { - m, c, style, _ := screen.GetContent(fromX+bx, fromY+by) - fg, bg, a := style.Decompose() - if invert { - if fg == textColor || fg == t.bordersColor { - fg = backgroundColor - } - if fg == tcell.ColorDefault { - fg = t.backgroundColor - } - style = style.Background(textColor).Foreground(fg) - } else { - if backgroundColor != tcell.ColorDefault { - bg = backgroundColor - } - if textColor != tcell.ColorDefault { - fg = textColor - } - if attr != 0 { - a = attr - } - style = style.Background(bg).Foreground(fg) | tcell.Style(a) - } - screen.SetContent(fromX+bx, fromY+by, m, c, style) - } - } - } - - // Color the cell backgrounds. To avoid undesirable artefacts, we combine - // the drawing of a cell by background color, selected cells last. - type cellInfo struct { - x, y, w, h int - text tcell.Color - selected bool - } - cellsByBackgroundColor := make(map[tcell.Color][]*cellInfo) - var backgroundColors []tcell.Color - for rowY, row := range rows { - columnX := 0 - rowSelected := t.rowsSelectable && !t.columnsSelectable && row == t.selectedRow - for columnIndex, column := range columns { - columnWidth := widths[columnIndex] - cell := getCell(row, column) - if cell == nil { - continue - } - bx, by, bw, bh := x+columnX, y+rowY, columnWidth+1, 1 - if t.borders { - by = y + rowY*2 - bw++ - bh = 3 - } - columnSelected := t.columnsSelectable && !t.rowsSelectable && column == t.selectedColumn - cellSelected := !cell.NotSelectable && (columnSelected || rowSelected || t.rowsSelectable && t.columnsSelectable && column == t.selectedColumn && row == t.selectedRow) - entries, ok := cellsByBackgroundColor[cell.BackgroundColor] - cellsByBackgroundColor[cell.BackgroundColor] = append(entries, &cellInfo{ - x: bx, - y: by, - w: bw, - h: bh, - text: cell.Color, - selected: cellSelected, - }) - if !ok { - backgroundColors = append(backgroundColors, cell.BackgroundColor) - } - columnX += columnWidth + 1 - } - } - sort.Slice(backgroundColors, func(i int, j int) bool { - // Draw brightest colors last (i.e. on top). - r, g, b := backgroundColors[i].RGB() - c := colorful.Color{R: float64(r) / 255, G: float64(g) / 255, B: float64(b) / 255} - _, _, li := c.Hcl() - r, g, b = backgroundColors[j].RGB() - c = colorful.Color{R: float64(r) / 255, G: float64(g) / 255, B: float64(b) / 255} - _, _, lj := c.Hcl() - return li < lj - }) - selFg, selBg, selAttr := t.selectedStyle.Decompose() - for _, bgColor := range backgroundColors { - entries := cellsByBackgroundColor[bgColor] - for _, cell := range entries { - if cell.selected { - if t.selectedStyle != 0 { - defer colorBackground(cell.x, cell.y, cell.w, cell.h, selBg, selFg, selAttr, false) - } else { - defer colorBackground(cell.x, cell.y, cell.w, cell.h, bgColor, cell.text, 0, true) - } - } else { - colorBackground(cell.x, cell.y, cell.w, cell.h, bgColor, tcell.ColorDefault, 0, false) - } - } - } - - // Remember column infos. - t.visibleColumnIndices, t.visibleColumnWidths = columns, widths -} - -// InputHandler returns the handler for this primitive. -func (t *Table) InputHandler() func(event *tcell.EventKey, setFocus func(p Primitive)) { - return t.WrapInputHandler(func(event *tcell.EventKey, setFocus func(p Primitive)) { - key := event.Key() - - if (!t.rowsSelectable && !t.columnsSelectable && key == tcell.KeyEnter) || - key == tcell.KeyEscape || - key == tcell.KeyTab || - key == tcell.KeyBacktab { - if t.done != nil { - t.done(key) - } - return - } - - // Movement functions. - previouslySelectedRow, previouslySelectedColumn := t.selectedRow, t.selectedColumn - var ( - getCell = func(row, column int) *TableCell { - if row < 0 || column < 0 || row >= len(t.cells) || column >= len(t.cells[row]) { - return nil - } - return t.cells[row][column] - } - - previous = func() { - for t.selectedRow >= 0 { - cell := getCell(t.selectedRow, t.selectedColumn) - if cell == nil || !cell.NotSelectable { - return - } - t.selectedColumn-- - if t.selectedColumn < 0 { - t.selectedColumn = t.lastColumn - t.selectedRow-- - } - } - } - - next = func() { - if t.selectedColumn > t.lastColumn { - t.selectedColumn = 0 - t.selectedRow++ - if t.selectedRow >= len(t.cells) { - t.selectedRow = len(t.cells) - 1 - } - } - for t.selectedRow < len(t.cells) { - cell := getCell(t.selectedRow, t.selectedColumn) - if cell == nil || !cell.NotSelectable { - return - } - t.selectedColumn++ - if t.selectedColumn > t.lastColumn { - t.selectedColumn = 0 - t.selectedRow++ - } - } - t.selectedColumn = t.lastColumn - t.selectedRow = len(t.cells) - 1 - previous() - } - - home = func() { - if t.rowsSelectable { - t.selectedRow = 0 - t.selectedColumn = 0 - next() - } else { - t.trackEnd = false - t.rowOffset = 0 - t.columnOffset = 0 - } - } - - end = func() { - if t.rowsSelectable { - t.selectedRow = len(t.cells) - 1 - t.selectedColumn = t.lastColumn - previous() - } else { - t.trackEnd = true - t.columnOffset = 0 - } - } - - down = func() { - if t.rowsSelectable { - t.selectedRow++ - if t.selectedRow >= len(t.cells) { - t.selectedRow = len(t.cells) - 1 - } - next() - } else { - t.rowOffset++ - } - } - - up = func() { - if t.rowsSelectable { - t.selectedRow-- - if t.selectedRow < 0 { - t.selectedRow = 0 - } - previous() - } else { - t.trackEnd = false - t.rowOffset-- - } - } - - left = func() { - if t.columnsSelectable { - t.selectedColumn-- - if t.selectedColumn < 0 { - t.selectedColumn = 0 - } - previous() - } else { - t.columnOffset-- - } - } - - right = func() { - if t.columnsSelectable { - t.selectedColumn++ - if t.selectedColumn > t.lastColumn { - t.selectedColumn = t.lastColumn - } - next() - } else { - t.columnOffset++ - } - } - - pageDown = func() { - offsetAmount := t.visibleRows - t.fixedRows - if offsetAmount < 0 { - offsetAmount = 0 - } - - if t.rowsSelectable { - t.selectedRow += offsetAmount - if t.selectedRow >= len(t.cells) { - t.selectedRow = len(t.cells) - 1 - } - next() - } else { - t.rowOffset += offsetAmount - } - } - - pageUp = func() { - offsetAmount := t.visibleRows - t.fixedRows - if offsetAmount < 0 { - offsetAmount = 0 - } - - if t.rowsSelectable { - t.selectedRow -= offsetAmount - if t.selectedRow < 0 { - t.selectedRow = 0 - } - previous() - } else { - t.trackEnd = false - t.rowOffset -= offsetAmount - } - } - ) - - switch key { - case tcell.KeyRune: - switch event.Rune() { - case 'g': - home() - case 'G': - end() - case 'j': - down() - case 'k': - up() - case 'h': - left() - case 'l': - right() - } - case tcell.KeyHome: - home() - case tcell.KeyEnd: - end() - case tcell.KeyUp: - up() - case tcell.KeyDown: - down() - case tcell.KeyLeft: - left() - case tcell.KeyRight: - right() - case tcell.KeyPgDn, tcell.KeyCtrlF: - pageDown() - case tcell.KeyPgUp, tcell.KeyCtrlB: - pageUp() - case tcell.KeyEnter: - if (t.rowsSelectable || t.columnsSelectable) && t.selected != nil { - t.selected(t.selectedRow, t.selectedColumn) - } - } - - // If the selection has changed, notify the handler. - if t.selectionChanged != nil && - (t.rowsSelectable && previouslySelectedRow != t.selectedRow || - t.columnsSelectable && previouslySelectedColumn != t.selectedColumn) { - t.selectionChanged(t.selectedRow, t.selectedColumn) - } - }) -} - -// MouseHandler returns the mouse handler for this primitive. -func (t *Table) MouseHandler() func(action MouseAction, event *tcell.EventMouse, setFocus func(p Primitive)) (consumed bool, capture Primitive) { - return t.WrapMouseHandler(func(action MouseAction, event *tcell.EventMouse, setFocus func(p Primitive)) (consumed bool, capture Primitive) { - x, y := event.Position() - if !t.InRect(x, y) { - return false, nil - } - - switch action { - case MouseLeftClick: - if t.rowsSelectable || t.columnsSelectable { - t.Select(t.cellAt(x, y)) - } - consumed = true - setFocus(t) - case MouseScrollUp: - t.trackEnd = false - t.rowOffset-- - consumed = true - case MouseScrollDown: - t.rowOffset++ - consumed = true - } - - return - }) -} diff --git a/vendor/github.com/rivo/tview/textview.go b/vendor/github.com/rivo/tview/textview.go deleted file mode 100644 index ee823416..00000000 --- a/vendor/github.com/rivo/tview/textview.go +++ /dev/null @@ -1,1189 +0,0 @@ -package tview - -import ( - "bytes" - "fmt" - "regexp" - "strings" - "sync" - "unicode/utf8" - - "github.com/gdamore/tcell" - colorful "github.com/lucasb-eyer/go-colorful" - runewidth "github.com/mattn/go-runewidth" - "github.com/rivo/uniseg" -) - -var ( - openColorRegex = regexp.MustCompile(`\[([a-zA-Z]*|#[0-9a-zA-Z]*)$`) - openRegionRegex = regexp.MustCompile(`\["[a-zA-Z0-9_,;: \-\.]*"?$`) - newLineRegex = regexp.MustCompile(`\r?\n`) - - // TabSize is the number of spaces with which a tab character will be replaced. - TabSize = 4 -) - -// textViewIndex contains information about each line displayed in the text -// view. -type textViewIndex struct { - Line int // The index into the "buffer" variable. - Pos int // The index into the "buffer" string (byte position). - NextPos int // The (byte) index of the next character in this buffer line. - Width int // The screen width of this line. - ForegroundColor string // The starting foreground color ("" = don't change, "-" = reset). - BackgroundColor string // The starting background color ("" = don't change, "-" = reset). - Attributes string // The starting attributes ("" = don't change, "-" = reset). - Region string // The starting region ID. -} - -// textViewRegion contains information about a region. -type textViewRegion struct { - // The region ID. - ID string - - // The starting and end screen position of the region as determined the last - // time Draw() was called. A negative value indicates out-of-rect positions. - FromX, FromY, ToX, ToY int -} - -// TextView is a box which displays text. It implements the io.Writer interface -// so you can stream text to it. This does not trigger a redraw automatically -// but if a handler is installed via SetChangedFunc(), you can cause it to be -// redrawn. (See SetChangedFunc() for more details.) -// -// Navigation -// -// If the text view is scrollable (the default), text is kept in a buffer which -// may be larger than the screen and can be navigated similarly to Vim: -// -// - h, left arrow: Move left. -// - l, right arrow: Move right. -// - j, down arrow: Move down. -// - k, up arrow: Move up. -// - g, home: Move to the top. -// - G, end: Move to the bottom. -// - Ctrl-F, page down: Move down by one page. -// - Ctrl-B, page up: Move up by one page. -// -// If the text is not scrollable, any text above the top visible line is -// discarded. -// -// Use SetInputCapture() to override or modify keyboard input. -// -// Colors -// -// If dynamic colors are enabled via SetDynamicColors(), text color can be -// changed dynamically by embedding color strings in square brackets. This works -// the same way as anywhere else. Please see the package documentation for more -// information. -// -// Regions and Highlights -// -// If regions are enabled via SetRegions(), you can define text regions within -// the text and assign region IDs to them. Text regions start with region tags. -// Region tags are square brackets that contain a region ID in double quotes, -// for example: -// -// We define a ["rg"]region[""] here. -// -// A text region ends with the next region tag. Tags with no region ID ([""]) -// don't start new regions. They can therefore be used to mark the end of a -// region. Region IDs must satisfy the following regular expression: -// -// [a-zA-Z0-9_,;: \-\.]+ -// -// Regions can be highlighted by calling the Highlight() function with one or -// more region IDs. This can be used to display search results, for example. -// -// The ScrollToHighlight() function can be used to jump to the currently -// highlighted region once when the text view is drawn the next time. -// -// See https://github.com/rivo/tview/wiki/TextView for an example. -type TextView struct { - sync.Mutex - *Box - - // The text buffer. - buffer []string - - // The last bytes that have been received but are not part of the buffer yet. - recentBytes []byte - - // The processed line index. This is nil if the buffer has changed and needs - // to be re-indexed. - index []*textViewIndex - - // The text alignment, one of AlignLeft, AlignCenter, or AlignRight. - align int - - // Information about visible regions as of the last call to Draw(). - regionInfos []*textViewRegion - - // Indices into the "index" slice which correspond to the first line of the - // first highlight and the last line of the last highlight. This is calculated - // during re-indexing. Set to -1 if there is no current highlight. - fromHighlight, toHighlight int - - // The screen space column of the highlight in its first line. Set to -1 if - // there is no current highlight. - posHighlight int - - // A set of region IDs that are currently highlighted. - highlights map[string]struct{} - - // The last width for which the current table is drawn. - lastWidth int - - // The screen width of the longest line in the index (not the buffer). - longestLine int - - // The index of the first line shown in the text view. - lineOffset int - - // If set to true, the text view will always remain at the end of the content. - trackEnd bool - - // The number of characters to be skipped on each line (not in wrap mode). - columnOffset int - - // The height of the content the last time the text view was drawn. - pageSize int - - // If set to true, the text view will keep a buffer of text which can be - // navigated when the text is longer than what fits into the box. - scrollable bool - - // If set to true, lines that are longer than the available width are wrapped - // onto the next line. If set to false, any characters beyond the available - // width are discarded. - wrap bool - - // If set to true and if wrap is also true, lines are split at spaces or - // after punctuation characters. - wordWrap bool - - // The (starting) color of the text. - textColor tcell.Color - - // If set to true, the text color can be changed dynamically by piping color - // strings in square brackets to the text view. - dynamicColors bool - - // If set to true, region tags can be used to define regions. - regions bool - - // A temporary flag which, when true, will automatically bring the current - // highlight(s) into the visible screen. - scrollToHighlights bool - - // If true, setting new highlights will be a XOR instead of an overwrite - // operation. - toggleHighlights bool - - // An optional function which is called when the content of the text view has - // changed. - changed func() - - // An optional function which is called when the user presses one of the - // following keys: Escape, Enter, Tab, Backtab. - done func(tcell.Key) - - // An optional function which is called when one or more regions were - // highlighted. - highlighted func(added, removed, remaining []string) -} - -// NewTextView returns a new text view. -func NewTextView() *TextView { - return &TextView{ - Box: NewBox(), - highlights: make(map[string]struct{}), - lineOffset: -1, - scrollable: true, - align: AlignLeft, - wrap: true, - textColor: Styles.PrimaryTextColor, - regions: false, - dynamicColors: false, - } -} - -// SetScrollable sets the flag that decides whether or not the text view is -// scrollable. If true, text is kept in a buffer and can be navigated. If false, -// the last line will always be visible. -func (t *TextView) SetScrollable(scrollable bool) *TextView { - t.scrollable = scrollable - if !scrollable { - t.trackEnd = true - } - return t -} - -// SetWrap sets the flag that, if true, leads to lines that are longer than the -// available width being wrapped onto the next line. If false, any characters -// beyond the available width are not displayed. -func (t *TextView) SetWrap(wrap bool) *TextView { - if t.wrap != wrap { - t.index = nil - } - t.wrap = wrap - return t -} - -// SetWordWrap sets the flag that, if true and if the "wrap" flag is also true -// (see SetWrap()), wraps the line at spaces or after punctuation marks. Note -// that trailing spaces will not be printed. -// -// This flag is ignored if the "wrap" flag is false. -func (t *TextView) SetWordWrap(wrapOnWords bool) *TextView { - if t.wordWrap != wrapOnWords { - t.index = nil - } - t.wordWrap = wrapOnWords - return t -} - -// SetTextAlign sets the text alignment within the text view. This must be -// either AlignLeft, AlignCenter, or AlignRight. -func (t *TextView) SetTextAlign(align int) *TextView { - if t.align != align { - t.index = nil - } - t.align = align - return t -} - -// SetTextColor sets the initial color of the text (which can be changed -// dynamically by sending color strings in square brackets to the text view if -// dynamic colors are enabled). -func (t *TextView) SetTextColor(color tcell.Color) *TextView { - t.textColor = color - return t -} - -// SetText sets the text of this text view to the provided string. Previously -// contained text will be removed. -func (t *TextView) SetText(text string) *TextView { - t.Clear() - fmt.Fprint(t, text) - return t -} - -// GetText returns the current text of this text view. If "stripTags" is set -// to true, any region/color tags are stripped from the text. -func (t *TextView) GetText(stripTags bool) string { - // Get the buffer. - buffer := t.buffer - if !stripTags { - buffer = append(buffer, string(t.recentBytes)) - } - - // Add newlines again. - text := strings.Join(buffer, "\n") - - // Strip from tags if required. - if stripTags { - if t.regions { - text = regionPattern.ReplaceAllString(text, "") - } - if t.dynamicColors { - text = colorPattern.ReplaceAllStringFunc(text, func(match string) string { - if len(match) > 2 { - return "" - } - return match - }) - } - if t.regions || t.dynamicColors { - text = escapePattern.ReplaceAllString(text, `[$1$2]`) - } - } - - return text -} - -// SetDynamicColors sets the flag that allows the text color to be changed -// dynamically. See class description for details. -func (t *TextView) SetDynamicColors(dynamic bool) *TextView { - if t.dynamicColors != dynamic { - t.index = nil - } - t.dynamicColors = dynamic - return t -} - -// SetRegions sets the flag that allows to define regions in the text. See class -// description for details. -func (t *TextView) SetRegions(regions bool) *TextView { - if t.regions != regions { - t.index = nil - } - t.regions = regions - return t -} - -// SetChangedFunc sets a handler function which is called when the text of the -// text view has changed. This is useful when text is written to this io.Writer -// in a separate goroutine. Doing so does not automatically cause the screen to -// be refreshed so you may want to use the "changed" handler to redraw the -// screen. -// -// Note that to avoid race conditions or deadlocks, there are a few rules you -// should follow: -// -// - You can call Application.Draw() from this handler. -// - You can call TextView.HasFocus() from this handler. -// - During the execution of this handler, access to any other variables from -// this primitive or any other primitive must be queued using -// Application.QueueUpdate(). -// -// See package description for details on dealing with concurrency. -func (t *TextView) SetChangedFunc(handler func()) *TextView { - t.changed = handler - return t -} - -// SetDoneFunc sets a handler which is called when the user presses on the -// following keys: Escape, Enter, Tab, Backtab. The key is passed to the -// handler. -func (t *TextView) SetDoneFunc(handler func(key tcell.Key)) *TextView { - t.done = handler - return t -} - -// SetHighlightedFunc sets a handler which is called when the list of currently -// highlighted regions change. It receives a list of region IDs which were newly -// highlighted, those that are not highlighted anymore, and those that remain -// highlighted. -// -// Note that because regions are only determined during drawing, this function -// can only fire for regions that have existed during the last call to Draw(). -func (t *TextView) SetHighlightedFunc(handler func(added, removed, remaining []string)) *TextView { - t.highlighted = handler - return t -} - -// ScrollTo scrolls to the specified row and column (both starting with 0). -func (t *TextView) ScrollTo(row, column int) *TextView { - if !t.scrollable { - return t - } - t.lineOffset = row - t.columnOffset = column - t.trackEnd = false - return t -} - -// ScrollToBeginning scrolls to the top left corner of the text if the text view -// is scrollable. -func (t *TextView) ScrollToBeginning() *TextView { - if !t.scrollable { - return t - } - t.trackEnd = false - t.lineOffset = 0 - t.columnOffset = 0 - return t -} - -// ScrollToEnd scrolls to the bottom left corner of the text if the text view -// is scrollable. Adding new rows to the end of the text view will cause it to -// scroll with the new data. -func (t *TextView) ScrollToEnd() *TextView { - if !t.scrollable { - return t - } - t.trackEnd = true - t.columnOffset = 0 - return t -} - -// GetScrollOffset returns the number of rows and columns that are skipped at -// the top left corner when the text view has been scrolled. -func (t *TextView) GetScrollOffset() (row, column int) { - return t.lineOffset, t.columnOffset -} - -// Clear removes all text from the buffer. -func (t *TextView) Clear() *TextView { - t.buffer = nil - t.recentBytes = nil - t.index = nil - return t -} - -// Highlight specifies which regions should be highlighted. If highlight -// toggling is set to true (see SetToggleHighlights()), the highlight of the -// provided regions is toggled (highlighted regions are un-highlighted and vice -// versa). If toggling is set to false, the provided regions are highlighted and -// all other regions will not be highlighted (you may also provide nil to turn -// off all highlights). -// -// For more information on regions, see class description. Empty region strings -// are ignored. -// -// Text in highlighted regions will be drawn inverted, i.e. with their -// background and foreground colors swapped. -func (t *TextView) Highlight(regionIDs ...string) *TextView { - // Toggle highlights. - if t.toggleHighlights { - var newIDs []string - HighlightLoop: - for regionID := range t.highlights { - for _, id := range regionIDs { - if regionID == id { - continue HighlightLoop - } - } - newIDs = append(newIDs, regionID) - } - for _, regionID := range regionIDs { - if _, ok := t.highlights[regionID]; !ok { - newIDs = append(newIDs, regionID) - } - } - regionIDs = newIDs - } // Now we have a list of region IDs that end up being highlighted. - - // Determine added and removed regions. - var added, removed, remaining []string - if t.highlighted != nil { - for _, regionID := range regionIDs { - if _, ok := t.highlights[regionID]; ok { - remaining = append(remaining, regionID) - delete(t.highlights, regionID) - } else { - added = append(added, regionID) - } - } - for regionID := range t.highlights { - removed = append(removed, regionID) - } - } - - // Make new selection. - t.highlights = make(map[string]struct{}) - for _, id := range regionIDs { - if id == "" { - continue - } - t.highlights[id] = struct{}{} - } - t.index = nil - - // Notify. - if t.highlighted != nil && len(added) > 0 || len(removed) > 0 { - t.highlighted(added, removed, remaining) - } - - return t -} - -// GetHighlights returns the IDs of all currently highlighted regions. -func (t *TextView) GetHighlights() (regionIDs []string) { - for id := range t.highlights { - regionIDs = append(regionIDs, id) - } - return -} - -// SetToggleHighlights sets a flag to determine how regions are highlighted. -// When set to true, the Highlight() function (or a mouse click) will toggle the -// provided/selected regions. When set to false, Highlight() (or a mouse click) -// will simply highlight the provided regions. -func (t *TextView) SetToggleHighlights(toggle bool) *TextView { - t.toggleHighlights = toggle - return t -} - -// ScrollToHighlight will cause the visible area to be scrolled so that the -// highlighted regions appear in the visible area of the text view. This -// repositioning happens the next time the text view is drawn. It happens only -// once so you will need to call this function repeatedly to always keep -// highlighted regions in view. -// -// Nothing happens if there are no highlighted regions or if the text view is -// not scrollable. -func (t *TextView) ScrollToHighlight() *TextView { - if len(t.highlights) == 0 || !t.scrollable || !t.regions { - return t - } - t.index = nil - t.scrollToHighlights = true - t.trackEnd = false - return t -} - -// GetRegionText returns the text of the region with the given ID. If dynamic -// colors are enabled, color tags are stripped from the text. Newlines are -// always returned as '\n' runes. -// -// If the region does not exist or if regions are turned off, an empty string -// is returned. -func (t *TextView) GetRegionText(regionID string) string { - if !t.regions || regionID == "" { - return "" - } - - var ( - buffer bytes.Buffer - currentRegionID string - ) - - for _, str := range t.buffer { - // Find all color tags in this line. - var colorTagIndices [][]int - if t.dynamicColors { - colorTagIndices = colorPattern.FindAllStringIndex(str, -1) - } - - // Find all regions in this line. - var ( - regionIndices [][]int - regions [][]string - ) - if t.regions { - regionIndices = regionPattern.FindAllStringIndex(str, -1) - regions = regionPattern.FindAllStringSubmatch(str, -1) - } - - // Analyze this line. - var currentTag, currentRegion int - for pos, ch := range str { - // Skip any color tags. - if currentTag < len(colorTagIndices) && pos >= colorTagIndices[currentTag][0] && pos < colorTagIndices[currentTag][1] { - if pos == colorTagIndices[currentTag][1]-1 { - currentTag++ - } - if colorTagIndices[currentTag][1]-colorTagIndices[currentTag][0] > 2 { - continue - } - } - - // Skip any regions. - if currentRegion < len(regionIndices) && pos >= regionIndices[currentRegion][0] && pos < regionIndices[currentRegion][1] { - if pos == regionIndices[currentRegion][1]-1 { - if currentRegionID == regionID { - // This is the end of the requested region. We're done. - return buffer.String() - } - currentRegionID = regions[currentRegion][1] - currentRegion++ - } - continue - } - - // Add this rune. - if currentRegionID == regionID { - buffer.WriteRune(ch) - } - } - - // Add newline. - if currentRegionID == regionID { - buffer.WriteRune('\n') - } - } - - return escapePattern.ReplaceAllString(buffer.String(), `[$1$2]`) -} - -// Focus is called when this primitive receives focus. -func (t *TextView) Focus(delegate func(p Primitive)) { - // Implemented here with locking because this is used by layout primitives. - t.Lock() - defer t.Unlock() - t.hasFocus = true -} - -// HasFocus returns whether or not this primitive has focus. -func (t *TextView) HasFocus() bool { - // Implemented here with locking because this may be used in the "changed" - // callback. - t.Lock() - defer t.Unlock() - return t.hasFocus -} - -// Write lets us implement the io.Writer interface. Tab characters will be -// replaced with TabSize space characters. A "\n" or "\r\n" will be interpreted -// as a new line. -func (t *TextView) Write(p []byte) (n int, err error) { - // Notify at the end. - t.Lock() - changed := t.changed - t.Unlock() - if changed != nil { - defer func() { - // We always call the "changed" function in a separate goroutine to avoid - // deadlocks. - go changed() - }() - } - - t.Lock() - defer t.Unlock() - - // Copy data over. - newBytes := append(t.recentBytes, p...) - t.recentBytes = nil - - // If we have a trailing invalid UTF-8 byte, we'll wait. - if r, _ := utf8.DecodeLastRune(p); r == utf8.RuneError { - t.recentBytes = newBytes - return len(p), nil - } - - // If we have a trailing open dynamic color, exclude it. - if t.dynamicColors { - location := openColorRegex.FindIndex(newBytes) - if location != nil { - t.recentBytes = newBytes[location[0]:] - newBytes = newBytes[:location[0]] - } - } - - // If we have a trailing open region, exclude it. - if t.regions { - location := openRegionRegex.FindIndex(newBytes) - if location != nil { - t.recentBytes = newBytes[location[0]:] - newBytes = newBytes[:location[0]] - } - } - - // Transform the new bytes into strings. - newBytes = bytes.Replace(newBytes, []byte{'\t'}, bytes.Repeat([]byte{' '}, TabSize), -1) - for index, line := range newLineRegex.Split(string(newBytes), -1) { - if index == 0 { - if len(t.buffer) == 0 { - t.buffer = []string{line} - } else { - t.buffer[len(t.buffer)-1] += line - } - } else { - t.buffer = append(t.buffer, line) - } - } - - // Reset the index. - t.index = nil - - return len(p), nil -} - -// reindexBuffer re-indexes the buffer such that we can use it to easily draw -// the buffer onto the screen. Each line in the index will contain a pointer -// into the buffer from which on we will print text. It will also contain the -// color with which the line starts. -func (t *TextView) reindexBuffer(width int) { - if t.index != nil { - return // Nothing has changed. We can still use the current index. - } - t.index = nil - t.fromHighlight, t.toHighlight, t.posHighlight = -1, -1, -1 - - // If there's no space, there's no index. - if width < 1 { - return - } - - // Initial states. - regionID := "" - var ( - highlighted bool - foregroundColor, backgroundColor, attributes string - ) - - // Go through each line in the buffer. - for bufferIndex, str := range t.buffer { - colorTagIndices, colorTags, regionIndices, regions, escapeIndices, strippedStr, _ := decomposeString(str, t.dynamicColors, t.regions) - - // Split the line if required. - var splitLines []string - str = strippedStr - if t.wrap && len(str) > 0 { - for len(str) > 0 { - extract := runewidth.Truncate(str, width, "") - if len(extract) == 0 { - // We'll extract at least one grapheme cluster. - gr := uniseg.NewGraphemes(str) - gr.Next() - _, to := gr.Positions() - extract = str[:to] - } - if t.wordWrap && len(extract) < len(str) { - // Add any spaces from the next line. - if spaces := spacePattern.FindStringIndex(str[len(extract):]); spaces != nil && spaces[0] == 0 { - extract = str[:len(extract)+spaces[1]] - } - - // Can we split before the mandatory end? - matches := boundaryPattern.FindAllStringIndex(extract, -1) - if len(matches) > 0 { - // Yes. Let's split there. - extract = extract[:matches[len(matches)-1][1]] - } - } - splitLines = append(splitLines, extract) - str = str[len(extract):] - } - } else { - // No need to split the line. - splitLines = []string{str} - } - - // Create index from split lines. - var originalPos, colorPos, regionPos, escapePos int - for _, splitLine := range splitLines { - line := &textViewIndex{ - Line: bufferIndex, - Pos: originalPos, - ForegroundColor: foregroundColor, - BackgroundColor: backgroundColor, - Attributes: attributes, - Region: regionID, - } - - // Shift original position with tags. - lineLength := len(splitLine) - remainingLength := lineLength - tagEnd := originalPos - totalTagLength := 0 - for { - // Which tag comes next? - nextTag := make([][3]int, 0, 3) - if colorPos < len(colorTagIndices) { - nextTag = append(nextTag, [3]int{colorTagIndices[colorPos][0], colorTagIndices[colorPos][1], 0}) // 0 = color tag. - } - if regionPos < len(regionIndices) { - nextTag = append(nextTag, [3]int{regionIndices[regionPos][0], regionIndices[regionPos][1], 1}) // 1 = region tag. - } - if escapePos < len(escapeIndices) { - nextTag = append(nextTag, [3]int{escapeIndices[escapePos][0], escapeIndices[escapePos][1], 2}) // 2 = escape tag. - } - minPos := -1 - tagIndex := -1 - for index, pair := range nextTag { - if minPos < 0 || pair[0] < minPos { - minPos = pair[0] - tagIndex = index - } - } - - // Is the next tag in range? - if tagIndex < 0 || minPos > tagEnd+remainingLength { - break // No. We're done with this line. - } - - // Advance. - strippedTagStart := nextTag[tagIndex][0] - originalPos - totalTagLength - tagEnd = nextTag[tagIndex][1] - tagLength := tagEnd - nextTag[tagIndex][0] - if nextTag[tagIndex][2] == 2 { - tagLength = 1 - } - totalTagLength += tagLength - remainingLength = lineLength - (tagEnd - originalPos - totalTagLength) - - // Process the tag. - switch nextTag[tagIndex][2] { - case 0: - // Process color tags. - foregroundColor, backgroundColor, attributes = styleFromTag(foregroundColor, backgroundColor, attributes, colorTags[colorPos]) - colorPos++ - case 1: - // Process region tags. - regionID = regions[regionPos][1] - _, highlighted = t.highlights[regionID] - - // Update highlight range. - if highlighted { - line := len(t.index) - if t.fromHighlight < 0 { - t.fromHighlight, t.toHighlight = line, line - t.posHighlight = stringWidth(splitLine[:strippedTagStart]) - } else if line > t.toHighlight { - t.toHighlight = line - } - } - - regionPos++ - case 2: - // Process escape tags. - escapePos++ - } - } - - // Advance to next line. - originalPos += lineLength + totalTagLength - - // Append this line. - line.NextPos = originalPos - line.Width = stringWidth(splitLine) - t.index = append(t.index, line) - } - - // Word-wrapped lines may have trailing whitespace. Remove it. - if t.wrap && t.wordWrap { - for _, line := range t.index { - str := t.buffer[line.Line][line.Pos:line.NextPos] - spaces := spacePattern.FindAllStringIndex(str, -1) - if spaces != nil && spaces[len(spaces)-1][1] == len(str) { - oldNextPos := line.NextPos - line.NextPos -= spaces[len(spaces)-1][1] - spaces[len(spaces)-1][0] - line.Width -= stringWidth(t.buffer[line.Line][line.NextPos:oldNextPos]) - } - } - } - } - - // Calculate longest line. - t.longestLine = 0 - for _, line := range t.index { - if line.Width > t.longestLine { - t.longestLine = line.Width - } - } -} - -// Draw draws this primitive onto the screen. -func (t *TextView) Draw(screen tcell.Screen) { - t.Lock() - defer t.Unlock() - t.Box.Draw(screen) - totalWidth, totalHeight := screen.Size() - - // Get the available size. - x, y, width, height := t.GetInnerRect() - t.pageSize = height - - // If the width has changed, we need to reindex. - if width != t.lastWidth && t.wrap { - t.index = nil - } - t.lastWidth = width - - // Re-index. - t.reindexBuffer(width) - if t.regions { - t.regionInfos = nil - } - - // If we don't have an index, there's nothing to draw. - if t.index == nil { - return - } - - // Move to highlighted regions. - if t.regions && t.scrollToHighlights && t.fromHighlight >= 0 { - // Do we fit the entire height? - if t.toHighlight-t.fromHighlight+1 < height { - // Yes, let's center the highlights. - t.lineOffset = (t.fromHighlight + t.toHighlight - height) / 2 - } else { - // No, let's move to the start of the highlights. - t.lineOffset = t.fromHighlight - } - - // If the highlight is too far to the right, move it to the middle. - if t.posHighlight-t.columnOffset > 3*width/4 { - t.columnOffset = t.posHighlight - width/2 - } - - // If the highlight is off-screen on the left, move it on-screen. - if t.posHighlight-t.columnOffset < 0 { - t.columnOffset = t.posHighlight - width/4 - } - } - t.scrollToHighlights = false - - // Adjust line offset. - if t.lineOffset+height > len(t.index) { - t.trackEnd = true - } - if t.trackEnd { - t.lineOffset = len(t.index) - height - } - if t.lineOffset < 0 { - t.lineOffset = 0 - } - - // Adjust column offset. - if t.align == AlignLeft { - if t.columnOffset+width > t.longestLine { - t.columnOffset = t.longestLine - width - } - if t.columnOffset < 0 { - t.columnOffset = 0 - } - } else if t.align == AlignRight { - if t.columnOffset-width < -t.longestLine { - t.columnOffset = width - t.longestLine - } - if t.columnOffset > 0 { - t.columnOffset = 0 - } - } else { // AlignCenter. - half := (t.longestLine - width) / 2 - if half > 0 { - if t.columnOffset > half { - t.columnOffset = half - } - if t.columnOffset < -half { - t.columnOffset = -half - } - } else { - t.columnOffset = 0 - } - } - - // Draw the buffer. - defaultStyle := tcell.StyleDefault.Foreground(t.textColor) - for line := t.lineOffset; line < len(t.index); line++ { - // Are we done? - if line-t.lineOffset >= height || y+line-t.lineOffset >= totalHeight { - break - } - - // Get the text for this line. - index := t.index[line] - text := t.buffer[index.Line][index.Pos:index.NextPos] - foregroundColor := index.ForegroundColor - backgroundColor := index.BackgroundColor - attributes := index.Attributes - regionID := index.Region - if t.regions && regionID != "" && (len(t.regionInfos) == 0 || t.regionInfos[len(t.regionInfos)-1].ID != regionID) { - t.regionInfos = append(t.regionInfos, &textViewRegion{ - ID: regionID, - FromX: x, - FromY: y + line - t.lineOffset, - ToX: -1, - ToY: -1, - }) - } - - // Process tags. - colorTagIndices, colorTags, regionIndices, regions, escapeIndices, strippedText, _ := decomposeString(text, t.dynamicColors, t.regions) - - // Calculate the position of the line. - var skip, posX int - if t.align == AlignLeft { - posX = -t.columnOffset - } else if t.align == AlignRight { - posX = width - index.Width - t.columnOffset - } else { // AlignCenter. - posX = (width-index.Width)/2 - t.columnOffset - } - if posX < 0 { - skip = -posX - posX = 0 - } - - // Print the line. - if y+line-t.lineOffset >= 0 { - var colorPos, regionPos, escapePos, tagOffset, skipped int - iterateString(strippedText, func(main rune, comb []rune, textPos, textWidth, screenPos, screenWidth int) bool { - // Process tags. - for { - if colorPos < len(colorTags) && textPos+tagOffset >= colorTagIndices[colorPos][0] && textPos+tagOffset < colorTagIndices[colorPos][1] { - // Get the color. - foregroundColor, backgroundColor, attributes = styleFromTag(foregroundColor, backgroundColor, attributes, colorTags[colorPos]) - tagOffset += colorTagIndices[colorPos][1] - colorTagIndices[colorPos][0] - colorPos++ - } else if regionPos < len(regionIndices) && textPos+tagOffset >= regionIndices[regionPos][0] && textPos+tagOffset < regionIndices[regionPos][1] { - // Get the region. - if regionID != "" && len(t.regionInfos) > 0 && t.regionInfos[len(t.regionInfos)-1].ID == regionID { - // End last region. - t.regionInfos[len(t.regionInfos)-1].ToX = x + posX - t.regionInfos[len(t.regionInfos)-1].ToY = y + line - t.lineOffset - } - regionID = regions[regionPos][1] - if regionID != "" { - // Start new region. - t.regionInfos = append(t.regionInfos, &textViewRegion{ - ID: regionID, - FromX: x + posX, - FromY: y + line - t.lineOffset, - ToX: -1, - ToY: -1, - }) - } - tagOffset += regionIndices[regionPos][1] - regionIndices[regionPos][0] - regionPos++ - } else { - break - } - } - - // Skip the second-to-last character of an escape tag. - if escapePos < len(escapeIndices) && textPos+tagOffset == escapeIndices[escapePos][1]-2 { - tagOffset++ - escapePos++ - } - - // Mix the existing style with the new style. - _, _, existingStyle, _ := screen.GetContent(x+posX, y+line-t.lineOffset) - _, background, _ := existingStyle.Decompose() - style := overlayStyle(background, defaultStyle, foregroundColor, backgroundColor, attributes) - - // Do we highlight this character? - var highlighted bool - if regionID != "" { - if _, ok := t.highlights[regionID]; ok { - highlighted = true - } - } - if highlighted { - fg, bg, _ := style.Decompose() - if bg == tcell.ColorDefault { - r, g, b := fg.RGB() - c := colorful.Color{R: float64(r) / 255, G: float64(g) / 255, B: float64(b) / 255} - _, _, li := c.Hcl() - if li < .5 { - bg = tcell.ColorWhite - } else { - bg = tcell.ColorBlack - } - } - style = style.Background(fg).Foreground(bg) - } - - // Skip to the right. - if !t.wrap && skipped < skip { - skipped += screenWidth - return false - } - - // Stop at the right border. - if posX+screenWidth > width || x+posX >= totalWidth { - return true - } - - // Draw the character. - for offset := screenWidth - 1; offset >= 0; offset-- { - if offset == 0 { - screen.SetContent(x+posX+offset, y+line-t.lineOffset, main, comb, style) - } else { - screen.SetContent(x+posX+offset, y+line-t.lineOffset, ' ', nil, style) - } - } - - // Advance. - posX += screenWidth - return false - }) - } - } - - // If this view is not scrollable, we'll purge the buffer of lines that have - // scrolled out of view. - if !t.scrollable && t.lineOffset > 0 { - if t.lineOffset >= len(t.index) { - t.buffer = nil - } else { - t.buffer = t.buffer[t.index[t.lineOffset].Line:] - } - t.index = nil - t.lineOffset = 0 - } -} - -// InputHandler returns the handler for this primitive. -func (t *TextView) InputHandler() func(event *tcell.EventKey, setFocus func(p Primitive)) { - return t.WrapInputHandler(func(event *tcell.EventKey, setFocus func(p Primitive)) { - key := event.Key() - - if key == tcell.KeyEscape || key == tcell.KeyEnter || key == tcell.KeyTab || key == tcell.KeyBacktab { - if t.done != nil { - t.done(key) - } - return - } - - if !t.scrollable { - return - } - - switch key { - case tcell.KeyRune: - switch event.Rune() { - case 'g': // Home. - t.trackEnd = false - t.lineOffset = 0 - t.columnOffset = 0 - case 'G': // End. - t.trackEnd = true - t.columnOffset = 0 - case 'j': // Down. - t.lineOffset++ - case 'k': // Up. - t.trackEnd = false - t.lineOffset-- - case 'h': // Left. - t.columnOffset-- - case 'l': // Right. - t.columnOffset++ - } - case tcell.KeyHome: - t.trackEnd = false - t.lineOffset = 0 - t.columnOffset = 0 - case tcell.KeyEnd: - t.trackEnd = true - t.columnOffset = 0 - case tcell.KeyUp: - t.trackEnd = false - t.lineOffset-- - case tcell.KeyDown: - t.lineOffset++ - case tcell.KeyLeft: - t.columnOffset-- - case tcell.KeyRight: - t.columnOffset++ - case tcell.KeyPgDn, tcell.KeyCtrlF: - t.lineOffset += t.pageSize - case tcell.KeyPgUp, tcell.KeyCtrlB: - t.trackEnd = false - t.lineOffset -= t.pageSize - } - }) -} - -// MouseHandler returns the mouse handler for this primitive. -func (t *TextView) MouseHandler() func(action MouseAction, event *tcell.EventMouse, setFocus func(p Primitive)) (consumed bool, capture Primitive) { - return t.WrapMouseHandler(func(action MouseAction, event *tcell.EventMouse, setFocus func(p Primitive)) (consumed bool, capture Primitive) { - x, y := event.Position() - if !t.InRect(x, y) { - return false, nil - } - - switch action { - case MouseLeftClick: - if t.regions { - // Find a region to highlight. - for _, region := range t.regionInfos { - if y == region.FromY && x < region.FromX || - y == region.ToY && x >= region.ToX || - region.FromY >= 0 && y < region.FromY || - region.ToY >= 0 && y > region.ToY { - continue - } - t.Highlight(region.ID) - break - } - } - consumed = true - setFocus(t) - case MouseScrollUp: - t.trackEnd = false - t.lineOffset-- - consumed = true - case MouseScrollDown: - t.lineOffset++ - consumed = true - } - - return - }) -} diff --git a/vendor/github.com/rivo/tview/treeview.go b/vendor/github.com/rivo/tview/treeview.go deleted file mode 100644 index ea4585ae..00000000 --- a/vendor/github.com/rivo/tview/treeview.go +++ /dev/null @@ -1,775 +0,0 @@ -package tview - -import ( - "github.com/gdamore/tcell" -) - -// Tree navigation events. -const ( - treeNone int = iota - treeHome - treeEnd - treeUp - treeDown - treePageUp - treePageDown -) - -// TreeNode represents one node in a tree view. -type TreeNode struct { - // The reference object. - reference interface{} - - // This node's child nodes. - children []*TreeNode - - // The item's text. - text string - - // The text color. - color tcell.Color - - // Whether or not this node can be selected. - selectable bool - - // Whether or not this node's children should be displayed. - expanded bool - - // The additional horizontal indent of this node's text. - indent int - - // An optional function which is called when the user selects this node. - selected func() - - // Temporary member variables. - parent *TreeNode // The parent node (nil for the root). - level int // The hierarchy level (0 for the root, 1 for its children, and so on). - graphicsX int // The x-coordinate of the left-most graphics rune. - textX int // The x-coordinate of the first rune of the text. -} - -// NewTreeNode returns a new tree node. -func NewTreeNode(text string) *TreeNode { - return &TreeNode{ - text: text, - color: Styles.PrimaryTextColor, - indent: 2, - expanded: true, - selectable: true, - } -} - -// Walk traverses this node's subtree in depth-first, pre-order (NLR) order and -// calls the provided callback function on each traversed node (which includes -// this node) with the traversed node and its parent node (nil for this node). -// The callback returns whether traversal should continue with the traversed -// node's child nodes (true) or not recurse any deeper (false). -func (n *TreeNode) Walk(callback func(node, parent *TreeNode) bool) *TreeNode { - n.parent = nil - nodes := []*TreeNode{n} - for len(nodes) > 0 { - // Pop the top node and process it. - node := nodes[len(nodes)-1] - nodes = nodes[:len(nodes)-1] - if !callback(node, node.parent) { - // Don't add any children. - continue - } - - // Add children in reverse order. - for index := len(node.children) - 1; index >= 0; index-- { - node.children[index].parent = node - nodes = append(nodes, node.children[index]) - } - } - - return n -} - -// SetReference allows you to store a reference of any type in this node. This -// will allow you to establish a mapping between the TreeView hierarchy and your -// internal tree structure. -func (n *TreeNode) SetReference(reference interface{}) *TreeNode { - n.reference = reference - return n -} - -// GetReference returns this node's reference object. -func (n *TreeNode) GetReference() interface{} { - return n.reference -} - -// SetChildren sets this node's child nodes. -func (n *TreeNode) SetChildren(childNodes []*TreeNode) *TreeNode { - n.children = childNodes - return n -} - -// GetText returns this node's text. -func (n *TreeNode) GetText() string { - return n.text -} - -// GetChildren returns this node's children. -func (n *TreeNode) GetChildren() []*TreeNode { - return n.children -} - -// ClearChildren removes all child nodes from this node. -func (n *TreeNode) ClearChildren() *TreeNode { - n.children = nil - return n -} - -// AddChild adds a new child node to this node. -func (n *TreeNode) AddChild(node *TreeNode) *TreeNode { - n.children = append(n.children, node) - return n -} - -// SetSelectable sets a flag indicating whether this node can be selected by -// the user. -func (n *TreeNode) SetSelectable(selectable bool) *TreeNode { - n.selectable = selectable - return n -} - -// SetSelectedFunc sets a function which is called when the user selects this -// node by hitting Enter when it is selected. -func (n *TreeNode) SetSelectedFunc(handler func()) *TreeNode { - n.selected = handler - return n -} - -// SetExpanded sets whether or not this node's child nodes should be displayed. -func (n *TreeNode) SetExpanded(expanded bool) *TreeNode { - n.expanded = expanded - return n -} - -// Expand makes the child nodes of this node appear. -func (n *TreeNode) Expand() *TreeNode { - n.expanded = true - return n -} - -// Collapse makes the child nodes of this node disappear. -func (n *TreeNode) Collapse() *TreeNode { - n.expanded = false - return n -} - -// ExpandAll expands this node and all descendent nodes. -func (n *TreeNode) ExpandAll() *TreeNode { - n.Walk(func(node, parent *TreeNode) bool { - node.expanded = true - return true - }) - return n -} - -// CollapseAll collapses this node and all descendent nodes. -func (n *TreeNode) CollapseAll() *TreeNode { - n.Walk(func(node, parent *TreeNode) bool { - n.expanded = false - return true - }) - return n -} - -// IsExpanded returns whether the child nodes of this node are visible. -func (n *TreeNode) IsExpanded() bool { - return n.expanded -} - -// SetText sets the node's text which is displayed. -func (n *TreeNode) SetText(text string) *TreeNode { - n.text = text - return n -} - -// GetColor returns the node's color. -func (n *TreeNode) GetColor() tcell.Color { - return n.color -} - -// SetColor sets the node's text color. -func (n *TreeNode) SetColor(color tcell.Color) *TreeNode { - n.color = color - return n -} - -// SetIndent sets an additional indentation for this node's text. A value of 0 -// keeps the text as far left as possible with a minimum of line graphics. Any -// value greater than that moves the text to the right. -func (n *TreeNode) SetIndent(indent int) *TreeNode { - n.indent = indent - return n -} - -// TreeView displays tree structures. A tree consists of nodes (TreeNode -// objects) where each node has zero or more child nodes and exactly one parent -// node (except for the root node which has no parent node). -// -// The SetRoot() function is used to specify the root of the tree. Other nodes -// are added locally to the root node or any of its descendents. See the -// TreeNode documentation for details on node attributes. (You can use -// SetReference() to store a reference to nodes of your own tree structure.) -// -// Nodes can be selected by calling SetCurrentNode(). The user can navigate the -// selection or the tree by using the following keys: -// -// - j, down arrow, right arrow: Move (the selection) down by one node. -// - k, up arrow, left arrow: Move (the selection) up by one node. -// - g, home: Move (the selection) to the top. -// - G, end: Move (the selection) to the bottom. -// - Ctrl-F, page down: Move (the selection) down by one page. -// - Ctrl-B, page up: Move (the selection) up by one page. -// -// Selected nodes can trigger the "selected" callback when the user hits Enter. -// -// The root node corresponds to level 0, its children correspond to level 1, -// their children to level 2, and so on. Per default, the first level that is -// displayed is 0, i.e. the root node. You can call SetTopLevel() to hide -// levels. -// -// If graphics are turned on (see SetGraphics()), lines indicate the tree's -// hierarchy. Alternative (or additionally), you can set different prefixes -// using SetPrefixes() for different levels, for example to display hierarchical -// bullet point lists. -// -// See https://github.com/rivo/tview/wiki/TreeView for an example. -type TreeView struct { - *Box - - // The root node. - root *TreeNode - - // The currently selected node or nil if no node is selected. - currentNode *TreeNode - - // The movement to be performed during the call to Draw(), one of the - // constants defined above. - movement int - - // The top hierarchical level shown. (0 corresponds to the root level.) - topLevel int - - // Strings drawn before the nodes, based on their level. - prefixes []string - - // Vertical scroll offset. - offsetY int - - // If set to true, all node texts will be aligned horizontally. - align bool - - // If set to true, the tree structure is drawn using lines. - graphics bool - - // The color of the lines. - graphicsColor tcell.Color - - // An optional function which is called when the user has navigated to a new - // tree node. - changed func(node *TreeNode) - - // An optional function which is called when a tree item was selected. - selected func(node *TreeNode) - - // An optional function which is called when the user moves away from this - // primitive. - done func(key tcell.Key) - - // The visible nodes, top-down, as set by process(). - nodes []*TreeNode -} - -// NewTreeView returns a new tree view. -func NewTreeView() *TreeView { - return &TreeView{ - Box: NewBox(), - graphics: true, - graphicsColor: Styles.GraphicsColor, - } -} - -// SetRoot sets the root node of the tree. -func (t *TreeView) SetRoot(root *TreeNode) *TreeView { - t.root = root - return t -} - -// GetRoot returns the root node of the tree. If no such node was previously -// set, nil is returned. -func (t *TreeView) GetRoot() *TreeNode { - return t.root -} - -// SetCurrentNode sets the currently selected node. Provide nil to clear all -// selections. Selected nodes must be visible and selectable, or else the -// selection will be changed to the top-most selectable and visible node. -// -// This function does NOT trigger the "changed" callback. -func (t *TreeView) SetCurrentNode(node *TreeNode) *TreeView { - t.currentNode = node - return t -} - -// GetCurrentNode returns the currently selected node or nil of no node is -// currently selected. -func (t *TreeView) GetCurrentNode() *TreeNode { - return t.currentNode -} - -// SetTopLevel sets the first tree level that is visible with 0 referring to the -// root, 1 to the root's child nodes, and so on. Nodes above the top level are -// not displayed. -func (t *TreeView) SetTopLevel(topLevel int) *TreeView { - t.topLevel = topLevel - return t -} - -// SetPrefixes defines the strings drawn before the nodes' texts. This is a -// slice of strings where each element corresponds to a node's hierarchy level, -// i.e. 0 for the root, 1 for the root's children, and so on (levels will -// cycle). -// -// For example, to display a hierarchical list with bullet points: -// -// treeView.SetGraphics(false). -// SetPrefixes([]string{"* ", "- ", "x "}) -func (t *TreeView) SetPrefixes(prefixes []string) *TreeView { - t.prefixes = prefixes - return t -} - -// SetAlign controls the horizontal alignment of the node texts. If set to true, -// all texts except that of top-level nodes will be placed in the same column. -// If set to false, they will indent with the hierarchy. -func (t *TreeView) SetAlign(align bool) *TreeView { - t.align = align - return t -} - -// SetGraphics sets a flag which determines whether or not line graphics are -// drawn to illustrate the tree's hierarchy. -func (t *TreeView) SetGraphics(showGraphics bool) *TreeView { - t.graphics = showGraphics - return t -} - -// SetGraphicsColor sets the colors of the lines used to draw the tree structure. -func (t *TreeView) SetGraphicsColor(color tcell.Color) *TreeView { - t.graphicsColor = color - return t -} - -// SetChangedFunc sets the function which is called when the user navigates to -// a new tree node. -func (t *TreeView) SetChangedFunc(handler func(node *TreeNode)) *TreeView { - t.changed = handler - return t -} - -// SetSelectedFunc sets the function which is called when the user selects a -// node by pressing Enter on the current selection. -func (t *TreeView) SetSelectedFunc(handler func(node *TreeNode)) *TreeView { - t.selected = handler - return t -} - -// SetDoneFunc sets a handler which is called whenever the user presses the -// Escape, Tab, or Backtab key. -func (t *TreeView) SetDoneFunc(handler func(key tcell.Key)) *TreeView { - t.done = handler - return t -} - -// GetScrollOffset returns the number of node rows that were skipped at the top -// of the tree view. Note that when the user navigates the tree view, this value -// is only updated after the tree view has been redrawn. -func (t *TreeView) GetScrollOffset() int { - return t.offsetY -} - -// GetRowCount returns the number of "visible" nodes. This includes nodes which -// fall outside the tree view's box but notably does not include the children -// of collapsed nodes. Note that this value is only up to date after the tree -// view has been drawn. -func (t *TreeView) GetRowCount() int { - return len(t.nodes) -} - -// process builds the visible tree, populates the "nodes" slice, and processes -// pending selection actions. -func (t *TreeView) process() { - _, _, _, height := t.GetInnerRect() - - // Determine visible nodes and their placement. - var graphicsOffset, maxTextX int - t.nodes = nil - if t.root == nil { - return - } - selectedIndex := -1 - topLevelGraphicsX := -1 - if t.graphics { - graphicsOffset = 1 - } - t.root.Walk(func(node, parent *TreeNode) bool { - // Set node attributes. - node.parent = parent - if parent == nil { - node.level = 0 - node.graphicsX = 0 - node.textX = 0 - } else { - node.level = parent.level + 1 - node.graphicsX = parent.textX - node.textX = node.graphicsX + graphicsOffset + node.indent - } - if !t.graphics && t.align { - // Without graphics, we align nodes on the first column. - node.textX = 0 - } - if node.level == t.topLevel { - // No graphics for top level nodes. - node.graphicsX = 0 - node.textX = 0 - } - - // Add the node to the list. - if node.level >= t.topLevel { - // This node will be visible. - if node.textX > maxTextX { - maxTextX = node.textX - } - if node == t.currentNode && node.selectable { - selectedIndex = len(t.nodes) - } - - // Maybe we want to skip this level. - if t.topLevel == node.level && (topLevelGraphicsX < 0 || node.graphicsX < topLevelGraphicsX) { - topLevelGraphicsX = node.graphicsX - } - - t.nodes = append(t.nodes, node) - } - - // Recurse if desired. - return node.expanded - }) - - // Post-process positions. - for _, node := range t.nodes { - // If text must align, we correct the positions. - if t.align && node.level > t.topLevel { - node.textX = maxTextX - } - - // If we skipped levels, shift to the left. - if topLevelGraphicsX > 0 { - node.graphicsX -= topLevelGraphicsX - node.textX -= topLevelGraphicsX - } - } - - // Process selection. (Also trigger events if necessary.) - if selectedIndex >= 0 { - // Move the selection. - newSelectedIndex := selectedIndex - MovementSwitch: - switch t.movement { - case treeUp: - for newSelectedIndex > 0 { - newSelectedIndex-- - if t.nodes[newSelectedIndex].selectable { - break MovementSwitch - } - } - newSelectedIndex = selectedIndex - case treeDown: - for newSelectedIndex < len(t.nodes)-1 { - newSelectedIndex++ - if t.nodes[newSelectedIndex].selectable { - break MovementSwitch - } - } - newSelectedIndex = selectedIndex - case treeHome: - for newSelectedIndex = 0; newSelectedIndex < len(t.nodes); newSelectedIndex++ { - if t.nodes[newSelectedIndex].selectable { - break MovementSwitch - } - } - newSelectedIndex = selectedIndex - case treeEnd: - for newSelectedIndex = len(t.nodes) - 1; newSelectedIndex >= 0; newSelectedIndex-- { - if t.nodes[newSelectedIndex].selectable { - break MovementSwitch - } - } - newSelectedIndex = selectedIndex - case treePageDown: - if newSelectedIndex+height < len(t.nodes) { - newSelectedIndex += height - } else { - newSelectedIndex = len(t.nodes) - 1 - } - for ; newSelectedIndex < len(t.nodes); newSelectedIndex++ { - if t.nodes[newSelectedIndex].selectable { - break MovementSwitch - } - } - newSelectedIndex = selectedIndex - case treePageUp: - if newSelectedIndex >= height { - newSelectedIndex -= height - } else { - newSelectedIndex = 0 - } - for ; newSelectedIndex >= 0; newSelectedIndex-- { - if t.nodes[newSelectedIndex].selectable { - break MovementSwitch - } - } - newSelectedIndex = selectedIndex - } - t.currentNode = t.nodes[newSelectedIndex] - if newSelectedIndex != selectedIndex { - t.movement = treeNone - if t.changed != nil { - t.changed(t.currentNode) - } - } - selectedIndex = newSelectedIndex - - // Move selection into viewport. - if selectedIndex-t.offsetY >= height { - t.offsetY = selectedIndex - height + 1 - } - if selectedIndex < t.offsetY { - t.offsetY = selectedIndex - } - } else { - // If selection is not visible or selectable, select the first candidate. - if t.currentNode != nil { - for index, node := range t.nodes { - if node.selectable { - selectedIndex = index - t.currentNode = node - break - } - } - } - if selectedIndex < 0 { - t.currentNode = nil - } - } -} - -// Draw draws this primitive onto the screen. -func (t *TreeView) Draw(screen tcell.Screen) { - t.Box.Draw(screen) - if t.root == nil { - return - } - _, totalHeight := screen.Size() - - t.process() - - // Scroll the tree. - x, y, width, height := t.GetInnerRect() - switch t.movement { - case treeUp: - t.offsetY-- - case treeDown: - t.offsetY++ - case treeHome: - t.offsetY = 0 - case treeEnd: - t.offsetY = len(t.nodes) - case treePageUp: - t.offsetY -= height - case treePageDown: - t.offsetY += height - } - t.movement = treeNone - - // Fix invalid offsets. - if t.offsetY >= len(t.nodes)-height { - t.offsetY = len(t.nodes) - height - } - if t.offsetY < 0 { - t.offsetY = 0 - } - - // Draw the tree. - posY := y - lineStyle := tcell.StyleDefault.Background(t.backgroundColor).Foreground(t.graphicsColor) - for index, node := range t.nodes { - // Skip invisible parts. - if posY >= y+height+1 || posY >= totalHeight { - break - } - if index < t.offsetY { - continue - } - - // Draw the graphics. - if t.graphics { - // Draw ancestor branches. - ancestor := node.parent - for ancestor != nil && ancestor.parent != nil && ancestor.parent.level >= t.topLevel { - if ancestor.graphicsX >= width { - continue - } - - // Draw a branch if this ancestor is not a last child. - if ancestor.parent.children[len(ancestor.parent.children)-1] != ancestor { - if posY-1 >= y && ancestor.textX > ancestor.graphicsX { - PrintJoinedSemigraphics(screen, x+ancestor.graphicsX, posY-1, Borders.Vertical, t.graphicsColor) - } - if posY < y+height { - screen.SetContent(x+ancestor.graphicsX, posY, Borders.Vertical, nil, lineStyle) - } - } - ancestor = ancestor.parent - } - - if node.textX > node.graphicsX && node.graphicsX < width { - // Connect to the node above. - if posY-1 >= y && t.nodes[index-1].graphicsX <= node.graphicsX && t.nodes[index-1].textX > node.graphicsX { - PrintJoinedSemigraphics(screen, x+node.graphicsX, posY-1, Borders.TopLeft, t.graphicsColor) - } - - // Join this node. - if posY < y+height { - screen.SetContent(x+node.graphicsX, posY, Borders.BottomLeft, nil, lineStyle) - for pos := node.graphicsX + 1; pos < node.textX && pos < width; pos++ { - screen.SetContent(x+pos, posY, Borders.Horizontal, nil, lineStyle) - } - } - } - } - - // Draw the prefix and the text. - if node.textX < width && posY < y+height { - // Prefix. - var prefixWidth int - if len(t.prefixes) > 0 { - _, prefixWidth = Print(screen, t.prefixes[(node.level-t.topLevel)%len(t.prefixes)], x+node.textX, posY, width-node.textX, AlignLeft, node.color) - } - - // Text. - if node.textX+prefixWidth < width { - style := tcell.StyleDefault.Foreground(node.color) - if node == t.currentNode { - style = tcell.StyleDefault.Background(node.color).Foreground(t.backgroundColor) - } - printWithStyle(screen, node.text, x+node.textX+prefixWidth, posY, width-node.textX-prefixWidth, AlignLeft, style) - } - } - - // Advance. - posY++ - } -} - -// InputHandler returns the handler for this primitive. -func (t *TreeView) InputHandler() func(event *tcell.EventKey, setFocus func(p Primitive)) { - return t.WrapInputHandler(func(event *tcell.EventKey, setFocus func(p Primitive)) { - selectNode := func() { - node := t.currentNode - if node != nil { - if t.selected != nil { - t.selected(node) - } - if node.selected != nil { - node.selected() - } - } - } - - // Because the tree is flattened into a list only at drawing time, we also - // postpone the (selection) movement to drawing time. - switch key := event.Key(); key { - case tcell.KeyTab, tcell.KeyBacktab, tcell.KeyEscape: - if t.done != nil { - t.done(key) - } - case tcell.KeyDown, tcell.KeyRight: - t.movement = treeDown - case tcell.KeyUp, tcell.KeyLeft: - t.movement = treeUp - case tcell.KeyHome: - t.movement = treeHome - case tcell.KeyEnd: - t.movement = treeEnd - case tcell.KeyPgDn, tcell.KeyCtrlF: - t.movement = treePageDown - case tcell.KeyPgUp, tcell.KeyCtrlB: - t.movement = treePageUp - case tcell.KeyRune: - switch event.Rune() { - case 'g': - t.movement = treeHome - case 'G': - t.movement = treeEnd - case 'j': - t.movement = treeDown - case 'k': - t.movement = treeUp - case ' ': - selectNode() - } - case tcell.KeyEnter: - selectNode() - } - - t.process() - }) -} - -// MouseHandler returns the mouse handler for this primitive. -func (t *TreeView) MouseHandler() func(action MouseAction, event *tcell.EventMouse, setFocus func(p Primitive)) (consumed bool, capture Primitive) { - return t.WrapMouseHandler(func(action MouseAction, event *tcell.EventMouse, setFocus func(p Primitive)) (consumed bool, capture Primitive) { - x, y := event.Position() - if !t.InRect(x, y) { - return false, nil - } - - switch action { - case MouseLeftClick: - setFocus(t) - _, rectY, _, _ := t.GetInnerRect() - y -= rectY - if y >= 0 && y < len(t.nodes) { - node := t.nodes[y] - if node.selectable { - previousNode := t.currentNode - t.currentNode = node - if previousNode != node && t.changed != nil { - t.changed(node) - } - if t.selected != nil { - t.selected(node) - } - if node.selected != nil { - node.selected() - } - } - } - consumed = true - case MouseScrollUp: - t.movement = treeUp - consumed = true - case MouseScrollDown: - t.movement = treeDown - consumed = true - } - - return - }) -} diff --git a/vendor/github.com/rivo/tview/tview.gif b/vendor/github.com/rivo/tview/tview.gif deleted file mode 100644 index 0583d7b9..00000000 Binary files a/vendor/github.com/rivo/tview/tview.gif and /dev/null differ diff --git a/vendor/github.com/rivo/tview/util.go b/vendor/github.com/rivo/tview/util.go deleted file mode 100644 index 3bd0d3d9..00000000 --- a/vendor/github.com/rivo/tview/util.go +++ /dev/null @@ -1,630 +0,0 @@ -package tview - -import ( - "math" - "regexp" - "sort" - "strconv" - - "github.com/gdamore/tcell" - runewidth "github.com/mattn/go-runewidth" - "github.com/rivo/uniseg" -) - -// Text alignment within a box. -const ( - AlignLeft = iota - AlignCenter - AlignRight -) - -// Common regular expressions. -var ( - colorPattern = regexp.MustCompile(`\[([a-zA-Z]+|#[0-9a-zA-Z]{6}|\-)?(:([a-zA-Z]+|#[0-9a-zA-Z]{6}|\-)?(:([lbdru]+|\-)?)?)?\]`) - regionPattern = regexp.MustCompile(`\["([a-zA-Z0-9_,;: \-\.]*)"\]`) - escapePattern = regexp.MustCompile(`\[([a-zA-Z0-9_,;: \-\."#]+)\[(\[*)\]`) - nonEscapePattern = regexp.MustCompile(`(\[[a-zA-Z0-9_,;: \-\."#]+\[*)\]`) - boundaryPattern = regexp.MustCompile(`(([,\.\-:;!\?&#+]|\n)[ \t\f\r]*|([ \t\f\r]+))`) - spacePattern = regexp.MustCompile(`\s+`) -) - -// Positions of substrings in regular expressions. -const ( - colorForegroundPos = 1 - colorBackgroundPos = 3 - colorFlagPos = 5 -) - -// Predefined InputField acceptance functions. -var ( - // InputFieldInteger accepts integers. - InputFieldInteger func(text string, ch rune) bool - - // InputFieldFloat accepts floating-point numbers. - InputFieldFloat func(text string, ch rune) bool - - // InputFieldMaxLength returns an input field accept handler which accepts - // input strings up to a given length. Use it like this: - // - // inputField.SetAcceptanceFunc(InputFieldMaxLength(10)) // Accept up to 10 characters. - InputFieldMaxLength func(maxLength int) func(text string, ch rune) bool -) - -// Package initialization. -func init() { - // We'll use zero width joiners. - runewidth.ZeroWidthJoiner = true - - // Initialize the predefined input field handlers. - InputFieldInteger = func(text string, ch rune) bool { - if text == "-" { - return true - } - _, err := strconv.Atoi(text) - return err == nil - } - InputFieldFloat = func(text string, ch rune) bool { - if text == "-" || text == "." || text == "-." { - return true - } - _, err := strconv.ParseFloat(text, 64) - return err == nil - } - InputFieldMaxLength = func(maxLength int) func(text string, ch rune) bool { - return func(text string, ch rune) bool { - return len([]rune(text)) <= maxLength - } - } -} - -// styleFromTag takes the given style, defined by a foreground color (fgColor), -// a background color (bgColor), and style attributes, and modifies it based on -// the substrings (tagSubstrings) extracted by the regular expression for color -// tags. The new colors and attributes are returned where empty strings mean -// "don't modify" and a dash ("-") means "reset to default". -func styleFromTag(fgColor, bgColor, attributes string, tagSubstrings []string) (newFgColor, newBgColor, newAttributes string) { - if tagSubstrings[colorForegroundPos] != "" { - color := tagSubstrings[colorForegroundPos] - if color == "-" { - fgColor = "-" - } else if color != "" { - fgColor = color - } - } - - if tagSubstrings[colorBackgroundPos-1] != "" { - color := tagSubstrings[colorBackgroundPos] - if color == "-" { - bgColor = "-" - } else if color != "" { - bgColor = color - } - } - - if tagSubstrings[colorFlagPos-1] != "" { - flags := tagSubstrings[colorFlagPos] - if flags == "-" { - attributes = "-" - } else if flags != "" { - attributes = flags - } - } - - return fgColor, bgColor, attributes -} - -// overlayStyle mixes a background color with a foreground color (fgColor), -// a (possibly new) background color (bgColor), and style attributes, and -// returns the resulting style. For a definition of the colors and attributes, -// see styleFromTag(). Reset instructions cause the corresponding part of the -// default style to be used. -func overlayStyle(background tcell.Color, defaultStyle tcell.Style, fgColor, bgColor, attributes string) tcell.Style { - defFg, defBg, defAttr := defaultStyle.Decompose() - style := defaultStyle.Background(background) - - style = style.Foreground(defFg) - if fgColor != "" { - if fgColor == "-" { - style = style.Foreground(defFg) - } else { - style = style.Foreground(tcell.GetColor(fgColor)) - } - } - - if bgColor == "-" || bgColor == "" && defBg != tcell.ColorDefault { - style = style.Background(defBg) - } else if bgColor != "" { - style = style.Background(tcell.GetColor(bgColor)) - } - - if attributes == "-" { - style = style.Bold(defAttr&tcell.AttrBold > 0) - style = style.Blink(defAttr&tcell.AttrBlink > 0) - style = style.Reverse(defAttr&tcell.AttrReverse > 0) - style = style.Underline(defAttr&tcell.AttrUnderline > 0) - style = style.Dim(defAttr&tcell.AttrDim > 0) - } else if attributes != "" { - style = style.Normal() - for _, flag := range attributes { - switch flag { - case 'l': - style = style.Blink(true) - case 'b': - style = style.Bold(true) - case 'd': - style = style.Dim(true) - case 'r': - style = style.Reverse(true) - case 'u': - style = style.Underline(true) - } - } - } - - return style -} - -// decomposeString returns information about a string which may contain color -// tags or region tags, depending on which ones are requested to be found. It -// returns the indices of the color tags (as returned by -// re.FindAllStringIndex()), the color tags themselves (as returned by -// re.FindAllStringSubmatch()), the indices of region tags and the region tags -// themselves, the indices of an escaped tags (only if at least color tags or -// region tags are requested), the string stripped by any tags and escaped, and -// the screen width of the stripped string. -func decomposeString(text string, findColors, findRegions bool) (colorIndices [][]int, colors [][]string, regionIndices [][]int, regions [][]string, escapeIndices [][]int, stripped string, width int) { - // Shortcut for the trivial case. - if !findColors && !findRegions { - return nil, nil, nil, nil, nil, text, stringWidth(text) - } - - // Get positions of any tags. - if findColors { - colorIndices = colorPattern.FindAllStringIndex(text, -1) - colors = colorPattern.FindAllStringSubmatch(text, -1) - } - if findRegions { - regionIndices = regionPattern.FindAllStringIndex(text, -1) - regions = regionPattern.FindAllStringSubmatch(text, -1) - } - escapeIndices = escapePattern.FindAllStringIndex(text, -1) - - // Because the color pattern detects empty tags, we need to filter them out. - for i := len(colorIndices) - 1; i >= 0; i-- { - if colorIndices[i][1]-colorIndices[i][0] == 2 { - colorIndices = append(colorIndices[:i], colorIndices[i+1:]...) - colors = append(colors[:i], colors[i+1:]...) - } - } - - // Make a (sorted) list of all tags. - allIndices := make([][3]int, 0, len(colorIndices)+len(regionIndices)+len(escapeIndices)) - for indexType, index := range [][][]int{colorIndices, regionIndices, escapeIndices} { - for _, tag := range index { - allIndices = append(allIndices, [3]int{tag[0], tag[1], indexType}) - } - } - sort.Slice(allIndices, func(i int, j int) bool { - return allIndices[i][0] < allIndices[j][0] - }) - - // Remove the tags from the original string. - var from int - buf := make([]byte, 0, len(text)) - for _, indices := range allIndices { - if indices[2] == 2 { // Escape sequences are not simply removed. - buf = append(buf, []byte(text[from:indices[1]-2])...) - buf = append(buf, ']') - from = indices[1] - } else { - buf = append(buf, []byte(text[from:indices[0]])...) - from = indices[1] - } - } - buf = append(buf, text[from:]...) - stripped = string(buf) - - // Get the width of the stripped string. - width = stringWidth(stripped) - - return -} - -// Print prints text onto the screen into the given box at (x,y,maxWidth,1), -// not exceeding that box. "align" is one of AlignLeft, AlignCenter, or -// AlignRight. The screen's background color will not be changed. -// -// You can change the colors and text styles mid-text by inserting a color tag. -// See the package description for details. -// -// Returns the number of actual bytes of the text printed (including color tags) -// and the actual width used for the printed runes. -func Print(screen tcell.Screen, text string, x, y, maxWidth, align int, color tcell.Color) (int, int) { - return printWithStyle(screen, text, x, y, maxWidth, align, tcell.StyleDefault.Foreground(color)) -} - -// printWithStyle works like Print() but it takes a style instead of just a -// foreground color. -func printWithStyle(screen tcell.Screen, text string, x, y, maxWidth, align int, style tcell.Style) (int, int) { - totalWidth, totalHeight := screen.Size() - if maxWidth <= 0 || len(text) == 0 || y < 0 || y >= totalHeight { - return 0, 0 - } - - // Decompose the text. - colorIndices, colors, _, _, escapeIndices, strippedText, strippedWidth := decomposeString(text, true, false) - - // We want to reduce all alignments to AlignLeft. - if align == AlignRight { - if strippedWidth <= maxWidth { - // There's enough space for the entire text. - return printWithStyle(screen, text, x+maxWidth-strippedWidth, y, maxWidth, AlignLeft, style) - } - // Trim characters off the beginning. - var ( - bytes, width, colorPos, escapePos, tagOffset int - foregroundColor, backgroundColor, attributes string - ) - _, originalBackground, _ := style.Decompose() - iterateString(strippedText, func(main rune, comb []rune, textPos, textWidth, screenPos, screenWidth int) bool { - // Update color/escape tag offset and style. - if colorPos < len(colorIndices) && textPos+tagOffset >= colorIndices[colorPos][0] && textPos+tagOffset < colorIndices[colorPos][1] { - foregroundColor, backgroundColor, attributes = styleFromTag(foregroundColor, backgroundColor, attributes, colors[colorPos]) - style = overlayStyle(originalBackground, style, foregroundColor, backgroundColor, attributes) - tagOffset += colorIndices[colorPos][1] - colorIndices[colorPos][0] - colorPos++ - } - if escapePos < len(escapeIndices) && textPos+tagOffset >= escapeIndices[escapePos][0] && textPos+tagOffset < escapeIndices[escapePos][1] { - tagOffset++ - escapePos++ - } - if strippedWidth-screenPos < maxWidth { - // We chopped off enough. - if escapePos > 0 && textPos+tagOffset-1 >= escapeIndices[escapePos-1][0] && textPos+tagOffset-1 < escapeIndices[escapePos-1][1] { - // Unescape open escape sequences. - escapeCharPos := escapeIndices[escapePos-1][1] - 2 - text = text[:escapeCharPos] + text[escapeCharPos+1:] - } - // Print and return. - bytes, width = printWithStyle(screen, text[textPos+tagOffset:], x, y, maxWidth, AlignLeft, style) - return true - } - return false - }) - return bytes, width - } else if align == AlignCenter { - if strippedWidth == maxWidth { - // Use the exact space. - return printWithStyle(screen, text, x, y, maxWidth, AlignLeft, style) - } else if strippedWidth < maxWidth { - // We have more space than we need. - half := (maxWidth - strippedWidth) / 2 - return printWithStyle(screen, text, x+half, y, maxWidth-half, AlignLeft, style) - } else { - // Chop off runes until we have a perfect fit. - var choppedLeft, choppedRight, leftIndex, rightIndex int - rightIndex = len(strippedText) - for rightIndex-1 > leftIndex && strippedWidth-choppedLeft-choppedRight > maxWidth { - if choppedLeft < choppedRight { - // Iterate on the left by one character. - iterateString(strippedText[leftIndex:], func(main rune, comb []rune, textPos, textWidth, screenPos, screenWidth int) bool { - choppedLeft += screenWidth - leftIndex += textWidth - return true - }) - } else { - // Iterate on the right by one character. - iterateStringReverse(strippedText[leftIndex:rightIndex], func(main rune, comb []rune, textPos, textWidth, screenPos, screenWidth int) bool { - choppedRight += screenWidth - rightIndex -= textWidth - return true - }) - } - } - - // Add tag offsets and determine start style. - var ( - colorPos, escapePos, tagOffset int - foregroundColor, backgroundColor, attributes string - ) - _, originalBackground, _ := style.Decompose() - for index := range strippedText { - // We only need the offset of the left index. - if index > leftIndex { - // We're done. - if escapePos > 0 && leftIndex+tagOffset-1 >= escapeIndices[escapePos-1][0] && leftIndex+tagOffset-1 < escapeIndices[escapePos-1][1] { - // Unescape open escape sequences. - escapeCharPos := escapeIndices[escapePos-1][1] - 2 - text = text[:escapeCharPos] + text[escapeCharPos+1:] - } - break - } - - // Update color/escape tag offset. - if colorPos < len(colorIndices) && index+tagOffset >= colorIndices[colorPos][0] && index+tagOffset < colorIndices[colorPos][1] { - if index <= leftIndex { - foregroundColor, backgroundColor, attributes = styleFromTag(foregroundColor, backgroundColor, attributes, colors[colorPos]) - style = overlayStyle(originalBackground, style, foregroundColor, backgroundColor, attributes) - } - tagOffset += colorIndices[colorPos][1] - colorIndices[colorPos][0] - colorPos++ - } - if escapePos < len(escapeIndices) && index+tagOffset >= escapeIndices[escapePos][0] && index+tagOffset < escapeIndices[escapePos][1] { - tagOffset++ - escapePos++ - } - } - return printWithStyle(screen, text[leftIndex+tagOffset:], x, y, maxWidth, AlignLeft, style) - } - } - - // Draw text. - var ( - drawn, drawnWidth, colorPos, escapePos, tagOffset int - foregroundColor, backgroundColor, attributes string - ) - iterateString(strippedText, func(main rune, comb []rune, textPos, length, screenPos, screenWidth int) bool { - // Only continue if there is still space. - if drawnWidth+screenWidth > maxWidth || x+drawnWidth >= totalWidth { - return true - } - - // Handle color tags. - for colorPos < len(colorIndices) && textPos+tagOffset >= colorIndices[colorPos][0] && textPos+tagOffset < colorIndices[colorPos][1] { - foregroundColor, backgroundColor, attributes = styleFromTag(foregroundColor, backgroundColor, attributes, colors[colorPos]) - tagOffset += colorIndices[colorPos][1] - colorIndices[colorPos][0] - colorPos++ - } - - // Handle scape tags. - if escapePos < len(escapeIndices) && textPos+tagOffset >= escapeIndices[escapePos][0] && textPos+tagOffset < escapeIndices[escapePos][1] { - if textPos+tagOffset == escapeIndices[escapePos][1]-2 { - tagOffset++ - escapePos++ - } - } - - // Print the rune sequence. - finalX := x + drawnWidth - _, _, finalStyle, _ := screen.GetContent(finalX, y) - _, background, _ := finalStyle.Decompose() - finalStyle = overlayStyle(background, style, foregroundColor, backgroundColor, attributes) - for offset := screenWidth - 1; offset >= 0; offset-- { - // To avoid undesired effects, we populate all cells. - if offset == 0 { - screen.SetContent(finalX+offset, y, main, comb, finalStyle) - } else { - screen.SetContent(finalX+offset, y, ' ', nil, finalStyle) - } - } - - // Advance. - drawn += length - drawnWidth += screenWidth - - return false - }) - - return drawn + tagOffset + len(escapeIndices), drawnWidth -} - -// PrintSimple prints white text to the screen at the given position. -func PrintSimple(screen tcell.Screen, text string, x, y int) { - Print(screen, text, x, y, math.MaxInt32, AlignLeft, Styles.PrimaryTextColor) -} - -// TaggedStringWidth returns the width of the given string needed to print it on -// screen. The text may contain color tags which are not counted. -func TaggedStringWidth(text string) int { - _, _, _, _, _, _, width := decomposeString(text, true, false) - return width -} - -// stringWidth returns the number of horizontal cells needed to print the given -// text. It splits the text into its grapheme clusters, calculates each -// cluster's width, and adds them up to a total. -func stringWidth(text string) (width int) { - g := uniseg.NewGraphemes(text) - for g.Next() { - var chWidth int - for _, r := range g.Runes() { - chWidth = runewidth.RuneWidth(r) - if chWidth > 0 { - break // Our best guess at this point is to use the width of the first non-zero-width rune. - } - } - width += chWidth - } - return -} - -// WordWrap splits a text such that each resulting line does not exceed the -// given screen width. Possible split points are after any punctuation or -// whitespace. Whitespace after split points will be dropped. -// -// This function considers color tags to have no width. -// -// Text is always split at newline characters ('\n'). -func WordWrap(text string, width int) (lines []string) { - colorTagIndices, _, _, _, escapeIndices, strippedText, _ := decomposeString(text, true, false) - - // Find candidate breakpoints. - breakpoints := boundaryPattern.FindAllStringSubmatchIndex(strippedText, -1) - // Results in one entry for each candidate. Each entry is an array a of - // indices into strippedText where a[6] < 0 for newline/punctuation matches - // and a[4] < 0 for whitespace matches. - - // Process stripped text one character at a time. - var ( - colorPos, escapePos, breakpointPos, tagOffset int - lastBreakpoint, lastContinuation, currentLineStart int - lineWidth, overflow int - forceBreak bool - ) - unescape := func(substr string, startIndex int) string { - // A helper function to unescape escaped tags. - for index := escapePos; index >= 0; index-- { - if index < len(escapeIndices) && startIndex > escapeIndices[index][0] && startIndex < escapeIndices[index][1]-1 { - pos := escapeIndices[index][1] - 2 - startIndex - return substr[:pos] + substr[pos+1:] - } - } - return substr - } - iterateString(strippedText, func(main rune, comb []rune, textPos, textWidth, screenPos, screenWidth int) bool { - // Handle tags. - for { - if colorPos < len(colorTagIndices) && textPos+tagOffset >= colorTagIndices[colorPos][0] && textPos+tagOffset < colorTagIndices[colorPos][1] { - // Colour tags. - tagOffset += colorTagIndices[colorPos][1] - colorTagIndices[colorPos][0] - colorPos++ - } else if escapePos < len(escapeIndices) && textPos+tagOffset == escapeIndices[escapePos][1]-2 { - // Escape tags. - tagOffset++ - escapePos++ - } else { - break - } - } - - // Is this a breakpoint? - if breakpointPos < len(breakpoints) && textPos+tagOffset == breakpoints[breakpointPos][0] { - // Yes, it is. Set up breakpoint infos depending on its type. - lastBreakpoint = breakpoints[breakpointPos][0] + tagOffset - lastContinuation = breakpoints[breakpointPos][1] + tagOffset - overflow = 0 - forceBreak = main == '\n' - if breakpoints[breakpointPos][6] < 0 && !forceBreak { - lastBreakpoint++ // Don't skip punctuation. - } - breakpointPos++ - } - - // Check if a break is warranted. - if forceBreak || lineWidth > 0 && lineWidth+screenWidth > width { - breakpoint := lastBreakpoint - continuation := lastContinuation - if forceBreak { - breakpoint = textPos + tagOffset - continuation = textPos + tagOffset + 1 - lastBreakpoint = 0 - overflow = 0 - } else if lastBreakpoint <= currentLineStart { - breakpoint = textPos + tagOffset - continuation = textPos + tagOffset - overflow = 0 - } - lines = append(lines, unescape(text[currentLineStart:breakpoint], currentLineStart)) - currentLineStart, lineWidth, forceBreak = continuation, overflow, false - } - - // Remember the characters since the last breakpoint. - if lastBreakpoint > 0 && lastContinuation <= textPos+tagOffset { - overflow += screenWidth - } - - // Advance. - lineWidth += screenWidth - - // But if we're still inside a breakpoint, skip next character (whitespace). - if textPos+tagOffset < currentLineStart { - lineWidth -= screenWidth - } - - return false - }) - - // Flush the rest. - if currentLineStart < len(text) { - lines = append(lines, unescape(text[currentLineStart:], currentLineStart)) - } - - return -} - -// Escape escapes the given text such that color and/or region tags are not -// recognized and substituted by the print functions of this package. For -// example, to include a tag-like string in a box title or in a TextView: -// -// box.SetTitle(tview.Escape("[squarebrackets]")) -// fmt.Fprint(textView, tview.Escape(`["quoted"]`)) -func Escape(text string) string { - return nonEscapePattern.ReplaceAllString(text, "$1[]") -} - -// iterateString iterates through the given string one printed character at a -// time. For each such character, the callback function is called with the -// Unicode code points of the character (the first rune and any combining runes -// which may be nil if there aren't any), the starting position (in bytes) -// within the original string, its length in bytes, the screen position of the -// character, and the screen width of it. The iteration stops if the callback -// returns true. This function returns true if the iteration was stopped before -// the last character. -func iterateString(text string, callback func(main rune, comb []rune, textPos, textWidth, screenPos, screenWidth int) bool) bool { - var screenPos int - - gr := uniseg.NewGraphemes(text) - for gr.Next() { - r := gr.Runes() - from, to := gr.Positions() - width := stringWidth(gr.Str()) - var comb []rune - if len(r) > 1 { - comb = r[1:] - } - - if callback(r[0], comb, from, to-from, screenPos, width) { - return true - } - - screenPos += width - } - - return false -} - -// iterateStringReverse iterates through the given string in reverse, starting -// from the end of the string, one printed character at a time. For each such -// character, the callback function is called with the Unicode code points of -// the character (the first rune and any combining runes which may be nil if -// there aren't any), the starting position (in bytes) within the original -// string, its length in bytes, the screen position of the character, and the -// screen width of it. The iteration stops if the callback returns true. This -// function returns true if the iteration was stopped before the last character. -func iterateStringReverse(text string, callback func(main rune, comb []rune, textPos, textWidth, screenPos, screenWidth int) bool) bool { - type cluster struct { - main rune - comb []rune - textPos, textWidth, screenPos, screenWidth int - } - - // Create the grapheme clusters. - var clusters []cluster - iterateString(text, func(main rune, comb []rune, textPos int, textWidth int, screenPos int, screenWidth int) bool { - clusters = append(clusters, cluster{ - main: main, - comb: comb, - textPos: textPos, - textWidth: textWidth, - screenPos: screenPos, - screenWidth: screenWidth, - }) - return false - }) - - // Iterate in reverse. - for index := len(clusters) - 1; index >= 0; index-- { - if callback( - clusters[index].main, - clusters[index].comb, - clusters[index].textPos, - clusters[index].textWidth, - clusters[index].screenPos, - clusters[index].screenWidth, - ) { - return true - } - } - - return false -} diff --git a/vendor/github.com/rivo/uniseg/LICENSE.txt b/vendor/github.com/rivo/uniseg/LICENSE.txt deleted file mode 100644 index 5040f1ef..00000000 --- a/vendor/github.com/rivo/uniseg/LICENSE.txt +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2019 Oliver Kuederle - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/rivo/uniseg/README.md b/vendor/github.com/rivo/uniseg/README.md deleted file mode 100644 index f8da293e..00000000 --- a/vendor/github.com/rivo/uniseg/README.md +++ /dev/null @@ -1,62 +0,0 @@ -# Unicode Text Segmentation for Go - -[![Godoc Reference](https://img.shields.io/badge/godoc-reference-blue.svg)](https://godoc.org/github.com/rivo/uniseg) -[![Go Report](https://img.shields.io/badge/go%20report-A%2B-brightgreen.svg)](https://goreportcard.com/report/github.com/rivo/uniseg) - -This Go package implements Unicode Text Segmentation according to [Unicode Standard Annex #29](http://unicode.org/reports/tr29/) (Unicode version 12.0.0). - -At this point, only the determination of grapheme cluster boundaries is implemented. - -## Background - -In Go, [strings are read-only slices of bytes](https://blog.golang.org/strings). They can be turned into Unicode code points using the `for` loop or by casting: `[]rune(str)`. However, multiple code points may be combined into one user-perceived character or what the Unicode specification calls "grapheme cluster". Here are some examples: - -|String|Bytes (UTF-8)|Code points (runes)|Grapheme clusters| -|-|-|-|-| -|Käse|6 bytes: `4b 61 cc 88 73 65`|5 code points: `4b 61 308 73 65`|4 clusters: `[4b],[61 308],[73],[65]`| -|🏳️‍🌈|14 bytes: `f0 9f 8f b3 ef b8 8f e2 80 8d f0 9f 8c 88`|4 code points: `1f3f3 fe0f 200d 1f308`|1 cluster: `[1f3f3 fe0f 200d 1f308]`| -|🇩🇪|8 bytes: `f0 9f 87 a9 f0 9f 87 aa`|2 code points: `1f1e9 1f1ea`|1 cluster: `[1f1e9 1f1ea]`| - -This package provides a tool to iterate over these grapheme clusters. This may be used to determine the number of user-perceived characters, to split strings in their intended places, or to extract individual characters which form a unit. - -## Installation - -```bash -go get github.com/rivo/uniseg -``` - -## Basic Example - -```go -package uniseg - -import ( - "fmt" - - "github.com/rivo/uniseg" -) - -func main() { - gr := uniseg.NewGraphemes("👍🏼!") - for gr.Next() { - fmt.Printf("%x ", gr.Runes()) - } - // Output: [1f44d 1f3fc] [21] -} -``` - -## Documentation - -Refer to https://godoc.org/github.com/rivo/uniseg for the package's documentation. - -## Dependencies - -This package does not depend on any packages outside the standard library. - -## Your Feedback - -Add your issue here on GitHub. Feel free to get in touch if you have any questions. - -## Version - -Version tags will be introduced once Golang modules are official. Consider this version 0.1. diff --git a/vendor/github.com/rivo/uniseg/doc.go b/vendor/github.com/rivo/uniseg/doc.go deleted file mode 100644 index 60c737d7..00000000 --- a/vendor/github.com/rivo/uniseg/doc.go +++ /dev/null @@ -1,8 +0,0 @@ -/* -Package uniseg implements Unicode Text Segmentation according to Unicode -Standard Annex #29 (http://unicode.org/reports/tr29/). - -At this point, only the determination of grapheme cluster boundaries is -implemented. -*/ -package uniseg diff --git a/vendor/github.com/rivo/uniseg/grapheme.go b/vendor/github.com/rivo/uniseg/grapheme.go deleted file mode 100644 index fbb846b4..00000000 --- a/vendor/github.com/rivo/uniseg/grapheme.go +++ /dev/null @@ -1,258 +0,0 @@ -package uniseg - -// The states of the grapheme cluster parser. -const ( - grAny = iota - grCR - grControlLF - grL - grLVV - grLVTT - grPrepend - grExtendedPictographic - grExtendedPictographicZWJ - grRIOdd - grRIEven -) - -// The grapheme cluster parser's breaking instructions. -const ( - grNoBoundary = iota - grBoundary -) - -// The grapheme cluster parser's state transitions. Maps (state, property) to -// (new state, breaking instruction, rule number). The breaking instruction -// always refers to the boundary between the last and next code point. -// -// This map is queried as follows: -// -// 1. Find specific state + specific property. Stop if found. -// 2. Find specific state + any property. -// 3. Find any state + specific property. -// 4. If only (2) or (3) (but not both) was found, stop. -// 5. If both (2) and (3) were found, use state and breaking instruction from -// the transition with the lower rule number, prefer (3) if rule numbers -// are equal. Stop. -// 6. Assume grAny and grBoundary. -var grTransitions = map[[2]int][3]int{ - // GB5 - {grAny, prCR}: {grCR, grBoundary, 50}, - {grAny, prLF}: {grControlLF, grBoundary, 50}, - {grAny, prControl}: {grControlLF, grBoundary, 50}, - - // GB4 - {grCR, prAny}: {grAny, grBoundary, 40}, - {grControlLF, prAny}: {grAny, grBoundary, 40}, - - // GB3. - {grCR, prLF}: {grAny, grNoBoundary, 30}, - - // GB6. - {grAny, prL}: {grL, grBoundary, 9990}, - {grL, prL}: {grL, grNoBoundary, 60}, - {grL, prV}: {grLVV, grNoBoundary, 60}, - {grL, prLV}: {grLVV, grNoBoundary, 60}, - {grL, prLVT}: {grLVTT, grNoBoundary, 60}, - - // GB7. - {grAny, prLV}: {grLVV, grBoundary, 9990}, - {grAny, prV}: {grLVV, grBoundary, 9990}, - {grLVV, prV}: {grLVV, grNoBoundary, 70}, - {grLVV, prT}: {grLVTT, grNoBoundary, 70}, - - // GB8. - {grAny, prLVT}: {grLVTT, grBoundary, 9990}, - {grAny, prT}: {grLVTT, grBoundary, 9990}, - {grLVTT, prT}: {grLVTT, grNoBoundary, 80}, - - // GB9. - {grAny, prExtend}: {grAny, grNoBoundary, 90}, - {grAny, prZWJ}: {grAny, grNoBoundary, 90}, - - // GB9a. - {grAny, prSpacingMark}: {grAny, grNoBoundary, 91}, - - // GB9b. - {grAny, prPreprend}: {grPrepend, grBoundary, 9990}, - {grPrepend, prAny}: {grAny, grNoBoundary, 92}, - - // GB11. - {grAny, prExtendedPictographic}: {grExtendedPictographic, grBoundary, 9990}, - {grExtendedPictographic, prExtend}: {grExtendedPictographic, grNoBoundary, 110}, - {grExtendedPictographic, prZWJ}: {grExtendedPictographicZWJ, grNoBoundary, 110}, - {grExtendedPictographicZWJ, prExtendedPictographic}: {grExtendedPictographic, grNoBoundary, 110}, - - // GB12 / GB13. - {grAny, prRegionalIndicator}: {grRIOdd, grBoundary, 9990}, - {grRIOdd, prRegionalIndicator}: {grRIEven, grNoBoundary, 120}, - {grRIEven, prRegionalIndicator}: {grRIOdd, grBoundary, 120}, -} - -// Graphemes implements an iterator over Unicode extended grapheme clusters, -// specified in the Unicode Standard Annex #29. Grapheme clusters correspond to -// "user-perceived characters". These characters often consist of multiple -// code points (e.g. the "woman kissing woman" emoji consists of 8 code points: -// woman + ZWJ + heavy black heart (2 code points) + ZWJ + kiss mark + ZWJ + -// woman) and the rules described in Annex #29 must be applied to group those -// code points into clusters perceived by the user as one character. -type Graphemes struct { - // The code points over which this class iterates. - codePoints []rune - - // The (byte-based) indices of the code points into the original string plus - // len(original string). Thus, len(indices) = len(codePoints) + 1. - indices []int - - // The current grapheme cluster to be returned. These are indices into - // codePoints/indices. If start == end, we either haven't started iterating - // yet (0) or the iteration has already completed (1). - start, end int - - // The index of the next code point to be parsed. - pos int - - // The current state of the code point parser. - state int -} - -// NewGraphemes returns a new grapheme cluster iterator. -func NewGraphemes(s string) *Graphemes { - g := &Graphemes{} - for index, codePoint := range s { - g.codePoints = append(g.codePoints, codePoint) - g.indices = append(g.indices, index) - } - g.indices = append(g.indices, len(s)) - g.Next() // Parse ahead. - return g -} - -// Next advances the iterator by one grapheme cluster and returns false if no -// clusters are left. This function must be called before the first cluster is -// accessed. -func (g *Graphemes) Next() bool { - g.start = g.end - - // The state transition gives us a boundary instruction BEFORE the next code - // point so we always need to stay ahead by one code point. - - // Parse the next code point. - for g.pos <= len(g.codePoints) { - // GB2. - if g.pos == len(g.codePoints) { - g.end = g.pos - g.pos++ - break - } - - // Determine the property of the next character. - nextProperty := property(g.codePoints[g.pos]) - g.pos++ - - // Find the applicable transition. - var boundary bool - transition, ok := grTransitions[[2]int{g.state, nextProperty}] - if ok { - // We have a specific transition. We'll use it. - g.state = transition[0] - boundary = transition[1] == grBoundary - } else { - // No specific transition found. Try the less specific ones. - transAnyProp, okAnyProp := grTransitions[[2]int{g.state, prAny}] - transAnyState, okAnyState := grTransitions[[2]int{grAny, nextProperty}] - if okAnyProp && okAnyState { - // Both apply. We'll use a mix (see comments for grTransitions). - g.state = transAnyState[0] - boundary = transAnyState[1] == grBoundary - if transAnyProp[2] < transAnyState[2] { - g.state = transAnyProp[0] - boundary = transAnyProp[1] == grBoundary - } - } else if okAnyProp { - // We only have a specific state. - g.state = transAnyProp[0] - boundary = transAnyProp[1] == grBoundary - // This branch will probably never be reached because okAnyState will - // always be true given the current transition map. But we keep it here - // for future modifications to the transition map where this may not be - // true anymore. - } else if okAnyState { - // We only have a specific property. - g.state = transAnyState[0] - boundary = transAnyState[1] == grBoundary - } else { - // No known transition. GB999: Any x Any. - g.state = grAny - boundary = true - } - } - - // If we found a cluster boundary, let's stop here. The current cluster will - // be the one that just ended. - if g.pos-1 == 0 /* GB1 */ || boundary { - g.end = g.pos - 1 - break - } - } - - return g.start != g.end -} - -// Runes returns a slice of runes (code points) which corresponds to the current -// grapheme cluster. If the iterator is already past the end or Next() has not -// yet been called, nil is returned. -func (g *Graphemes) Runes() []rune { - if g.start == g.end { - return nil - } - return g.codePoints[g.start:g.end] -} - -// Str returns a substring of the original string which corresponds to the -// current grapheme cluster. If the iterator is already past the end or Next() -// has not yet been called, an empty string is returned. -func (g *Graphemes) Str() string { - if g.start == g.end { - return "" - } - return string(g.codePoints[g.start:g.end]) -} - -// Bytes returns a byte slice which corresponds to the current grapheme cluster. -// If the iterator is already past the end or Next() has not yet been called, -// nil is returned. -func (g *Graphemes) Bytes() []byte { - if g.start == g.end { - return nil - } - return []byte(string(g.codePoints[g.start:g.end])) -} - -// Positions returns the interval of the current grapheme cluster as byte -// positions into the original string. The first returned value "from" indexes -// the first byte and the second returned value "to" indexes the first byte that -// is not included anymore, i.e. str[from:to] is the current grapheme cluster of -// the original string "str". If Next() has not yet been called, both values are -// 0. If the iterator is already past the end, both values are 1. -func (g *Graphemes) Positions() (int, int) { - return g.indices[g.start], g.indices[g.end] -} - -// Reset puts the iterator into its initial state such that the next call to -// Next() sets it to the first grapheme cluster again. -func (g *Graphemes) Reset() { - g.start, g.end, g.pos, g.state = 0, 0, 0, grAny - g.Next() // Parse ahead again. -} - -// GraphemeClusterCount returns the number of user-perceived characters -// (grapheme clusters) for the given string. To calculate this number, it -// iterates through the string using the Graphemes iterator. -func GraphemeClusterCount(s string) (n int) { - g := NewGraphemes(s) - for g.Next() { - n++ - } - return -} diff --git a/vendor/github.com/rivo/uniseg/properties.go b/vendor/github.com/rivo/uniseg/properties.go deleted file mode 100644 index a75ab588..00000000 --- a/vendor/github.com/rivo/uniseg/properties.go +++ /dev/null @@ -1,1658 +0,0 @@ -package uniseg - -// The unicode properties. Only the ones needed in the context of this package -// are included. -const ( - prAny = iota - prPreprend - prCR - prLF - prControl - prExtend - prRegionalIndicator - prSpacingMark - prL - prV - prT - prLV - prLVT - prZWJ - prExtendedPictographic -) - -// Maps code point ranges to their properties. In the context of this package, -// any code point that is not contained may map to "prAny". The code point -// ranges in this slice are numerically sorted. -// -// These ranges were taken from -// http://www.unicode.org/Public/UCD/latest/ucd/auxiliary/GraphemeBreakProperty.txt -// as well as -// https://unicode.org/Public/emoji/latest/emoji-data.txt -// ("Extended_Pictographic" only) on March 11, 2019. See -// https://www.unicode.org/license.html for the Unicode license agreement. -var codePoints = [][3]int{ - {0x0000, 0x0009, prControl}, // Cc [10] .. - {0x000A, 0x000A, prLF}, // Cc - {0x000B, 0x000C, prControl}, // Cc [2] .. - {0x000D, 0x000D, prCR}, // Cc - {0x000E, 0x001F, prControl}, // Cc [18] .. - {0x007F, 0x009F, prControl}, // Cc [33] .. - {0x00A9, 0x00A9, prExtendedPictographic}, // 1.1 [1] (©️) copyright - {0x00AD, 0x00AD, prControl}, // Cf SOFT HYPHEN - {0x00AE, 0x00AE, prExtendedPictographic}, // 1.1 [1] (®️) registered - {0x0300, 0x036F, prExtend}, // Mn [112] COMBINING GRAVE ACCENT..COMBINING LATIN SMALL LETTER X - {0x0483, 0x0487, prExtend}, // Mn [5] COMBINING CYRILLIC TITLO..COMBINING CYRILLIC POKRYTIE - {0x0488, 0x0489, prExtend}, // Me [2] COMBINING CYRILLIC HUNDRED THOUSANDS SIGN..COMBINING CYRILLIC MILLIONS SIGN - {0x0591, 0x05BD, prExtend}, // Mn [45] HEBREW ACCENT ETNAHTA..HEBREW POINT METEG - {0x05BF, 0x05BF, prExtend}, // Mn HEBREW POINT RAFE - {0x05C1, 0x05C2, prExtend}, // Mn [2] HEBREW POINT SHIN DOT..HEBREW POINT SIN DOT - {0x05C4, 0x05C5, prExtend}, // Mn [2] HEBREW MARK UPPER DOT..HEBREW MARK LOWER DOT - {0x05C7, 0x05C7, prExtend}, // Mn HEBREW POINT QAMATS QATAN - {0x0600, 0x0605, prPreprend}, // Cf [6] ARABIC NUMBER SIGN..ARABIC NUMBER MARK ABOVE - {0x0610, 0x061A, prExtend}, // Mn [11] ARABIC SIGN SALLALLAHOU ALAYHE WASSALLAM..ARABIC SMALL KASRA - {0x061C, 0x061C, prControl}, // Cf ARABIC LETTER MARK - {0x064B, 0x065F, prExtend}, // Mn [21] ARABIC FATHATAN..ARABIC WAVY HAMZA BELOW - {0x0670, 0x0670, prExtend}, // Mn ARABIC LETTER SUPERSCRIPT ALEF - {0x06D6, 0x06DC, prExtend}, // Mn [7] ARABIC SMALL HIGH LIGATURE SAD WITH LAM WITH ALEF MAKSURA..ARABIC SMALL HIGH SEEN - {0x06DD, 0x06DD, prPreprend}, // Cf ARABIC END OF AYAH - {0x06DF, 0x06E4, prExtend}, // Mn [6] ARABIC SMALL HIGH ROUNDED ZERO..ARABIC SMALL HIGH MADDA - {0x06E7, 0x06E8, prExtend}, // Mn [2] ARABIC SMALL HIGH YEH..ARABIC SMALL HIGH NOON - {0x06EA, 0x06ED, prExtend}, // Mn [4] ARABIC EMPTY CENTRE LOW STOP..ARABIC SMALL LOW MEEM - {0x070F, 0x070F, prPreprend}, // Cf SYRIAC ABBREVIATION MARK - {0x0711, 0x0711, prExtend}, // Mn SYRIAC LETTER SUPERSCRIPT ALAPH - {0x0730, 0x074A, prExtend}, // Mn [27] SYRIAC PTHAHA ABOVE..SYRIAC BARREKH - {0x07A6, 0x07B0, prExtend}, // Mn [11] THAANA ABAFILI..THAANA SUKUN - {0x07EB, 0x07F3, prExtend}, // Mn [9] NKO COMBINING SHORT HIGH TONE..NKO COMBINING DOUBLE DOT ABOVE - {0x07FD, 0x07FD, prExtend}, // Mn NKO DANTAYALAN - {0x0816, 0x0819, prExtend}, // Mn [4] SAMARITAN MARK IN..SAMARITAN MARK DAGESH - {0x081B, 0x0823, prExtend}, // Mn [9] SAMARITAN MARK EPENTHETIC YUT..SAMARITAN VOWEL SIGN A - {0x0825, 0x0827, prExtend}, // Mn [3] SAMARITAN VOWEL SIGN SHORT A..SAMARITAN VOWEL SIGN U - {0x0829, 0x082D, prExtend}, // Mn [5] SAMARITAN VOWEL SIGN LONG I..SAMARITAN MARK NEQUDAA - {0x0859, 0x085B, prExtend}, // Mn [3] MANDAIC AFFRICATION MARK..MANDAIC GEMINATION MARK - {0x08D3, 0x08E1, prExtend}, // Mn [15] ARABIC SMALL LOW WAW..ARABIC SMALL HIGH SIGN SAFHA - {0x08E2, 0x08E2, prPreprend}, // Cf ARABIC DISPUTED END OF AYAH - {0x08E3, 0x0902, prExtend}, // Mn [32] ARABIC TURNED DAMMA BELOW..DEVANAGARI SIGN ANUSVARA - {0x0903, 0x0903, prSpacingMark}, // Mc DEVANAGARI SIGN VISARGA - {0x093A, 0x093A, prExtend}, // Mn DEVANAGARI VOWEL SIGN OE - {0x093B, 0x093B, prSpacingMark}, // Mc DEVANAGARI VOWEL SIGN OOE - {0x093C, 0x093C, prExtend}, // Mn DEVANAGARI SIGN NUKTA - {0x093E, 0x0940, prSpacingMark}, // Mc [3] DEVANAGARI VOWEL SIGN AA..DEVANAGARI VOWEL SIGN II - {0x0941, 0x0948, prExtend}, // Mn [8] DEVANAGARI VOWEL SIGN U..DEVANAGARI VOWEL SIGN AI - {0x0949, 0x094C, prSpacingMark}, // Mc [4] DEVANAGARI VOWEL SIGN CANDRA O..DEVANAGARI VOWEL SIGN AU - {0x094D, 0x094D, prExtend}, // Mn DEVANAGARI SIGN VIRAMA - {0x094E, 0x094F, prSpacingMark}, // Mc [2] DEVANAGARI VOWEL SIGN PRISHTHAMATRA E..DEVANAGARI VOWEL SIGN AW - {0x0951, 0x0957, prExtend}, // Mn [7] DEVANAGARI STRESS SIGN UDATTA..DEVANAGARI VOWEL SIGN UUE - {0x0962, 0x0963, prExtend}, // Mn [2] DEVANAGARI VOWEL SIGN VOCALIC L..DEVANAGARI VOWEL SIGN VOCALIC LL - {0x0981, 0x0981, prExtend}, // Mn BENGALI SIGN CANDRABINDU - {0x0982, 0x0983, prSpacingMark}, // Mc [2] BENGALI SIGN ANUSVARA..BENGALI SIGN VISARGA - {0x09BC, 0x09BC, prExtend}, // Mn BENGALI SIGN NUKTA - {0x09BE, 0x09BE, prExtend}, // Mc BENGALI VOWEL SIGN AA - {0x09BF, 0x09C0, prSpacingMark}, // Mc [2] BENGALI VOWEL SIGN I..BENGALI VOWEL SIGN II - {0x09C1, 0x09C4, prExtend}, // Mn [4] BENGALI VOWEL SIGN U..BENGALI VOWEL SIGN VOCALIC RR - {0x09C7, 0x09C8, prSpacingMark}, // Mc [2] BENGALI VOWEL SIGN E..BENGALI VOWEL SIGN AI - {0x09CB, 0x09CC, prSpacingMark}, // Mc [2] BENGALI VOWEL SIGN O..BENGALI VOWEL SIGN AU - {0x09CD, 0x09CD, prExtend}, // Mn BENGALI SIGN VIRAMA - {0x09D7, 0x09D7, prExtend}, // Mc BENGALI AU LENGTH MARK - {0x09E2, 0x09E3, prExtend}, // Mn [2] BENGALI VOWEL SIGN VOCALIC L..BENGALI VOWEL SIGN VOCALIC LL - {0x09FE, 0x09FE, prExtend}, // Mn BENGALI SANDHI MARK - {0x0A01, 0x0A02, prExtend}, // Mn [2] GURMUKHI SIGN ADAK BINDI..GURMUKHI SIGN BINDI - {0x0A03, 0x0A03, prSpacingMark}, // Mc GURMUKHI SIGN VISARGA - {0x0A3C, 0x0A3C, prExtend}, // Mn GURMUKHI SIGN NUKTA - {0x0A3E, 0x0A40, prSpacingMark}, // Mc [3] GURMUKHI VOWEL SIGN AA..GURMUKHI VOWEL SIGN II - {0x0A41, 0x0A42, prExtend}, // Mn [2] GURMUKHI VOWEL SIGN U..GURMUKHI VOWEL SIGN UU - {0x0A47, 0x0A48, prExtend}, // Mn [2] GURMUKHI VOWEL SIGN EE..GURMUKHI VOWEL SIGN AI - {0x0A4B, 0x0A4D, prExtend}, // Mn [3] GURMUKHI VOWEL SIGN OO..GURMUKHI SIGN VIRAMA - {0x0A51, 0x0A51, prExtend}, // Mn GURMUKHI SIGN UDAAT - {0x0A70, 0x0A71, prExtend}, // Mn [2] GURMUKHI TIPPI..GURMUKHI ADDAK - {0x0A75, 0x0A75, prExtend}, // Mn GURMUKHI SIGN YAKASH - {0x0A81, 0x0A82, prExtend}, // Mn [2] GUJARATI SIGN CANDRABINDU..GUJARATI SIGN ANUSVARA - {0x0A83, 0x0A83, prSpacingMark}, // Mc GUJARATI SIGN VISARGA - {0x0ABC, 0x0ABC, prExtend}, // Mn GUJARATI SIGN NUKTA - {0x0ABE, 0x0AC0, prSpacingMark}, // Mc [3] GUJARATI VOWEL SIGN AA..GUJARATI VOWEL SIGN II - {0x0AC1, 0x0AC5, prExtend}, // Mn [5] GUJARATI VOWEL SIGN U..GUJARATI VOWEL SIGN CANDRA E - {0x0AC7, 0x0AC8, prExtend}, // Mn [2] GUJARATI VOWEL SIGN E..GUJARATI VOWEL SIGN AI - {0x0AC9, 0x0AC9, prSpacingMark}, // Mc GUJARATI VOWEL SIGN CANDRA O - {0x0ACB, 0x0ACC, prSpacingMark}, // Mc [2] GUJARATI VOWEL SIGN O..GUJARATI VOWEL SIGN AU - {0x0ACD, 0x0ACD, prExtend}, // Mn GUJARATI SIGN VIRAMA - {0x0AE2, 0x0AE3, prExtend}, // Mn [2] GUJARATI VOWEL SIGN VOCALIC L..GUJARATI VOWEL SIGN VOCALIC LL - {0x0AFA, 0x0AFF, prExtend}, // Mn [6] GUJARATI SIGN SUKUN..GUJARATI SIGN TWO-CIRCLE NUKTA ABOVE - {0x0B01, 0x0B01, prExtend}, // Mn ORIYA SIGN CANDRABINDU - {0x0B02, 0x0B03, prSpacingMark}, // Mc [2] ORIYA SIGN ANUSVARA..ORIYA SIGN VISARGA - {0x0B3C, 0x0B3C, prExtend}, // Mn ORIYA SIGN NUKTA - {0x0B3E, 0x0B3E, prExtend}, // Mc ORIYA VOWEL SIGN AA - {0x0B3F, 0x0B3F, prExtend}, // Mn ORIYA VOWEL SIGN I - {0x0B40, 0x0B40, prSpacingMark}, // Mc ORIYA VOWEL SIGN II - {0x0B41, 0x0B44, prExtend}, // Mn [4] ORIYA VOWEL SIGN U..ORIYA VOWEL SIGN VOCALIC RR - {0x0B47, 0x0B48, prSpacingMark}, // Mc [2] ORIYA VOWEL SIGN E..ORIYA VOWEL SIGN AI - {0x0B4B, 0x0B4C, prSpacingMark}, // Mc [2] ORIYA VOWEL SIGN O..ORIYA VOWEL SIGN AU - {0x0B4D, 0x0B4D, prExtend}, // Mn ORIYA SIGN VIRAMA - {0x0B56, 0x0B56, prExtend}, // Mn ORIYA AI LENGTH MARK - {0x0B57, 0x0B57, prExtend}, // Mc ORIYA AU LENGTH MARK - {0x0B62, 0x0B63, prExtend}, // Mn [2] ORIYA VOWEL SIGN VOCALIC L..ORIYA VOWEL SIGN VOCALIC LL - {0x0B82, 0x0B82, prExtend}, // Mn TAMIL SIGN ANUSVARA - {0x0BBE, 0x0BBE, prExtend}, // Mc TAMIL VOWEL SIGN AA - {0x0BBF, 0x0BBF, prSpacingMark}, // Mc TAMIL VOWEL SIGN I - {0x0BC0, 0x0BC0, prExtend}, // Mn TAMIL VOWEL SIGN II - {0x0BC1, 0x0BC2, prSpacingMark}, // Mc [2] TAMIL VOWEL SIGN U..TAMIL VOWEL SIGN UU - {0x0BC6, 0x0BC8, prSpacingMark}, // Mc [3] TAMIL VOWEL SIGN E..TAMIL VOWEL SIGN AI - {0x0BCA, 0x0BCC, prSpacingMark}, // Mc [3] TAMIL VOWEL SIGN O..TAMIL VOWEL SIGN AU - {0x0BCD, 0x0BCD, prExtend}, // Mn TAMIL SIGN VIRAMA - {0x0BD7, 0x0BD7, prExtend}, // Mc TAMIL AU LENGTH MARK - {0x0C00, 0x0C00, prExtend}, // Mn TELUGU SIGN COMBINING CANDRABINDU ABOVE - {0x0C01, 0x0C03, prSpacingMark}, // Mc [3] TELUGU SIGN CANDRABINDU..TELUGU SIGN VISARGA - {0x0C04, 0x0C04, prExtend}, // Mn TELUGU SIGN COMBINING ANUSVARA ABOVE - {0x0C3E, 0x0C40, prExtend}, // Mn [3] TELUGU VOWEL SIGN AA..TELUGU VOWEL SIGN II - {0x0C41, 0x0C44, prSpacingMark}, // Mc [4] TELUGU VOWEL SIGN U..TELUGU VOWEL SIGN VOCALIC RR - {0x0C46, 0x0C48, prExtend}, // Mn [3] TELUGU VOWEL SIGN E..TELUGU VOWEL SIGN AI - {0x0C4A, 0x0C4D, prExtend}, // Mn [4] TELUGU VOWEL SIGN O..TELUGU SIGN VIRAMA - {0x0C55, 0x0C56, prExtend}, // Mn [2] TELUGU LENGTH MARK..TELUGU AI LENGTH MARK - {0x0C62, 0x0C63, prExtend}, // Mn [2] TELUGU VOWEL SIGN VOCALIC L..TELUGU VOWEL SIGN VOCALIC LL - {0x0C81, 0x0C81, prExtend}, // Mn KANNADA SIGN CANDRABINDU - {0x0C82, 0x0C83, prSpacingMark}, // Mc [2] KANNADA SIGN ANUSVARA..KANNADA SIGN VISARGA - {0x0CBC, 0x0CBC, prExtend}, // Mn KANNADA SIGN NUKTA - {0x0CBE, 0x0CBE, prSpacingMark}, // Mc KANNADA VOWEL SIGN AA - {0x0CBF, 0x0CBF, prExtend}, // Mn KANNADA VOWEL SIGN I - {0x0CC0, 0x0CC1, prSpacingMark}, // Mc [2] KANNADA VOWEL SIGN II..KANNADA VOWEL SIGN U - {0x0CC2, 0x0CC2, prExtend}, // Mc KANNADA VOWEL SIGN UU - {0x0CC3, 0x0CC4, prSpacingMark}, // Mc [2] KANNADA VOWEL SIGN VOCALIC R..KANNADA VOWEL SIGN VOCALIC RR - {0x0CC6, 0x0CC6, prExtend}, // Mn KANNADA VOWEL SIGN E - {0x0CC7, 0x0CC8, prSpacingMark}, // Mc [2] KANNADA VOWEL SIGN EE..KANNADA VOWEL SIGN AI - {0x0CCA, 0x0CCB, prSpacingMark}, // Mc [2] KANNADA VOWEL SIGN O..KANNADA VOWEL SIGN OO - {0x0CCC, 0x0CCD, prExtend}, // Mn [2] KANNADA VOWEL SIGN AU..KANNADA SIGN VIRAMA - {0x0CD5, 0x0CD6, prExtend}, // Mc [2] KANNADA LENGTH MARK..KANNADA AI LENGTH MARK - {0x0CE2, 0x0CE3, prExtend}, // Mn [2] KANNADA VOWEL SIGN VOCALIC L..KANNADA VOWEL SIGN VOCALIC LL - {0x0D00, 0x0D01, prExtend}, // Mn [2] MALAYALAM SIGN COMBINING ANUSVARA ABOVE..MALAYALAM SIGN CANDRABINDU - {0x0D02, 0x0D03, prSpacingMark}, // Mc [2] MALAYALAM SIGN ANUSVARA..MALAYALAM SIGN VISARGA - {0x0D3B, 0x0D3C, prExtend}, // Mn [2] MALAYALAM SIGN VERTICAL BAR VIRAMA..MALAYALAM SIGN CIRCULAR VIRAMA - {0x0D3E, 0x0D3E, prExtend}, // Mc MALAYALAM VOWEL SIGN AA - {0x0D3F, 0x0D40, prSpacingMark}, // Mc [2] MALAYALAM VOWEL SIGN I..MALAYALAM VOWEL SIGN II - {0x0D41, 0x0D44, prExtend}, // Mn [4] MALAYALAM VOWEL SIGN U..MALAYALAM VOWEL SIGN VOCALIC RR - {0x0D46, 0x0D48, prSpacingMark}, // Mc [3] MALAYALAM VOWEL SIGN E..MALAYALAM VOWEL SIGN AI - {0x0D4A, 0x0D4C, prSpacingMark}, // Mc [3] MALAYALAM VOWEL SIGN O..MALAYALAM VOWEL SIGN AU - {0x0D4D, 0x0D4D, prExtend}, // Mn MALAYALAM SIGN VIRAMA - {0x0D4E, 0x0D4E, prPreprend}, // Lo MALAYALAM LETTER DOT REPH - {0x0D57, 0x0D57, prExtend}, // Mc MALAYALAM AU LENGTH MARK - {0x0D62, 0x0D63, prExtend}, // Mn [2] MALAYALAM VOWEL SIGN VOCALIC L..MALAYALAM VOWEL SIGN VOCALIC LL - {0x0D82, 0x0D83, prSpacingMark}, // Mc [2] SINHALA SIGN ANUSVARAYA..SINHALA SIGN VISARGAYA - {0x0DCA, 0x0DCA, prExtend}, // Mn SINHALA SIGN AL-LAKUNA - {0x0DCF, 0x0DCF, prExtend}, // Mc SINHALA VOWEL SIGN AELA-PILLA - {0x0DD0, 0x0DD1, prSpacingMark}, // Mc [2] SINHALA VOWEL SIGN KETTI AEDA-PILLA..SINHALA VOWEL SIGN DIGA AEDA-PILLA - {0x0DD2, 0x0DD4, prExtend}, // Mn [3] SINHALA VOWEL SIGN KETTI IS-PILLA..SINHALA VOWEL SIGN KETTI PAA-PILLA - {0x0DD6, 0x0DD6, prExtend}, // Mn SINHALA VOWEL SIGN DIGA PAA-PILLA - {0x0DD8, 0x0DDE, prSpacingMark}, // Mc [7] SINHALA VOWEL SIGN GAETTA-PILLA..SINHALA VOWEL SIGN KOMBUVA HAA GAYANUKITTA - {0x0DDF, 0x0DDF, prExtend}, // Mc SINHALA VOWEL SIGN GAYANUKITTA - {0x0DF2, 0x0DF3, prSpacingMark}, // Mc [2] SINHALA VOWEL SIGN DIGA GAETTA-PILLA..SINHALA VOWEL SIGN DIGA GAYANUKITTA - {0x0E31, 0x0E31, prExtend}, // Mn THAI CHARACTER MAI HAN-AKAT - {0x0E33, 0x0E33, prSpacingMark}, // Lo THAI CHARACTER SARA AM - {0x0E34, 0x0E3A, prExtend}, // Mn [7] THAI CHARACTER SARA I..THAI CHARACTER PHINTHU - {0x0E47, 0x0E4E, prExtend}, // Mn [8] THAI CHARACTER MAITAIKHU..THAI CHARACTER YAMAKKAN - {0x0EB1, 0x0EB1, prExtend}, // Mn LAO VOWEL SIGN MAI KAN - {0x0EB3, 0x0EB3, prSpacingMark}, // Lo LAO VOWEL SIGN AM - {0x0EB4, 0x0EBC, prExtend}, // Mn [9] LAO VOWEL SIGN I..LAO SEMIVOWEL SIGN LO - {0x0EC8, 0x0ECD, prExtend}, // Mn [6] LAO TONE MAI EK..LAO NIGGAHITA - {0x0F18, 0x0F19, prExtend}, // Mn [2] TIBETAN ASTROLOGICAL SIGN -KHYUD PA..TIBETAN ASTROLOGICAL SIGN SDONG TSHUGS - {0x0F35, 0x0F35, prExtend}, // Mn TIBETAN MARK NGAS BZUNG NYI ZLA - {0x0F37, 0x0F37, prExtend}, // Mn TIBETAN MARK NGAS BZUNG SGOR RTAGS - {0x0F39, 0x0F39, prExtend}, // Mn TIBETAN MARK TSA -PHRU - {0x0F3E, 0x0F3F, prSpacingMark}, // Mc [2] TIBETAN SIGN YAR TSHES..TIBETAN SIGN MAR TSHES - {0x0F71, 0x0F7E, prExtend}, // Mn [14] TIBETAN VOWEL SIGN AA..TIBETAN SIGN RJES SU NGA RO - {0x0F7F, 0x0F7F, prSpacingMark}, // Mc TIBETAN SIGN RNAM BCAD - {0x0F80, 0x0F84, prExtend}, // Mn [5] TIBETAN VOWEL SIGN REVERSED I..TIBETAN MARK HALANTA - {0x0F86, 0x0F87, prExtend}, // Mn [2] TIBETAN SIGN LCI RTAGS..TIBETAN SIGN YANG RTAGS - {0x0F8D, 0x0F97, prExtend}, // Mn [11] TIBETAN SUBJOINED SIGN LCE TSA CAN..TIBETAN SUBJOINED LETTER JA - {0x0F99, 0x0FBC, prExtend}, // Mn [36] TIBETAN SUBJOINED LETTER NYA..TIBETAN SUBJOINED LETTER FIXED-FORM RA - {0x0FC6, 0x0FC6, prExtend}, // Mn TIBETAN SYMBOL PADMA GDAN - {0x102D, 0x1030, prExtend}, // Mn [4] MYANMAR VOWEL SIGN I..MYANMAR VOWEL SIGN UU - {0x1031, 0x1031, prSpacingMark}, // Mc MYANMAR VOWEL SIGN E - {0x1032, 0x1037, prExtend}, // Mn [6] MYANMAR VOWEL SIGN AI..MYANMAR SIGN DOT BELOW - {0x1039, 0x103A, prExtend}, // Mn [2] MYANMAR SIGN VIRAMA..MYANMAR SIGN ASAT - {0x103B, 0x103C, prSpacingMark}, // Mc [2] MYANMAR CONSONANT SIGN MEDIAL YA..MYANMAR CONSONANT SIGN MEDIAL RA - {0x103D, 0x103E, prExtend}, // Mn [2] MYANMAR CONSONANT SIGN MEDIAL WA..MYANMAR CONSONANT SIGN MEDIAL HA - {0x1056, 0x1057, prSpacingMark}, // Mc [2] MYANMAR VOWEL SIGN VOCALIC R..MYANMAR VOWEL SIGN VOCALIC RR - {0x1058, 0x1059, prExtend}, // Mn [2] MYANMAR VOWEL SIGN VOCALIC L..MYANMAR VOWEL SIGN VOCALIC LL - {0x105E, 0x1060, prExtend}, // Mn [3] MYANMAR CONSONANT SIGN MON MEDIAL NA..MYANMAR CONSONANT SIGN MON MEDIAL LA - {0x1071, 0x1074, prExtend}, // Mn [4] MYANMAR VOWEL SIGN GEBA KAREN I..MYANMAR VOWEL SIGN KAYAH EE - {0x1082, 0x1082, prExtend}, // Mn MYANMAR CONSONANT SIGN SHAN MEDIAL WA - {0x1084, 0x1084, prSpacingMark}, // Mc MYANMAR VOWEL SIGN SHAN E - {0x1085, 0x1086, prExtend}, // Mn [2] MYANMAR VOWEL SIGN SHAN E ABOVE..MYANMAR VOWEL SIGN SHAN FINAL Y - {0x108D, 0x108D, prExtend}, // Mn MYANMAR SIGN SHAN COUNCIL EMPHATIC TONE - {0x109D, 0x109D, prExtend}, // Mn MYANMAR VOWEL SIGN AITON AI - {0x1100, 0x115F, prL}, // Lo [96] HANGUL CHOSEONG KIYEOK..HANGUL CHOSEONG FILLER - {0x1160, 0x11A7, prV}, // Lo [72] HANGUL JUNGSEONG FILLER..HANGUL JUNGSEONG O-YAE - {0x11A8, 0x11FF, prT}, // Lo [88] HANGUL JONGSEONG KIYEOK..HANGUL JONGSEONG SSANGNIEUN - {0x135D, 0x135F, prExtend}, // Mn [3] ETHIOPIC COMBINING GEMINATION AND VOWEL LENGTH MARK..ETHIOPIC COMBINING GEMINATION MARK - {0x1712, 0x1714, prExtend}, // Mn [3] TAGALOG VOWEL SIGN I..TAGALOG SIGN VIRAMA - {0x1732, 0x1734, prExtend}, // Mn [3] HANUNOO VOWEL SIGN I..HANUNOO SIGN PAMUDPOD - {0x1752, 0x1753, prExtend}, // Mn [2] BUHID VOWEL SIGN I..BUHID VOWEL SIGN U - {0x1772, 0x1773, prExtend}, // Mn [2] TAGBANWA VOWEL SIGN I..TAGBANWA VOWEL SIGN U - {0x17B4, 0x17B5, prExtend}, // Mn [2] KHMER VOWEL INHERENT AQ..KHMER VOWEL INHERENT AA - {0x17B6, 0x17B6, prSpacingMark}, // Mc KHMER VOWEL SIGN AA - {0x17B7, 0x17BD, prExtend}, // Mn [7] KHMER VOWEL SIGN I..KHMER VOWEL SIGN UA - {0x17BE, 0x17C5, prSpacingMark}, // Mc [8] KHMER VOWEL SIGN OE..KHMER VOWEL SIGN AU - {0x17C6, 0x17C6, prExtend}, // Mn KHMER SIGN NIKAHIT - {0x17C7, 0x17C8, prSpacingMark}, // Mc [2] KHMER SIGN REAHMUK..KHMER SIGN YUUKALEAPINTU - {0x17C9, 0x17D3, prExtend}, // Mn [11] KHMER SIGN MUUSIKATOAN..KHMER SIGN BATHAMASAT - {0x17DD, 0x17DD, prExtend}, // Mn KHMER SIGN ATTHACAN - {0x180B, 0x180D, prExtend}, // Mn [3] MONGOLIAN FREE VARIATION SELECTOR ONE..MONGOLIAN FREE VARIATION SELECTOR THREE - {0x180E, 0x180E, prControl}, // Cf MONGOLIAN VOWEL SEPARATOR - {0x1885, 0x1886, prExtend}, // Mn [2] MONGOLIAN LETTER ALI GALI BALUDA..MONGOLIAN LETTER ALI GALI THREE BALUDA - {0x18A9, 0x18A9, prExtend}, // Mn MONGOLIAN LETTER ALI GALI DAGALGA - {0x1920, 0x1922, prExtend}, // Mn [3] LIMBU VOWEL SIGN A..LIMBU VOWEL SIGN U - {0x1923, 0x1926, prSpacingMark}, // Mc [4] LIMBU VOWEL SIGN EE..LIMBU VOWEL SIGN AU - {0x1927, 0x1928, prExtend}, // Mn [2] LIMBU VOWEL SIGN E..LIMBU VOWEL SIGN O - {0x1929, 0x192B, prSpacingMark}, // Mc [3] LIMBU SUBJOINED LETTER YA..LIMBU SUBJOINED LETTER WA - {0x1930, 0x1931, prSpacingMark}, // Mc [2] LIMBU SMALL LETTER KA..LIMBU SMALL LETTER NGA - {0x1932, 0x1932, prExtend}, // Mn LIMBU SMALL LETTER ANUSVARA - {0x1933, 0x1938, prSpacingMark}, // Mc [6] LIMBU SMALL LETTER TA..LIMBU SMALL LETTER LA - {0x1939, 0x193B, prExtend}, // Mn [3] LIMBU SIGN MUKPHRENG..LIMBU SIGN SA-I - {0x1A17, 0x1A18, prExtend}, // Mn [2] BUGINESE VOWEL SIGN I..BUGINESE VOWEL SIGN U - {0x1A19, 0x1A1A, prSpacingMark}, // Mc [2] BUGINESE VOWEL SIGN E..BUGINESE VOWEL SIGN O - {0x1A1B, 0x1A1B, prExtend}, // Mn BUGINESE VOWEL SIGN AE - {0x1A55, 0x1A55, prSpacingMark}, // Mc TAI THAM CONSONANT SIGN MEDIAL RA - {0x1A56, 0x1A56, prExtend}, // Mn TAI THAM CONSONANT SIGN MEDIAL LA - {0x1A57, 0x1A57, prSpacingMark}, // Mc TAI THAM CONSONANT SIGN LA TANG LAI - {0x1A58, 0x1A5E, prExtend}, // Mn [7] TAI THAM SIGN MAI KANG LAI..TAI THAM CONSONANT SIGN SA - {0x1A60, 0x1A60, prExtend}, // Mn TAI THAM SIGN SAKOT - {0x1A62, 0x1A62, prExtend}, // Mn TAI THAM VOWEL SIGN MAI SAT - {0x1A65, 0x1A6C, prExtend}, // Mn [8] TAI THAM VOWEL SIGN I..TAI THAM VOWEL SIGN OA BELOW - {0x1A6D, 0x1A72, prSpacingMark}, // Mc [6] TAI THAM VOWEL SIGN OY..TAI THAM VOWEL SIGN THAM AI - {0x1A73, 0x1A7C, prExtend}, // Mn [10] TAI THAM VOWEL SIGN OA ABOVE..TAI THAM SIGN KHUEN-LUE KARAN - {0x1A7F, 0x1A7F, prExtend}, // Mn TAI THAM COMBINING CRYPTOGRAMMIC DOT - {0x1AB0, 0x1ABD, prExtend}, // Mn [14] COMBINING DOUBLED CIRCUMFLEX ACCENT..COMBINING PARENTHESES BELOW - {0x1ABE, 0x1ABE, prExtend}, // Me COMBINING PARENTHESES OVERLAY - {0x1B00, 0x1B03, prExtend}, // Mn [4] BALINESE SIGN ULU RICEM..BALINESE SIGN SURANG - {0x1B04, 0x1B04, prSpacingMark}, // Mc BALINESE SIGN BISAH - {0x1B34, 0x1B34, prExtend}, // Mn BALINESE SIGN REREKAN - {0x1B35, 0x1B35, prExtend}, // Mc BALINESE VOWEL SIGN TEDUNG - {0x1B36, 0x1B3A, prExtend}, // Mn [5] BALINESE VOWEL SIGN ULU..BALINESE VOWEL SIGN RA REPA - {0x1B3B, 0x1B3B, prSpacingMark}, // Mc BALINESE VOWEL SIGN RA REPA TEDUNG - {0x1B3C, 0x1B3C, prExtend}, // Mn BALINESE VOWEL SIGN LA LENGA - {0x1B3D, 0x1B41, prSpacingMark}, // Mc [5] BALINESE VOWEL SIGN LA LENGA TEDUNG..BALINESE VOWEL SIGN TALING REPA TEDUNG - {0x1B42, 0x1B42, prExtend}, // Mn BALINESE VOWEL SIGN PEPET - {0x1B43, 0x1B44, prSpacingMark}, // Mc [2] BALINESE VOWEL SIGN PEPET TEDUNG..BALINESE ADEG ADEG - {0x1B6B, 0x1B73, prExtend}, // Mn [9] BALINESE MUSICAL SYMBOL COMBINING TEGEH..BALINESE MUSICAL SYMBOL COMBINING GONG - {0x1B80, 0x1B81, prExtend}, // Mn [2] SUNDANESE SIGN PANYECEK..SUNDANESE SIGN PANGLAYAR - {0x1B82, 0x1B82, prSpacingMark}, // Mc SUNDANESE SIGN PANGWISAD - {0x1BA1, 0x1BA1, prSpacingMark}, // Mc SUNDANESE CONSONANT SIGN PAMINGKAL - {0x1BA2, 0x1BA5, prExtend}, // Mn [4] SUNDANESE CONSONANT SIGN PANYAKRA..SUNDANESE VOWEL SIGN PANYUKU - {0x1BA6, 0x1BA7, prSpacingMark}, // Mc [2] SUNDANESE VOWEL SIGN PANAELAENG..SUNDANESE VOWEL SIGN PANOLONG - {0x1BA8, 0x1BA9, prExtend}, // Mn [2] SUNDANESE VOWEL SIGN PAMEPET..SUNDANESE VOWEL SIGN PANEULEUNG - {0x1BAA, 0x1BAA, prSpacingMark}, // Mc SUNDANESE SIGN PAMAAEH - {0x1BAB, 0x1BAD, prExtend}, // Mn [3] SUNDANESE SIGN VIRAMA..SUNDANESE CONSONANT SIGN PASANGAN WA - {0x1BE6, 0x1BE6, prExtend}, // Mn BATAK SIGN TOMPI - {0x1BE7, 0x1BE7, prSpacingMark}, // Mc BATAK VOWEL SIGN E - {0x1BE8, 0x1BE9, prExtend}, // Mn [2] BATAK VOWEL SIGN PAKPAK E..BATAK VOWEL SIGN EE - {0x1BEA, 0x1BEC, prSpacingMark}, // Mc [3] BATAK VOWEL SIGN I..BATAK VOWEL SIGN O - {0x1BED, 0x1BED, prExtend}, // Mn BATAK VOWEL SIGN KARO O - {0x1BEE, 0x1BEE, prSpacingMark}, // Mc BATAK VOWEL SIGN U - {0x1BEF, 0x1BF1, prExtend}, // Mn [3] BATAK VOWEL SIGN U FOR SIMALUNGUN SA..BATAK CONSONANT SIGN H - {0x1BF2, 0x1BF3, prSpacingMark}, // Mc [2] BATAK PANGOLAT..BATAK PANONGONAN - {0x1C24, 0x1C2B, prSpacingMark}, // Mc [8] LEPCHA SUBJOINED LETTER YA..LEPCHA VOWEL SIGN UU - {0x1C2C, 0x1C33, prExtend}, // Mn [8] LEPCHA VOWEL SIGN E..LEPCHA CONSONANT SIGN T - {0x1C34, 0x1C35, prSpacingMark}, // Mc [2] LEPCHA CONSONANT SIGN NYIN-DO..LEPCHA CONSONANT SIGN KANG - {0x1C36, 0x1C37, prExtend}, // Mn [2] LEPCHA SIGN RAN..LEPCHA SIGN NUKTA - {0x1CD0, 0x1CD2, prExtend}, // Mn [3] VEDIC TONE KARSHANA..VEDIC TONE PRENKHA - {0x1CD4, 0x1CE0, prExtend}, // Mn [13] VEDIC SIGN YAJURVEDIC MIDLINE SVARITA..VEDIC TONE RIGVEDIC KASHMIRI INDEPENDENT SVARITA - {0x1CE1, 0x1CE1, prSpacingMark}, // Mc VEDIC TONE ATHARVAVEDIC INDEPENDENT SVARITA - {0x1CE2, 0x1CE8, prExtend}, // Mn [7] VEDIC SIGN VISARGA SVARITA..VEDIC SIGN VISARGA ANUDATTA WITH TAIL - {0x1CED, 0x1CED, prExtend}, // Mn VEDIC SIGN TIRYAK - {0x1CF4, 0x1CF4, prExtend}, // Mn VEDIC TONE CANDRA ABOVE - {0x1CF7, 0x1CF7, prSpacingMark}, // Mc VEDIC SIGN ATIKRAMA - {0x1CF8, 0x1CF9, prExtend}, // Mn [2] VEDIC TONE RING ABOVE..VEDIC TONE DOUBLE RING ABOVE - {0x1DC0, 0x1DF9, prExtend}, // Mn [58] COMBINING DOTTED GRAVE ACCENT..COMBINING WIDE INVERTED BRIDGE BELOW - {0x1DFB, 0x1DFF, prExtend}, // Mn [5] COMBINING DELETION MARK..COMBINING RIGHT ARROWHEAD AND DOWN ARROWHEAD BELOW - {0x200B, 0x200B, prControl}, // Cf ZERO WIDTH SPACE - {0x200C, 0x200C, prExtend}, // Cf ZERO WIDTH NON-JOINER - {0x200D, 0x200D, prZWJ}, // Cf ZERO WIDTH JOINER - {0x200E, 0x200F, prControl}, // Cf [2] LEFT-TO-RIGHT MARK..RIGHT-TO-LEFT MARK - {0x2028, 0x2028, prControl}, // Zl LINE SEPARATOR - {0x2029, 0x2029, prControl}, // Zp PARAGRAPH SEPARATOR - {0x202A, 0x202E, prControl}, // Cf [5] LEFT-TO-RIGHT EMBEDDING..RIGHT-TO-LEFT OVERRIDE - {0x203C, 0x203C, prExtendedPictographic}, // 1.1 [1] (‼️) double exclamation mark - {0x2049, 0x2049, prExtendedPictographic}, // 3.0 [1] (⁉️) exclamation question mark - {0x2060, 0x2064, prControl}, // Cf [5] WORD JOINER..INVISIBLE PLUS - {0x2065, 0x2065, prControl}, // Cn - {0x2066, 0x206F, prControl}, // Cf [10] LEFT-TO-RIGHT ISOLATE..NOMINAL DIGIT SHAPES - {0x20D0, 0x20DC, prExtend}, // Mn [13] COMBINING LEFT HARPOON ABOVE..COMBINING FOUR DOTS ABOVE - {0x20DD, 0x20E0, prExtend}, // Me [4] COMBINING ENCLOSING CIRCLE..COMBINING ENCLOSING CIRCLE BACKSLASH - {0x20E1, 0x20E1, prExtend}, // Mn COMBINING LEFT RIGHT ARROW ABOVE - {0x20E2, 0x20E4, prExtend}, // Me [3] COMBINING ENCLOSING SCREEN..COMBINING ENCLOSING UPWARD POINTING TRIANGLE - {0x20E5, 0x20F0, prExtend}, // Mn [12] COMBINING REVERSE SOLIDUS OVERLAY..COMBINING ASTERISK ABOVE - {0x2122, 0x2122, prExtendedPictographic}, // 1.1 [1] (™️) trade mark - {0x2139, 0x2139, prExtendedPictographic}, // 3.0 [1] (ℹ️) information - {0x2194, 0x2199, prExtendedPictographic}, // 1.1 [6] (↔️..↙️) left-right arrow..down-left arrow - {0x21A9, 0x21AA, prExtendedPictographic}, // 1.1 [2] (↩️..↪️) right arrow curving left..left arrow curving right - {0x231A, 0x231B, prExtendedPictographic}, // 1.1 [2] (⌚..⌛) watch..hourglass done - {0x2328, 0x2328, prExtendedPictographic}, // 1.1 [1] (⌨️) keyboard - {0x2388, 0x2388, prExtendedPictographic}, // 3.0 [1] (⎈) HELM SYMBOL - {0x23CF, 0x23CF, prExtendedPictographic}, // 4.0 [1] (⏏️) eject button - {0x23E9, 0x23F3, prExtendedPictographic}, // 6.0 [11] (⏩..⏳) fast-forward button..hourglass not done - {0x23F8, 0x23FA, prExtendedPictographic}, // 7.0 [3] (⏸️..⏺️) pause button..record button - {0x24C2, 0x24C2, prExtendedPictographic}, // 1.1 [1] (Ⓜ️) circled M - {0x25AA, 0x25AB, prExtendedPictographic}, // 1.1 [2] (▪️..▫️) black small square..white small square - {0x25B6, 0x25B6, prExtendedPictographic}, // 1.1 [1] (▶️) play button - {0x25C0, 0x25C0, prExtendedPictographic}, // 1.1 [1] (◀️) reverse button - {0x25FB, 0x25FE, prExtendedPictographic}, // 3.2 [4] (◻️..◾) white medium square..black medium-small square - {0x2600, 0x2605, prExtendedPictographic}, // 1.1 [6] (☀️..★) sun..BLACK STAR - {0x2607, 0x2612, prExtendedPictographic}, // 1.1 [12] (☇..☒) LIGHTNING..BALLOT BOX WITH X - {0x2614, 0x2615, prExtendedPictographic}, // 4.0 [2] (☔..☕) umbrella with rain drops..hot beverage - {0x2616, 0x2617, prExtendedPictographic}, // 3.2 [2] (☖..☗) WHITE SHOGI PIECE..BLACK SHOGI PIECE - {0x2618, 0x2618, prExtendedPictographic}, // 4.1 [1] (☘️) shamrock - {0x2619, 0x2619, prExtendedPictographic}, // 3.0 [1] (☙) REVERSED ROTATED FLORAL HEART BULLET - {0x261A, 0x266F, prExtendedPictographic}, // 1.1 [86] (☚..♯) BLACK LEFT POINTING INDEX..MUSIC SHARP SIGN - {0x2670, 0x2671, prExtendedPictographic}, // 3.0 [2] (♰..♱) WEST SYRIAC CROSS..EAST SYRIAC CROSS - {0x2672, 0x267D, prExtendedPictographic}, // 3.2 [12] (♲..♽) UNIVERSAL RECYCLING SYMBOL..PARTIALLY-RECYCLED PAPER SYMBOL - {0x267E, 0x267F, prExtendedPictographic}, // 4.1 [2] (♾️..♿) infinity..wheelchair symbol - {0x2680, 0x2685, prExtendedPictographic}, // 3.2 [6] (⚀..⚅) DIE FACE-1..DIE FACE-6 - {0x2690, 0x2691, prExtendedPictographic}, // 4.0 [2] (⚐..⚑) WHITE FLAG..BLACK FLAG - {0x2692, 0x269C, prExtendedPictographic}, // 4.1 [11] (⚒️..⚜️) hammer and pick..fleur-de-lis - {0x269D, 0x269D, prExtendedPictographic}, // 5.1 [1] (⚝) OUTLINED WHITE STAR - {0x269E, 0x269F, prExtendedPictographic}, // 5.2 [2] (⚞..⚟) THREE LINES CONVERGING RIGHT..THREE LINES CONVERGING LEFT - {0x26A0, 0x26A1, prExtendedPictographic}, // 4.0 [2] (⚠️..⚡) warning..high voltage - {0x26A2, 0x26B1, prExtendedPictographic}, // 4.1 [16] (⚢..⚱️) DOUBLED FEMALE SIGN..funeral urn - {0x26B2, 0x26B2, prExtendedPictographic}, // 5.0 [1] (⚲) NEUTER - {0x26B3, 0x26BC, prExtendedPictographic}, // 5.1 [10] (⚳..⚼) CERES..SESQUIQUADRATE - {0x26BD, 0x26BF, prExtendedPictographic}, // 5.2 [3] (⚽..⚿) soccer ball..SQUARED KEY - {0x26C0, 0x26C3, prExtendedPictographic}, // 5.1 [4] (⛀..⛃) WHITE DRAUGHTS MAN..BLACK DRAUGHTS KING - {0x26C4, 0x26CD, prExtendedPictographic}, // 5.2 [10] (⛄..⛍) snowman without snow..DISABLED CAR - {0x26CE, 0x26CE, prExtendedPictographic}, // 6.0 [1] (⛎) Ophiuchus - {0x26CF, 0x26E1, prExtendedPictographic}, // 5.2 [19] (⛏️..⛡) pick..RESTRICTED LEFT ENTRY-2 - {0x26E2, 0x26E2, prExtendedPictographic}, // 6.0 [1] (⛢) ASTRONOMICAL SYMBOL FOR URANUS - {0x26E3, 0x26E3, prExtendedPictographic}, // 5.2 [1] (⛣) HEAVY CIRCLE WITH STROKE AND TWO DOTS ABOVE - {0x26E4, 0x26E7, prExtendedPictographic}, // 6.0 [4] (⛤..⛧) PENTAGRAM..INVERTED PENTAGRAM - {0x26E8, 0x26FF, prExtendedPictographic}, // 5.2 [24] (⛨..⛿) BLACK CROSS ON SHIELD..WHITE FLAG WITH HORIZONTAL MIDDLE BLACK STRIPE - {0x2700, 0x2700, prExtendedPictographic}, // 7.0 [1] (✀) BLACK SAFETY SCISSORS - {0x2701, 0x2704, prExtendedPictographic}, // 1.1 [4] (✁..✄) UPPER BLADE SCISSORS..WHITE SCISSORS - {0x2705, 0x2705, prExtendedPictographic}, // 6.0 [1] (✅) check mark button - {0x2708, 0x2709, prExtendedPictographic}, // 1.1 [2] (✈️..✉️) airplane..envelope - {0x270A, 0x270B, prExtendedPictographic}, // 6.0 [2] (✊..✋) raised fist..raised hand - {0x270C, 0x2712, prExtendedPictographic}, // 1.1 [7] (✌️..✒️) victory hand..black nib - {0x2714, 0x2714, prExtendedPictographic}, // 1.1 [1] (✔️) check mark - {0x2716, 0x2716, prExtendedPictographic}, // 1.1 [1] (✖️) multiplication sign - {0x271D, 0x271D, prExtendedPictographic}, // 1.1 [1] (✝️) latin cross - {0x2721, 0x2721, prExtendedPictographic}, // 1.1 [1] (✡️) star of David - {0x2728, 0x2728, prExtendedPictographic}, // 6.0 [1] (✨) sparkles - {0x2733, 0x2734, prExtendedPictographic}, // 1.1 [2] (✳️..✴️) eight-spoked asterisk..eight-pointed star - {0x2744, 0x2744, prExtendedPictographic}, // 1.1 [1] (❄️) snowflake - {0x2747, 0x2747, prExtendedPictographic}, // 1.1 [1] (❇️) sparkle - {0x274C, 0x274C, prExtendedPictographic}, // 6.0 [1] (❌) cross mark - {0x274E, 0x274E, prExtendedPictographic}, // 6.0 [1] (❎) cross mark button - {0x2753, 0x2755, prExtendedPictographic}, // 6.0 [3] (❓..❕) question mark..white exclamation mark - {0x2757, 0x2757, prExtendedPictographic}, // 5.2 [1] (❗) exclamation mark - {0x2763, 0x2767, prExtendedPictographic}, // 1.1 [5] (❣️..❧) heart exclamation..ROTATED FLORAL HEART BULLET - {0x2795, 0x2797, prExtendedPictographic}, // 6.0 [3] (➕..➗) plus sign..division sign - {0x27A1, 0x27A1, prExtendedPictographic}, // 1.1 [1] (➡️) right arrow - {0x27B0, 0x27B0, prExtendedPictographic}, // 6.0 [1] (➰) curly loop - {0x27BF, 0x27BF, prExtendedPictographic}, // 6.0 [1] (➿) double curly loop - {0x2934, 0x2935, prExtendedPictographic}, // 3.2 [2] (⤴️..⤵️) right arrow curving up..right arrow curving down - {0x2B05, 0x2B07, prExtendedPictographic}, // 4.0 [3] (⬅️..⬇️) left arrow..down arrow - {0x2B1B, 0x2B1C, prExtendedPictographic}, // 5.1 [2] (⬛..⬜) black large square..white large square - {0x2B50, 0x2B50, prExtendedPictographic}, // 5.1 [1] (⭐) star - {0x2B55, 0x2B55, prExtendedPictographic}, // 5.2 [1] (⭕) hollow red circle - {0x2CEF, 0x2CF1, prExtend}, // Mn [3] COPTIC COMBINING NI ABOVE..COPTIC COMBINING SPIRITUS LENIS - {0x2D7F, 0x2D7F, prExtend}, // Mn TIFINAGH CONSONANT JOINER - {0x2DE0, 0x2DFF, prExtend}, // Mn [32] COMBINING CYRILLIC LETTER BE..COMBINING CYRILLIC LETTER IOTIFIED BIG YUS - {0x302A, 0x302D, prExtend}, // Mn [4] IDEOGRAPHIC LEVEL TONE MARK..IDEOGRAPHIC ENTERING TONE MARK - {0x302E, 0x302F, prExtend}, // Mc [2] HANGUL SINGLE DOT TONE MARK..HANGUL DOUBLE DOT TONE MARK - {0x3030, 0x3030, prExtendedPictographic}, // 1.1 [1] (〰️) wavy dash - {0x303D, 0x303D, prExtendedPictographic}, // 3.2 [1] (〽️) part alternation mark - {0x3099, 0x309A, prExtend}, // Mn [2] COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK..COMBINING KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK - {0x3297, 0x3297, prExtendedPictographic}, // 1.1 [1] (㊗️) Japanese “congratulations” button - {0x3299, 0x3299, prExtendedPictographic}, // 1.1 [1] (㊙️) Japanese “secret” button - {0xA66F, 0xA66F, prExtend}, // Mn COMBINING CYRILLIC VZMET - {0xA670, 0xA672, prExtend}, // Me [3] COMBINING CYRILLIC TEN MILLIONS SIGN..COMBINING CYRILLIC THOUSAND MILLIONS SIGN - {0xA674, 0xA67D, prExtend}, // Mn [10] COMBINING CYRILLIC LETTER UKRAINIAN IE..COMBINING CYRILLIC PAYEROK - {0xA69E, 0xA69F, prExtend}, // Mn [2] COMBINING CYRILLIC LETTER EF..COMBINING CYRILLIC LETTER IOTIFIED E - {0xA6F0, 0xA6F1, prExtend}, // Mn [2] BAMUM COMBINING MARK KOQNDON..BAMUM COMBINING MARK TUKWENTIS - {0xA802, 0xA802, prExtend}, // Mn SYLOTI NAGRI SIGN DVISVARA - {0xA806, 0xA806, prExtend}, // Mn SYLOTI NAGRI SIGN HASANTA - {0xA80B, 0xA80B, prExtend}, // Mn SYLOTI NAGRI SIGN ANUSVARA - {0xA823, 0xA824, prSpacingMark}, // Mc [2] SYLOTI NAGRI VOWEL SIGN A..SYLOTI NAGRI VOWEL SIGN I - {0xA825, 0xA826, prExtend}, // Mn [2] SYLOTI NAGRI VOWEL SIGN U..SYLOTI NAGRI VOWEL SIGN E - {0xA827, 0xA827, prSpacingMark}, // Mc SYLOTI NAGRI VOWEL SIGN OO - {0xA880, 0xA881, prSpacingMark}, // Mc [2] SAURASHTRA SIGN ANUSVARA..SAURASHTRA SIGN VISARGA - {0xA8B4, 0xA8C3, prSpacingMark}, // Mc [16] SAURASHTRA CONSONANT SIGN HAARU..SAURASHTRA VOWEL SIGN AU - {0xA8C4, 0xA8C5, prExtend}, // Mn [2] SAURASHTRA SIGN VIRAMA..SAURASHTRA SIGN CANDRABINDU - {0xA8E0, 0xA8F1, prExtend}, // Mn [18] COMBINING DEVANAGARI DIGIT ZERO..COMBINING DEVANAGARI SIGN AVAGRAHA - {0xA8FF, 0xA8FF, prExtend}, // Mn DEVANAGARI VOWEL SIGN AY - {0xA926, 0xA92D, prExtend}, // Mn [8] KAYAH LI VOWEL UE..KAYAH LI TONE CALYA PLOPHU - {0xA947, 0xA951, prExtend}, // Mn [11] REJANG VOWEL SIGN I..REJANG CONSONANT SIGN R - {0xA952, 0xA953, prSpacingMark}, // Mc [2] REJANG CONSONANT SIGN H..REJANG VIRAMA - {0xA960, 0xA97C, prL}, // Lo [29] HANGUL CHOSEONG TIKEUT-MIEUM..HANGUL CHOSEONG SSANGYEORINHIEUH - {0xA980, 0xA982, prExtend}, // Mn [3] JAVANESE SIGN PANYANGGA..JAVANESE SIGN LAYAR - {0xA983, 0xA983, prSpacingMark}, // Mc JAVANESE SIGN WIGNYAN - {0xA9B3, 0xA9B3, prExtend}, // Mn JAVANESE SIGN CECAK TELU - {0xA9B4, 0xA9B5, prSpacingMark}, // Mc [2] JAVANESE VOWEL SIGN TARUNG..JAVANESE VOWEL SIGN TOLONG - {0xA9B6, 0xA9B9, prExtend}, // Mn [4] JAVANESE VOWEL SIGN WULU..JAVANESE VOWEL SIGN SUKU MENDUT - {0xA9BA, 0xA9BB, prSpacingMark}, // Mc [2] JAVANESE VOWEL SIGN TALING..JAVANESE VOWEL SIGN DIRGA MURE - {0xA9BC, 0xA9BD, prExtend}, // Mn [2] JAVANESE VOWEL SIGN PEPET..JAVANESE CONSONANT SIGN KERET - {0xA9BE, 0xA9C0, prSpacingMark}, // Mc [3] JAVANESE CONSONANT SIGN PENGKAL..JAVANESE PANGKON - {0xA9E5, 0xA9E5, prExtend}, // Mn MYANMAR SIGN SHAN SAW - {0xAA29, 0xAA2E, prExtend}, // Mn [6] CHAM VOWEL SIGN AA..CHAM VOWEL SIGN OE - {0xAA2F, 0xAA30, prSpacingMark}, // Mc [2] CHAM VOWEL SIGN O..CHAM VOWEL SIGN AI - {0xAA31, 0xAA32, prExtend}, // Mn [2] CHAM VOWEL SIGN AU..CHAM VOWEL SIGN UE - {0xAA33, 0xAA34, prSpacingMark}, // Mc [2] CHAM CONSONANT SIGN YA..CHAM CONSONANT SIGN RA - {0xAA35, 0xAA36, prExtend}, // Mn [2] CHAM CONSONANT SIGN LA..CHAM CONSONANT SIGN WA - {0xAA43, 0xAA43, prExtend}, // Mn CHAM CONSONANT SIGN FINAL NG - {0xAA4C, 0xAA4C, prExtend}, // Mn CHAM CONSONANT SIGN FINAL M - {0xAA4D, 0xAA4D, prSpacingMark}, // Mc CHAM CONSONANT SIGN FINAL H - {0xAA7C, 0xAA7C, prExtend}, // Mn MYANMAR SIGN TAI LAING TONE-2 - {0xAAB0, 0xAAB0, prExtend}, // Mn TAI VIET MAI KANG - {0xAAB2, 0xAAB4, prExtend}, // Mn [3] TAI VIET VOWEL I..TAI VIET VOWEL U - {0xAAB7, 0xAAB8, prExtend}, // Mn [2] TAI VIET MAI KHIT..TAI VIET VOWEL IA - {0xAABE, 0xAABF, prExtend}, // Mn [2] TAI VIET VOWEL AM..TAI VIET TONE MAI EK - {0xAAC1, 0xAAC1, prExtend}, // Mn TAI VIET TONE MAI THO - {0xAAEB, 0xAAEB, prSpacingMark}, // Mc MEETEI MAYEK VOWEL SIGN II - {0xAAEC, 0xAAED, prExtend}, // Mn [2] MEETEI MAYEK VOWEL SIGN UU..MEETEI MAYEK VOWEL SIGN AAI - {0xAAEE, 0xAAEF, prSpacingMark}, // Mc [2] MEETEI MAYEK VOWEL SIGN AU..MEETEI MAYEK VOWEL SIGN AAU - {0xAAF5, 0xAAF5, prSpacingMark}, // Mc MEETEI MAYEK VOWEL SIGN VISARGA - {0xAAF6, 0xAAF6, prExtend}, // Mn MEETEI MAYEK VIRAMA - {0xABE3, 0xABE4, prSpacingMark}, // Mc [2] MEETEI MAYEK VOWEL SIGN ONAP..MEETEI MAYEK VOWEL SIGN INAP - {0xABE5, 0xABE5, prExtend}, // Mn MEETEI MAYEK VOWEL SIGN ANAP - {0xABE6, 0xABE7, prSpacingMark}, // Mc [2] MEETEI MAYEK VOWEL SIGN YENAP..MEETEI MAYEK VOWEL SIGN SOUNAP - {0xABE8, 0xABE8, prExtend}, // Mn MEETEI MAYEK VOWEL SIGN UNAP - {0xABE9, 0xABEA, prSpacingMark}, // Mc [2] MEETEI MAYEK VOWEL SIGN CHEINAP..MEETEI MAYEK VOWEL SIGN NUNG - {0xABEC, 0xABEC, prSpacingMark}, // Mc MEETEI MAYEK LUM IYEK - {0xABED, 0xABED, prExtend}, // Mn MEETEI MAYEK APUN IYEK - {0xAC00, 0xAC00, prLV}, // Lo HANGUL SYLLABLE GA - {0xAC01, 0xAC1B, prLVT}, // Lo [27] HANGUL SYLLABLE GAG..HANGUL SYLLABLE GAH - {0xAC1C, 0xAC1C, prLV}, // Lo HANGUL SYLLABLE GAE - {0xAC1D, 0xAC37, prLVT}, // Lo [27] HANGUL SYLLABLE GAEG..HANGUL SYLLABLE GAEH - {0xAC38, 0xAC38, prLV}, // Lo HANGUL SYLLABLE GYA - {0xAC39, 0xAC53, prLVT}, // Lo [27] HANGUL SYLLABLE GYAG..HANGUL SYLLABLE GYAH - {0xAC54, 0xAC54, prLV}, // Lo HANGUL SYLLABLE GYAE - {0xAC55, 0xAC6F, prLVT}, // Lo [27] HANGUL SYLLABLE GYAEG..HANGUL SYLLABLE GYAEH - {0xAC70, 0xAC70, prLV}, // Lo HANGUL SYLLABLE GEO - {0xAC71, 0xAC8B, prLVT}, // Lo [27] HANGUL SYLLABLE GEOG..HANGUL SYLLABLE GEOH - {0xAC8C, 0xAC8C, prLV}, // Lo HANGUL SYLLABLE GE - {0xAC8D, 0xACA7, prLVT}, // Lo [27] HANGUL SYLLABLE GEG..HANGUL SYLLABLE GEH - {0xACA8, 0xACA8, prLV}, // Lo HANGUL SYLLABLE GYEO - {0xACA9, 0xACC3, prLVT}, // Lo [27] HANGUL SYLLABLE GYEOG..HANGUL SYLLABLE GYEOH - {0xACC4, 0xACC4, prLV}, // Lo HANGUL SYLLABLE GYE - {0xACC5, 0xACDF, prLVT}, // Lo [27] HANGUL SYLLABLE GYEG..HANGUL SYLLABLE GYEH - {0xACE0, 0xACE0, prLV}, // Lo HANGUL SYLLABLE GO - {0xACE1, 0xACFB, prLVT}, // Lo [27] HANGUL SYLLABLE GOG..HANGUL SYLLABLE GOH - {0xACFC, 0xACFC, prLV}, // Lo HANGUL SYLLABLE GWA - {0xACFD, 0xAD17, prLVT}, // Lo [27] HANGUL SYLLABLE GWAG..HANGUL SYLLABLE GWAH - {0xAD18, 0xAD18, prLV}, // Lo HANGUL SYLLABLE GWAE - {0xAD19, 0xAD33, prLVT}, // Lo [27] HANGUL SYLLABLE GWAEG..HANGUL SYLLABLE GWAEH - {0xAD34, 0xAD34, prLV}, // Lo HANGUL SYLLABLE GOE - {0xAD35, 0xAD4F, prLVT}, // Lo [27] HANGUL SYLLABLE GOEG..HANGUL SYLLABLE GOEH - {0xAD50, 0xAD50, prLV}, // Lo HANGUL SYLLABLE GYO - {0xAD51, 0xAD6B, prLVT}, // Lo [27] HANGUL SYLLABLE GYOG..HANGUL SYLLABLE GYOH - {0xAD6C, 0xAD6C, prLV}, // Lo HANGUL SYLLABLE GU - {0xAD6D, 0xAD87, prLVT}, // Lo [27] HANGUL SYLLABLE GUG..HANGUL SYLLABLE GUH - {0xAD88, 0xAD88, prLV}, // Lo HANGUL SYLLABLE GWEO - {0xAD89, 0xADA3, prLVT}, // Lo [27] HANGUL SYLLABLE GWEOG..HANGUL SYLLABLE GWEOH - {0xADA4, 0xADA4, prLV}, // Lo HANGUL SYLLABLE GWE - {0xADA5, 0xADBF, prLVT}, // Lo [27] HANGUL SYLLABLE GWEG..HANGUL SYLLABLE GWEH - {0xADC0, 0xADC0, prLV}, // Lo HANGUL SYLLABLE GWI - {0xADC1, 0xADDB, prLVT}, // Lo [27] HANGUL SYLLABLE GWIG..HANGUL SYLLABLE GWIH - {0xADDC, 0xADDC, prLV}, // Lo HANGUL SYLLABLE GYU - {0xADDD, 0xADF7, prLVT}, // Lo [27] HANGUL SYLLABLE GYUG..HANGUL SYLLABLE GYUH - {0xADF8, 0xADF8, prLV}, // Lo HANGUL SYLLABLE GEU - {0xADF9, 0xAE13, prLVT}, // Lo [27] HANGUL SYLLABLE GEUG..HANGUL SYLLABLE GEUH - {0xAE14, 0xAE14, prLV}, // Lo HANGUL SYLLABLE GYI - {0xAE15, 0xAE2F, prLVT}, // Lo [27] HANGUL SYLLABLE GYIG..HANGUL SYLLABLE GYIH - {0xAE30, 0xAE30, prLV}, // Lo HANGUL SYLLABLE GI - {0xAE31, 0xAE4B, prLVT}, // Lo [27] HANGUL SYLLABLE GIG..HANGUL SYLLABLE GIH - {0xAE4C, 0xAE4C, prLV}, // Lo HANGUL SYLLABLE GGA - {0xAE4D, 0xAE67, prLVT}, // Lo [27] HANGUL SYLLABLE GGAG..HANGUL SYLLABLE GGAH - {0xAE68, 0xAE68, prLV}, // Lo HANGUL SYLLABLE GGAE - {0xAE69, 0xAE83, prLVT}, // Lo [27] HANGUL SYLLABLE GGAEG..HANGUL SYLLABLE GGAEH - {0xAE84, 0xAE84, prLV}, // Lo HANGUL SYLLABLE GGYA - {0xAE85, 0xAE9F, prLVT}, // Lo [27] HANGUL SYLLABLE GGYAG..HANGUL SYLLABLE GGYAH - {0xAEA0, 0xAEA0, prLV}, // Lo HANGUL SYLLABLE GGYAE - {0xAEA1, 0xAEBB, prLVT}, // Lo [27] HANGUL SYLLABLE GGYAEG..HANGUL SYLLABLE GGYAEH - {0xAEBC, 0xAEBC, prLV}, // Lo HANGUL SYLLABLE GGEO - {0xAEBD, 0xAED7, prLVT}, // Lo [27] HANGUL SYLLABLE GGEOG..HANGUL SYLLABLE GGEOH - {0xAED8, 0xAED8, prLV}, // Lo HANGUL SYLLABLE GGE - {0xAED9, 0xAEF3, prLVT}, // Lo [27] HANGUL SYLLABLE GGEG..HANGUL SYLLABLE GGEH - {0xAEF4, 0xAEF4, prLV}, // Lo HANGUL SYLLABLE GGYEO - {0xAEF5, 0xAF0F, prLVT}, // Lo [27] HANGUL SYLLABLE GGYEOG..HANGUL SYLLABLE GGYEOH - {0xAF10, 0xAF10, prLV}, // Lo HANGUL SYLLABLE GGYE - {0xAF11, 0xAF2B, prLVT}, // Lo [27] HANGUL SYLLABLE GGYEG..HANGUL SYLLABLE GGYEH - {0xAF2C, 0xAF2C, prLV}, // Lo HANGUL SYLLABLE GGO - {0xAF2D, 0xAF47, prLVT}, // Lo [27] HANGUL SYLLABLE GGOG..HANGUL SYLLABLE GGOH - {0xAF48, 0xAF48, prLV}, // Lo HANGUL SYLLABLE GGWA - {0xAF49, 0xAF63, prLVT}, // Lo [27] HANGUL SYLLABLE GGWAG..HANGUL SYLLABLE GGWAH - {0xAF64, 0xAF64, prLV}, // Lo HANGUL SYLLABLE GGWAE - {0xAF65, 0xAF7F, prLVT}, // Lo [27] HANGUL SYLLABLE GGWAEG..HANGUL SYLLABLE GGWAEH - {0xAF80, 0xAF80, prLV}, // Lo HANGUL SYLLABLE GGOE - {0xAF81, 0xAF9B, prLVT}, // Lo [27] HANGUL SYLLABLE GGOEG..HANGUL SYLLABLE GGOEH - {0xAF9C, 0xAF9C, prLV}, // Lo HANGUL SYLLABLE GGYO - {0xAF9D, 0xAFB7, prLVT}, // Lo [27] HANGUL SYLLABLE GGYOG..HANGUL SYLLABLE GGYOH - {0xAFB8, 0xAFB8, prLV}, // Lo HANGUL SYLLABLE GGU - {0xAFB9, 0xAFD3, prLVT}, // Lo [27] HANGUL SYLLABLE GGUG..HANGUL SYLLABLE GGUH - {0xAFD4, 0xAFD4, prLV}, // Lo HANGUL SYLLABLE GGWEO - {0xAFD5, 0xAFEF, prLVT}, // Lo [27] HANGUL SYLLABLE GGWEOG..HANGUL SYLLABLE GGWEOH - {0xAFF0, 0xAFF0, prLV}, // Lo HANGUL SYLLABLE GGWE - {0xAFF1, 0xB00B, prLVT}, // Lo [27] HANGUL SYLLABLE GGWEG..HANGUL SYLLABLE GGWEH - {0xB00C, 0xB00C, prLV}, // Lo HANGUL SYLLABLE GGWI - {0xB00D, 0xB027, prLVT}, // Lo [27] HANGUL SYLLABLE GGWIG..HANGUL SYLLABLE GGWIH - {0xB028, 0xB028, prLV}, // Lo HANGUL SYLLABLE GGYU - {0xB029, 0xB043, prLVT}, // Lo [27] HANGUL SYLLABLE GGYUG..HANGUL SYLLABLE GGYUH - {0xB044, 0xB044, prLV}, // Lo HANGUL SYLLABLE GGEU - {0xB045, 0xB05F, prLVT}, // Lo [27] HANGUL SYLLABLE GGEUG..HANGUL SYLLABLE GGEUH - {0xB060, 0xB060, prLV}, // Lo HANGUL SYLLABLE GGYI - {0xB061, 0xB07B, prLVT}, // Lo [27] HANGUL SYLLABLE GGYIG..HANGUL SYLLABLE GGYIH - {0xB07C, 0xB07C, prLV}, // Lo HANGUL SYLLABLE GGI - {0xB07D, 0xB097, prLVT}, // Lo [27] HANGUL SYLLABLE GGIG..HANGUL SYLLABLE GGIH - {0xB098, 0xB098, prLV}, // Lo HANGUL SYLLABLE NA - {0xB099, 0xB0B3, prLVT}, // Lo [27] HANGUL SYLLABLE NAG..HANGUL SYLLABLE NAH - {0xB0B4, 0xB0B4, prLV}, // Lo HANGUL SYLLABLE NAE - {0xB0B5, 0xB0CF, prLVT}, // Lo [27] HANGUL SYLLABLE NAEG..HANGUL SYLLABLE NAEH - {0xB0D0, 0xB0D0, prLV}, // Lo HANGUL SYLLABLE NYA - {0xB0D1, 0xB0EB, prLVT}, // Lo [27] HANGUL SYLLABLE NYAG..HANGUL SYLLABLE NYAH - {0xB0EC, 0xB0EC, prLV}, // Lo HANGUL SYLLABLE NYAE - {0xB0ED, 0xB107, prLVT}, // Lo [27] HANGUL SYLLABLE NYAEG..HANGUL SYLLABLE NYAEH - {0xB108, 0xB108, prLV}, // Lo HANGUL SYLLABLE NEO - {0xB109, 0xB123, prLVT}, // Lo [27] HANGUL SYLLABLE NEOG..HANGUL SYLLABLE NEOH - {0xB124, 0xB124, prLV}, // Lo HANGUL SYLLABLE NE - {0xB125, 0xB13F, prLVT}, // Lo [27] HANGUL SYLLABLE NEG..HANGUL SYLLABLE NEH - {0xB140, 0xB140, prLV}, // Lo HANGUL SYLLABLE NYEO - {0xB141, 0xB15B, prLVT}, // Lo [27] HANGUL SYLLABLE NYEOG..HANGUL SYLLABLE NYEOH - {0xB15C, 0xB15C, prLV}, // Lo HANGUL SYLLABLE NYE - {0xB15D, 0xB177, prLVT}, // Lo [27] HANGUL SYLLABLE NYEG..HANGUL SYLLABLE NYEH - {0xB178, 0xB178, prLV}, // Lo HANGUL SYLLABLE NO - {0xB179, 0xB193, prLVT}, // Lo [27] HANGUL SYLLABLE NOG..HANGUL SYLLABLE NOH - {0xB194, 0xB194, prLV}, // Lo HANGUL SYLLABLE NWA - {0xB195, 0xB1AF, prLVT}, // Lo [27] HANGUL SYLLABLE NWAG..HANGUL SYLLABLE NWAH - {0xB1B0, 0xB1B0, prLV}, // Lo HANGUL SYLLABLE NWAE - {0xB1B1, 0xB1CB, prLVT}, // Lo [27] HANGUL SYLLABLE NWAEG..HANGUL SYLLABLE NWAEH - {0xB1CC, 0xB1CC, prLV}, // Lo HANGUL SYLLABLE NOE - {0xB1CD, 0xB1E7, prLVT}, // Lo [27] HANGUL SYLLABLE NOEG..HANGUL SYLLABLE NOEH - {0xB1E8, 0xB1E8, prLV}, // Lo HANGUL SYLLABLE NYO - {0xB1E9, 0xB203, prLVT}, // Lo [27] HANGUL SYLLABLE NYOG..HANGUL SYLLABLE NYOH - {0xB204, 0xB204, prLV}, // Lo HANGUL SYLLABLE NU - {0xB205, 0xB21F, prLVT}, // Lo [27] HANGUL SYLLABLE NUG..HANGUL SYLLABLE NUH - {0xB220, 0xB220, prLV}, // Lo HANGUL SYLLABLE NWEO - {0xB221, 0xB23B, prLVT}, // Lo [27] HANGUL SYLLABLE NWEOG..HANGUL SYLLABLE NWEOH - {0xB23C, 0xB23C, prLV}, // Lo HANGUL SYLLABLE NWE - {0xB23D, 0xB257, prLVT}, // Lo [27] HANGUL SYLLABLE NWEG..HANGUL SYLLABLE NWEH - {0xB258, 0xB258, prLV}, // Lo HANGUL SYLLABLE NWI - {0xB259, 0xB273, prLVT}, // Lo [27] HANGUL SYLLABLE NWIG..HANGUL SYLLABLE NWIH - {0xB274, 0xB274, prLV}, // Lo HANGUL SYLLABLE NYU - {0xB275, 0xB28F, prLVT}, // Lo [27] HANGUL SYLLABLE NYUG..HANGUL SYLLABLE NYUH - {0xB290, 0xB290, prLV}, // Lo HANGUL SYLLABLE NEU - {0xB291, 0xB2AB, prLVT}, // Lo [27] HANGUL SYLLABLE NEUG..HANGUL SYLLABLE NEUH - {0xB2AC, 0xB2AC, prLV}, // Lo HANGUL SYLLABLE NYI - {0xB2AD, 0xB2C7, prLVT}, // Lo [27] HANGUL SYLLABLE NYIG..HANGUL SYLLABLE NYIH - {0xB2C8, 0xB2C8, prLV}, // Lo HANGUL SYLLABLE NI - {0xB2C9, 0xB2E3, prLVT}, // Lo [27] HANGUL SYLLABLE NIG..HANGUL SYLLABLE NIH - {0xB2E4, 0xB2E4, prLV}, // Lo HANGUL SYLLABLE DA - {0xB2E5, 0xB2FF, prLVT}, // Lo [27] HANGUL SYLLABLE DAG..HANGUL SYLLABLE DAH - {0xB300, 0xB300, prLV}, // Lo HANGUL SYLLABLE DAE - {0xB301, 0xB31B, prLVT}, // Lo [27] HANGUL SYLLABLE DAEG..HANGUL SYLLABLE DAEH - {0xB31C, 0xB31C, prLV}, // Lo HANGUL SYLLABLE DYA - {0xB31D, 0xB337, prLVT}, // Lo [27] HANGUL SYLLABLE DYAG..HANGUL SYLLABLE DYAH - {0xB338, 0xB338, prLV}, // Lo HANGUL SYLLABLE DYAE - {0xB339, 0xB353, prLVT}, // Lo [27] HANGUL SYLLABLE DYAEG..HANGUL SYLLABLE DYAEH - {0xB354, 0xB354, prLV}, // Lo HANGUL SYLLABLE DEO - {0xB355, 0xB36F, prLVT}, // Lo [27] HANGUL SYLLABLE DEOG..HANGUL SYLLABLE DEOH - {0xB370, 0xB370, prLV}, // Lo HANGUL SYLLABLE DE - {0xB371, 0xB38B, prLVT}, // Lo [27] HANGUL SYLLABLE DEG..HANGUL SYLLABLE DEH - {0xB38C, 0xB38C, prLV}, // Lo HANGUL SYLLABLE DYEO - {0xB38D, 0xB3A7, prLVT}, // Lo [27] HANGUL SYLLABLE DYEOG..HANGUL SYLLABLE DYEOH - {0xB3A8, 0xB3A8, prLV}, // Lo HANGUL SYLLABLE DYE - {0xB3A9, 0xB3C3, prLVT}, // Lo [27] HANGUL SYLLABLE DYEG..HANGUL SYLLABLE DYEH - {0xB3C4, 0xB3C4, prLV}, // Lo HANGUL SYLLABLE DO - {0xB3C5, 0xB3DF, prLVT}, // Lo [27] HANGUL SYLLABLE DOG..HANGUL SYLLABLE DOH - {0xB3E0, 0xB3E0, prLV}, // Lo HANGUL SYLLABLE DWA - {0xB3E1, 0xB3FB, prLVT}, // Lo [27] HANGUL SYLLABLE DWAG..HANGUL SYLLABLE DWAH - {0xB3FC, 0xB3FC, prLV}, // Lo HANGUL SYLLABLE DWAE - {0xB3FD, 0xB417, prLVT}, // Lo [27] HANGUL SYLLABLE DWAEG..HANGUL SYLLABLE DWAEH - {0xB418, 0xB418, prLV}, // Lo HANGUL SYLLABLE DOE - {0xB419, 0xB433, prLVT}, // Lo [27] HANGUL SYLLABLE DOEG..HANGUL SYLLABLE DOEH - {0xB434, 0xB434, prLV}, // Lo HANGUL SYLLABLE DYO - {0xB435, 0xB44F, prLVT}, // Lo [27] HANGUL SYLLABLE DYOG..HANGUL SYLLABLE DYOH - {0xB450, 0xB450, prLV}, // Lo HANGUL SYLLABLE DU - {0xB451, 0xB46B, prLVT}, // Lo [27] HANGUL SYLLABLE DUG..HANGUL SYLLABLE DUH - {0xB46C, 0xB46C, prLV}, // Lo HANGUL SYLLABLE DWEO - {0xB46D, 0xB487, prLVT}, // Lo [27] HANGUL SYLLABLE DWEOG..HANGUL SYLLABLE DWEOH - {0xB488, 0xB488, prLV}, // Lo HANGUL SYLLABLE DWE - {0xB489, 0xB4A3, prLVT}, // Lo [27] HANGUL SYLLABLE DWEG..HANGUL SYLLABLE DWEH - {0xB4A4, 0xB4A4, prLV}, // Lo HANGUL SYLLABLE DWI - {0xB4A5, 0xB4BF, prLVT}, // Lo [27] HANGUL SYLLABLE DWIG..HANGUL SYLLABLE DWIH - {0xB4C0, 0xB4C0, prLV}, // Lo HANGUL SYLLABLE DYU - {0xB4C1, 0xB4DB, prLVT}, // Lo [27] HANGUL SYLLABLE DYUG..HANGUL SYLLABLE DYUH - {0xB4DC, 0xB4DC, prLV}, // Lo HANGUL SYLLABLE DEU - {0xB4DD, 0xB4F7, prLVT}, // Lo [27] HANGUL SYLLABLE DEUG..HANGUL SYLLABLE DEUH - {0xB4F8, 0xB4F8, prLV}, // Lo HANGUL SYLLABLE DYI - {0xB4F9, 0xB513, prLVT}, // Lo [27] HANGUL SYLLABLE DYIG..HANGUL SYLLABLE DYIH - {0xB514, 0xB514, prLV}, // Lo HANGUL SYLLABLE DI - {0xB515, 0xB52F, prLVT}, // Lo [27] HANGUL SYLLABLE DIG..HANGUL SYLLABLE DIH - {0xB530, 0xB530, prLV}, // Lo HANGUL SYLLABLE DDA - {0xB531, 0xB54B, prLVT}, // Lo [27] HANGUL SYLLABLE DDAG..HANGUL SYLLABLE DDAH - {0xB54C, 0xB54C, prLV}, // Lo HANGUL SYLLABLE DDAE - {0xB54D, 0xB567, prLVT}, // Lo [27] HANGUL SYLLABLE DDAEG..HANGUL SYLLABLE DDAEH - {0xB568, 0xB568, prLV}, // Lo HANGUL SYLLABLE DDYA - {0xB569, 0xB583, prLVT}, // Lo [27] HANGUL SYLLABLE DDYAG..HANGUL SYLLABLE DDYAH - {0xB584, 0xB584, prLV}, // Lo HANGUL SYLLABLE DDYAE - {0xB585, 0xB59F, prLVT}, // Lo [27] HANGUL SYLLABLE DDYAEG..HANGUL SYLLABLE DDYAEH - {0xB5A0, 0xB5A0, prLV}, // Lo HANGUL SYLLABLE DDEO - {0xB5A1, 0xB5BB, prLVT}, // Lo [27] HANGUL SYLLABLE DDEOG..HANGUL SYLLABLE DDEOH - {0xB5BC, 0xB5BC, prLV}, // Lo HANGUL SYLLABLE DDE - {0xB5BD, 0xB5D7, prLVT}, // Lo [27] HANGUL SYLLABLE DDEG..HANGUL SYLLABLE DDEH - {0xB5D8, 0xB5D8, prLV}, // Lo HANGUL SYLLABLE DDYEO - {0xB5D9, 0xB5F3, prLVT}, // Lo [27] HANGUL SYLLABLE DDYEOG..HANGUL SYLLABLE DDYEOH - {0xB5F4, 0xB5F4, prLV}, // Lo HANGUL SYLLABLE DDYE - {0xB5F5, 0xB60F, prLVT}, // Lo [27] HANGUL SYLLABLE DDYEG..HANGUL SYLLABLE DDYEH - {0xB610, 0xB610, prLV}, // Lo HANGUL SYLLABLE DDO - {0xB611, 0xB62B, prLVT}, // Lo [27] HANGUL SYLLABLE DDOG..HANGUL SYLLABLE DDOH - {0xB62C, 0xB62C, prLV}, // Lo HANGUL SYLLABLE DDWA - {0xB62D, 0xB647, prLVT}, // Lo [27] HANGUL SYLLABLE DDWAG..HANGUL SYLLABLE DDWAH - {0xB648, 0xB648, prLV}, // Lo HANGUL SYLLABLE DDWAE - {0xB649, 0xB663, prLVT}, // Lo [27] HANGUL SYLLABLE DDWAEG..HANGUL SYLLABLE DDWAEH - {0xB664, 0xB664, prLV}, // Lo HANGUL SYLLABLE DDOE - {0xB665, 0xB67F, prLVT}, // Lo [27] HANGUL SYLLABLE DDOEG..HANGUL SYLLABLE DDOEH - {0xB680, 0xB680, prLV}, // Lo HANGUL SYLLABLE DDYO - {0xB681, 0xB69B, prLVT}, // Lo [27] HANGUL SYLLABLE DDYOG..HANGUL SYLLABLE DDYOH - {0xB69C, 0xB69C, prLV}, // Lo HANGUL SYLLABLE DDU - {0xB69D, 0xB6B7, prLVT}, // Lo [27] HANGUL SYLLABLE DDUG..HANGUL SYLLABLE DDUH - {0xB6B8, 0xB6B8, prLV}, // Lo HANGUL SYLLABLE DDWEO - {0xB6B9, 0xB6D3, prLVT}, // Lo [27] HANGUL SYLLABLE DDWEOG..HANGUL SYLLABLE DDWEOH - {0xB6D4, 0xB6D4, prLV}, // Lo HANGUL SYLLABLE DDWE - {0xB6D5, 0xB6EF, prLVT}, // Lo [27] HANGUL SYLLABLE DDWEG..HANGUL SYLLABLE DDWEH - {0xB6F0, 0xB6F0, prLV}, // Lo HANGUL SYLLABLE DDWI - {0xB6F1, 0xB70B, prLVT}, // Lo [27] HANGUL SYLLABLE DDWIG..HANGUL SYLLABLE DDWIH - {0xB70C, 0xB70C, prLV}, // Lo HANGUL SYLLABLE DDYU - {0xB70D, 0xB727, prLVT}, // Lo [27] HANGUL SYLLABLE DDYUG..HANGUL SYLLABLE DDYUH - {0xB728, 0xB728, prLV}, // Lo HANGUL SYLLABLE DDEU - {0xB729, 0xB743, prLVT}, // Lo [27] HANGUL SYLLABLE DDEUG..HANGUL SYLLABLE DDEUH - {0xB744, 0xB744, prLV}, // Lo HANGUL SYLLABLE DDYI - {0xB745, 0xB75F, prLVT}, // Lo [27] HANGUL SYLLABLE DDYIG..HANGUL SYLLABLE DDYIH - {0xB760, 0xB760, prLV}, // Lo HANGUL SYLLABLE DDI - {0xB761, 0xB77B, prLVT}, // Lo [27] HANGUL SYLLABLE DDIG..HANGUL SYLLABLE DDIH - {0xB77C, 0xB77C, prLV}, // Lo HANGUL SYLLABLE RA - {0xB77D, 0xB797, prLVT}, // Lo [27] HANGUL SYLLABLE RAG..HANGUL SYLLABLE RAH - {0xB798, 0xB798, prLV}, // Lo HANGUL SYLLABLE RAE - {0xB799, 0xB7B3, prLVT}, // Lo [27] HANGUL SYLLABLE RAEG..HANGUL SYLLABLE RAEH - {0xB7B4, 0xB7B4, prLV}, // Lo HANGUL SYLLABLE RYA - {0xB7B5, 0xB7CF, prLVT}, // Lo [27] HANGUL SYLLABLE RYAG..HANGUL SYLLABLE RYAH - {0xB7D0, 0xB7D0, prLV}, // Lo HANGUL SYLLABLE RYAE - {0xB7D1, 0xB7EB, prLVT}, // Lo [27] HANGUL SYLLABLE RYAEG..HANGUL SYLLABLE RYAEH - {0xB7EC, 0xB7EC, prLV}, // Lo HANGUL SYLLABLE REO - {0xB7ED, 0xB807, prLVT}, // Lo [27] HANGUL SYLLABLE REOG..HANGUL SYLLABLE REOH - {0xB808, 0xB808, prLV}, // Lo HANGUL SYLLABLE RE - {0xB809, 0xB823, prLVT}, // Lo [27] HANGUL SYLLABLE REG..HANGUL SYLLABLE REH - {0xB824, 0xB824, prLV}, // Lo HANGUL SYLLABLE RYEO - {0xB825, 0xB83F, prLVT}, // Lo [27] HANGUL SYLLABLE RYEOG..HANGUL SYLLABLE RYEOH - {0xB840, 0xB840, prLV}, // Lo HANGUL SYLLABLE RYE - {0xB841, 0xB85B, prLVT}, // Lo [27] HANGUL SYLLABLE RYEG..HANGUL SYLLABLE RYEH - {0xB85C, 0xB85C, prLV}, // Lo HANGUL SYLLABLE RO - {0xB85D, 0xB877, prLVT}, // Lo [27] HANGUL SYLLABLE ROG..HANGUL SYLLABLE ROH - {0xB878, 0xB878, prLV}, // Lo HANGUL SYLLABLE RWA - {0xB879, 0xB893, prLVT}, // Lo [27] HANGUL SYLLABLE RWAG..HANGUL SYLLABLE RWAH - {0xB894, 0xB894, prLV}, // Lo HANGUL SYLLABLE RWAE - {0xB895, 0xB8AF, prLVT}, // Lo [27] HANGUL SYLLABLE RWAEG..HANGUL SYLLABLE RWAEH - {0xB8B0, 0xB8B0, prLV}, // Lo HANGUL SYLLABLE ROE - {0xB8B1, 0xB8CB, prLVT}, // Lo [27] HANGUL SYLLABLE ROEG..HANGUL SYLLABLE ROEH - {0xB8CC, 0xB8CC, prLV}, // Lo HANGUL SYLLABLE RYO - {0xB8CD, 0xB8E7, prLVT}, // Lo [27] HANGUL SYLLABLE RYOG..HANGUL SYLLABLE RYOH - {0xB8E8, 0xB8E8, prLV}, // Lo HANGUL SYLLABLE RU - {0xB8E9, 0xB903, prLVT}, // Lo [27] HANGUL SYLLABLE RUG..HANGUL SYLLABLE RUH - {0xB904, 0xB904, prLV}, // Lo HANGUL SYLLABLE RWEO - {0xB905, 0xB91F, prLVT}, // Lo [27] HANGUL SYLLABLE RWEOG..HANGUL SYLLABLE RWEOH - {0xB920, 0xB920, prLV}, // Lo HANGUL SYLLABLE RWE - {0xB921, 0xB93B, prLVT}, // Lo [27] HANGUL SYLLABLE RWEG..HANGUL SYLLABLE RWEH - {0xB93C, 0xB93C, prLV}, // Lo HANGUL SYLLABLE RWI - {0xB93D, 0xB957, prLVT}, // Lo [27] HANGUL SYLLABLE RWIG..HANGUL SYLLABLE RWIH - {0xB958, 0xB958, prLV}, // Lo HANGUL SYLLABLE RYU - {0xB959, 0xB973, prLVT}, // Lo [27] HANGUL SYLLABLE RYUG..HANGUL SYLLABLE RYUH - {0xB974, 0xB974, prLV}, // Lo HANGUL SYLLABLE REU - {0xB975, 0xB98F, prLVT}, // Lo [27] HANGUL SYLLABLE REUG..HANGUL SYLLABLE REUH - {0xB990, 0xB990, prLV}, // Lo HANGUL SYLLABLE RYI - {0xB991, 0xB9AB, prLVT}, // Lo [27] HANGUL SYLLABLE RYIG..HANGUL SYLLABLE RYIH - {0xB9AC, 0xB9AC, prLV}, // Lo HANGUL SYLLABLE RI - {0xB9AD, 0xB9C7, prLVT}, // Lo [27] HANGUL SYLLABLE RIG..HANGUL SYLLABLE RIH - {0xB9C8, 0xB9C8, prLV}, // Lo HANGUL SYLLABLE MA - {0xB9C9, 0xB9E3, prLVT}, // Lo [27] HANGUL SYLLABLE MAG..HANGUL SYLLABLE MAH - {0xB9E4, 0xB9E4, prLV}, // Lo HANGUL SYLLABLE MAE - {0xB9E5, 0xB9FF, prLVT}, // Lo [27] HANGUL SYLLABLE MAEG..HANGUL SYLLABLE MAEH - {0xBA00, 0xBA00, prLV}, // Lo HANGUL SYLLABLE MYA - {0xBA01, 0xBA1B, prLVT}, // Lo [27] HANGUL SYLLABLE MYAG..HANGUL SYLLABLE MYAH - {0xBA1C, 0xBA1C, prLV}, // Lo HANGUL SYLLABLE MYAE - {0xBA1D, 0xBA37, prLVT}, // Lo [27] HANGUL SYLLABLE MYAEG..HANGUL SYLLABLE MYAEH - {0xBA38, 0xBA38, prLV}, // Lo HANGUL SYLLABLE MEO - {0xBA39, 0xBA53, prLVT}, // Lo [27] HANGUL SYLLABLE MEOG..HANGUL SYLLABLE MEOH - {0xBA54, 0xBA54, prLV}, // Lo HANGUL SYLLABLE ME - {0xBA55, 0xBA6F, prLVT}, // Lo [27] HANGUL SYLLABLE MEG..HANGUL SYLLABLE MEH - {0xBA70, 0xBA70, prLV}, // Lo HANGUL SYLLABLE MYEO - {0xBA71, 0xBA8B, prLVT}, // Lo [27] HANGUL SYLLABLE MYEOG..HANGUL SYLLABLE MYEOH - {0xBA8C, 0xBA8C, prLV}, // Lo HANGUL SYLLABLE MYE - {0xBA8D, 0xBAA7, prLVT}, // Lo [27] HANGUL SYLLABLE MYEG..HANGUL SYLLABLE MYEH - {0xBAA8, 0xBAA8, prLV}, // Lo HANGUL SYLLABLE MO - {0xBAA9, 0xBAC3, prLVT}, // Lo [27] HANGUL SYLLABLE MOG..HANGUL SYLLABLE MOH - {0xBAC4, 0xBAC4, prLV}, // Lo HANGUL SYLLABLE MWA - {0xBAC5, 0xBADF, prLVT}, // Lo [27] HANGUL SYLLABLE MWAG..HANGUL SYLLABLE MWAH - {0xBAE0, 0xBAE0, prLV}, // Lo HANGUL SYLLABLE MWAE - {0xBAE1, 0xBAFB, prLVT}, // Lo [27] HANGUL SYLLABLE MWAEG..HANGUL SYLLABLE MWAEH - {0xBAFC, 0xBAFC, prLV}, // Lo HANGUL SYLLABLE MOE - {0xBAFD, 0xBB17, prLVT}, // Lo [27] HANGUL SYLLABLE MOEG..HANGUL SYLLABLE MOEH - {0xBB18, 0xBB18, prLV}, // Lo HANGUL SYLLABLE MYO - {0xBB19, 0xBB33, prLVT}, // Lo [27] HANGUL SYLLABLE MYOG..HANGUL SYLLABLE MYOH - {0xBB34, 0xBB34, prLV}, // Lo HANGUL SYLLABLE MU - {0xBB35, 0xBB4F, prLVT}, // Lo [27] HANGUL SYLLABLE MUG..HANGUL SYLLABLE MUH - {0xBB50, 0xBB50, prLV}, // Lo HANGUL SYLLABLE MWEO - {0xBB51, 0xBB6B, prLVT}, // Lo [27] HANGUL SYLLABLE MWEOG..HANGUL SYLLABLE MWEOH - {0xBB6C, 0xBB6C, prLV}, // Lo HANGUL SYLLABLE MWE - {0xBB6D, 0xBB87, prLVT}, // Lo [27] HANGUL SYLLABLE MWEG..HANGUL SYLLABLE MWEH - {0xBB88, 0xBB88, prLV}, // Lo HANGUL SYLLABLE MWI - {0xBB89, 0xBBA3, prLVT}, // Lo [27] HANGUL SYLLABLE MWIG..HANGUL SYLLABLE MWIH - {0xBBA4, 0xBBA4, prLV}, // Lo HANGUL SYLLABLE MYU - {0xBBA5, 0xBBBF, prLVT}, // Lo [27] HANGUL SYLLABLE MYUG..HANGUL SYLLABLE MYUH - {0xBBC0, 0xBBC0, prLV}, // Lo HANGUL SYLLABLE MEU - {0xBBC1, 0xBBDB, prLVT}, // Lo [27] HANGUL SYLLABLE MEUG..HANGUL SYLLABLE MEUH - {0xBBDC, 0xBBDC, prLV}, // Lo HANGUL SYLLABLE MYI - {0xBBDD, 0xBBF7, prLVT}, // Lo [27] HANGUL SYLLABLE MYIG..HANGUL SYLLABLE MYIH - {0xBBF8, 0xBBF8, prLV}, // Lo HANGUL SYLLABLE MI - {0xBBF9, 0xBC13, prLVT}, // Lo [27] HANGUL SYLLABLE MIG..HANGUL SYLLABLE MIH - {0xBC14, 0xBC14, prLV}, // Lo HANGUL SYLLABLE BA - {0xBC15, 0xBC2F, prLVT}, // Lo [27] HANGUL SYLLABLE BAG..HANGUL SYLLABLE BAH - {0xBC30, 0xBC30, prLV}, // Lo HANGUL SYLLABLE BAE - {0xBC31, 0xBC4B, prLVT}, // Lo [27] HANGUL SYLLABLE BAEG..HANGUL SYLLABLE BAEH - {0xBC4C, 0xBC4C, prLV}, // Lo HANGUL SYLLABLE BYA - {0xBC4D, 0xBC67, prLVT}, // Lo [27] HANGUL SYLLABLE BYAG..HANGUL SYLLABLE BYAH - {0xBC68, 0xBC68, prLV}, // Lo HANGUL SYLLABLE BYAE - {0xBC69, 0xBC83, prLVT}, // Lo [27] HANGUL SYLLABLE BYAEG..HANGUL SYLLABLE BYAEH - {0xBC84, 0xBC84, prLV}, // Lo HANGUL SYLLABLE BEO - {0xBC85, 0xBC9F, prLVT}, // Lo [27] HANGUL SYLLABLE BEOG..HANGUL SYLLABLE BEOH - {0xBCA0, 0xBCA0, prLV}, // Lo HANGUL SYLLABLE BE - {0xBCA1, 0xBCBB, prLVT}, // Lo [27] HANGUL SYLLABLE BEG..HANGUL SYLLABLE BEH - {0xBCBC, 0xBCBC, prLV}, // Lo HANGUL SYLLABLE BYEO - {0xBCBD, 0xBCD7, prLVT}, // Lo [27] HANGUL SYLLABLE BYEOG..HANGUL SYLLABLE BYEOH - {0xBCD8, 0xBCD8, prLV}, // Lo HANGUL SYLLABLE BYE - {0xBCD9, 0xBCF3, prLVT}, // Lo [27] HANGUL SYLLABLE BYEG..HANGUL SYLLABLE BYEH - {0xBCF4, 0xBCF4, prLV}, // Lo HANGUL SYLLABLE BO - {0xBCF5, 0xBD0F, prLVT}, // Lo [27] HANGUL SYLLABLE BOG..HANGUL SYLLABLE BOH - {0xBD10, 0xBD10, prLV}, // Lo HANGUL SYLLABLE BWA - {0xBD11, 0xBD2B, prLVT}, // Lo [27] HANGUL SYLLABLE BWAG..HANGUL SYLLABLE BWAH - {0xBD2C, 0xBD2C, prLV}, // Lo HANGUL SYLLABLE BWAE - {0xBD2D, 0xBD47, prLVT}, // Lo [27] HANGUL SYLLABLE BWAEG..HANGUL SYLLABLE BWAEH - {0xBD48, 0xBD48, prLV}, // Lo HANGUL SYLLABLE BOE - {0xBD49, 0xBD63, prLVT}, // Lo [27] HANGUL SYLLABLE BOEG..HANGUL SYLLABLE BOEH - {0xBD64, 0xBD64, prLV}, // Lo HANGUL SYLLABLE BYO - {0xBD65, 0xBD7F, prLVT}, // Lo [27] HANGUL SYLLABLE BYOG..HANGUL SYLLABLE BYOH - {0xBD80, 0xBD80, prLV}, // Lo HANGUL SYLLABLE BU - {0xBD81, 0xBD9B, prLVT}, // Lo [27] HANGUL SYLLABLE BUG..HANGUL SYLLABLE BUH - {0xBD9C, 0xBD9C, prLV}, // Lo HANGUL SYLLABLE BWEO - {0xBD9D, 0xBDB7, prLVT}, // Lo [27] HANGUL SYLLABLE BWEOG..HANGUL SYLLABLE BWEOH - {0xBDB8, 0xBDB8, prLV}, // Lo HANGUL SYLLABLE BWE - {0xBDB9, 0xBDD3, prLVT}, // Lo [27] HANGUL SYLLABLE BWEG..HANGUL SYLLABLE BWEH - {0xBDD4, 0xBDD4, prLV}, // Lo HANGUL SYLLABLE BWI - {0xBDD5, 0xBDEF, prLVT}, // Lo [27] HANGUL SYLLABLE BWIG..HANGUL SYLLABLE BWIH - {0xBDF0, 0xBDF0, prLV}, // Lo HANGUL SYLLABLE BYU - {0xBDF1, 0xBE0B, prLVT}, // Lo [27] HANGUL SYLLABLE BYUG..HANGUL SYLLABLE BYUH - {0xBE0C, 0xBE0C, prLV}, // Lo HANGUL SYLLABLE BEU - {0xBE0D, 0xBE27, prLVT}, // Lo [27] HANGUL SYLLABLE BEUG..HANGUL SYLLABLE BEUH - {0xBE28, 0xBE28, prLV}, // Lo HANGUL SYLLABLE BYI - {0xBE29, 0xBE43, prLVT}, // Lo [27] HANGUL SYLLABLE BYIG..HANGUL SYLLABLE BYIH - {0xBE44, 0xBE44, prLV}, // Lo HANGUL SYLLABLE BI - {0xBE45, 0xBE5F, prLVT}, // Lo [27] HANGUL SYLLABLE BIG..HANGUL SYLLABLE BIH - {0xBE60, 0xBE60, prLV}, // Lo HANGUL SYLLABLE BBA - {0xBE61, 0xBE7B, prLVT}, // Lo [27] HANGUL SYLLABLE BBAG..HANGUL SYLLABLE BBAH - {0xBE7C, 0xBE7C, prLV}, // Lo HANGUL SYLLABLE BBAE - {0xBE7D, 0xBE97, prLVT}, // Lo [27] HANGUL SYLLABLE BBAEG..HANGUL SYLLABLE BBAEH - {0xBE98, 0xBE98, prLV}, // Lo HANGUL SYLLABLE BBYA - {0xBE99, 0xBEB3, prLVT}, // Lo [27] HANGUL SYLLABLE BBYAG..HANGUL SYLLABLE BBYAH - {0xBEB4, 0xBEB4, prLV}, // Lo HANGUL SYLLABLE BBYAE - {0xBEB5, 0xBECF, prLVT}, // Lo [27] HANGUL SYLLABLE BBYAEG..HANGUL SYLLABLE BBYAEH - {0xBED0, 0xBED0, prLV}, // Lo HANGUL SYLLABLE BBEO - {0xBED1, 0xBEEB, prLVT}, // Lo [27] HANGUL SYLLABLE BBEOG..HANGUL SYLLABLE BBEOH - {0xBEEC, 0xBEEC, prLV}, // Lo HANGUL SYLLABLE BBE - {0xBEED, 0xBF07, prLVT}, // Lo [27] HANGUL SYLLABLE BBEG..HANGUL SYLLABLE BBEH - {0xBF08, 0xBF08, prLV}, // Lo HANGUL SYLLABLE BBYEO - {0xBF09, 0xBF23, prLVT}, // Lo [27] HANGUL SYLLABLE BBYEOG..HANGUL SYLLABLE BBYEOH - {0xBF24, 0xBF24, prLV}, // Lo HANGUL SYLLABLE BBYE - {0xBF25, 0xBF3F, prLVT}, // Lo [27] HANGUL SYLLABLE BBYEG..HANGUL SYLLABLE BBYEH - {0xBF40, 0xBF40, prLV}, // Lo HANGUL SYLLABLE BBO - {0xBF41, 0xBF5B, prLVT}, // Lo [27] HANGUL SYLLABLE BBOG..HANGUL SYLLABLE BBOH - {0xBF5C, 0xBF5C, prLV}, // Lo HANGUL SYLLABLE BBWA - {0xBF5D, 0xBF77, prLVT}, // Lo [27] HANGUL SYLLABLE BBWAG..HANGUL SYLLABLE BBWAH - {0xBF78, 0xBF78, prLV}, // Lo HANGUL SYLLABLE BBWAE - {0xBF79, 0xBF93, prLVT}, // Lo [27] HANGUL SYLLABLE BBWAEG..HANGUL SYLLABLE BBWAEH - {0xBF94, 0xBF94, prLV}, // Lo HANGUL SYLLABLE BBOE - {0xBF95, 0xBFAF, prLVT}, // Lo [27] HANGUL SYLLABLE BBOEG..HANGUL SYLLABLE BBOEH - {0xBFB0, 0xBFB0, prLV}, // Lo HANGUL SYLLABLE BBYO - {0xBFB1, 0xBFCB, prLVT}, // Lo [27] HANGUL SYLLABLE BBYOG..HANGUL SYLLABLE BBYOH - {0xBFCC, 0xBFCC, prLV}, // Lo HANGUL SYLLABLE BBU - {0xBFCD, 0xBFE7, prLVT}, // Lo [27] HANGUL SYLLABLE BBUG..HANGUL SYLLABLE BBUH - {0xBFE8, 0xBFE8, prLV}, // Lo HANGUL SYLLABLE BBWEO - {0xBFE9, 0xC003, prLVT}, // Lo [27] HANGUL SYLLABLE BBWEOG..HANGUL SYLLABLE BBWEOH - {0xC004, 0xC004, prLV}, // Lo HANGUL SYLLABLE BBWE - {0xC005, 0xC01F, prLVT}, // Lo [27] HANGUL SYLLABLE BBWEG..HANGUL SYLLABLE BBWEH - {0xC020, 0xC020, prLV}, // Lo HANGUL SYLLABLE BBWI - {0xC021, 0xC03B, prLVT}, // Lo [27] HANGUL SYLLABLE BBWIG..HANGUL SYLLABLE BBWIH - {0xC03C, 0xC03C, prLV}, // Lo HANGUL SYLLABLE BBYU - {0xC03D, 0xC057, prLVT}, // Lo [27] HANGUL SYLLABLE BBYUG..HANGUL SYLLABLE BBYUH - {0xC058, 0xC058, prLV}, // Lo HANGUL SYLLABLE BBEU - {0xC059, 0xC073, prLVT}, // Lo [27] HANGUL SYLLABLE BBEUG..HANGUL SYLLABLE BBEUH - {0xC074, 0xC074, prLV}, // Lo HANGUL SYLLABLE BBYI - {0xC075, 0xC08F, prLVT}, // Lo [27] HANGUL SYLLABLE BBYIG..HANGUL SYLLABLE BBYIH - {0xC090, 0xC090, prLV}, // Lo HANGUL SYLLABLE BBI - {0xC091, 0xC0AB, prLVT}, // Lo [27] HANGUL SYLLABLE BBIG..HANGUL SYLLABLE BBIH - {0xC0AC, 0xC0AC, prLV}, // Lo HANGUL SYLLABLE SA - {0xC0AD, 0xC0C7, prLVT}, // Lo [27] HANGUL SYLLABLE SAG..HANGUL SYLLABLE SAH - {0xC0C8, 0xC0C8, prLV}, // Lo HANGUL SYLLABLE SAE - {0xC0C9, 0xC0E3, prLVT}, // Lo [27] HANGUL SYLLABLE SAEG..HANGUL SYLLABLE SAEH - {0xC0E4, 0xC0E4, prLV}, // Lo HANGUL SYLLABLE SYA - {0xC0E5, 0xC0FF, prLVT}, // Lo [27] HANGUL SYLLABLE SYAG..HANGUL SYLLABLE SYAH - {0xC100, 0xC100, prLV}, // Lo HANGUL SYLLABLE SYAE - {0xC101, 0xC11B, prLVT}, // Lo [27] HANGUL SYLLABLE SYAEG..HANGUL SYLLABLE SYAEH - {0xC11C, 0xC11C, prLV}, // Lo HANGUL SYLLABLE SEO - {0xC11D, 0xC137, prLVT}, // Lo [27] HANGUL SYLLABLE SEOG..HANGUL SYLLABLE SEOH - {0xC138, 0xC138, prLV}, // Lo HANGUL SYLLABLE SE - {0xC139, 0xC153, prLVT}, // Lo [27] HANGUL SYLLABLE SEG..HANGUL SYLLABLE SEH - {0xC154, 0xC154, prLV}, // Lo HANGUL SYLLABLE SYEO - {0xC155, 0xC16F, prLVT}, // Lo [27] HANGUL SYLLABLE SYEOG..HANGUL SYLLABLE SYEOH - {0xC170, 0xC170, prLV}, // Lo HANGUL SYLLABLE SYE - {0xC171, 0xC18B, prLVT}, // Lo [27] HANGUL SYLLABLE SYEG..HANGUL SYLLABLE SYEH - {0xC18C, 0xC18C, prLV}, // Lo HANGUL SYLLABLE SO - {0xC18D, 0xC1A7, prLVT}, // Lo [27] HANGUL SYLLABLE SOG..HANGUL SYLLABLE SOH - {0xC1A8, 0xC1A8, prLV}, // Lo HANGUL SYLLABLE SWA - {0xC1A9, 0xC1C3, prLVT}, // Lo [27] HANGUL SYLLABLE SWAG..HANGUL SYLLABLE SWAH - {0xC1C4, 0xC1C4, prLV}, // Lo HANGUL SYLLABLE SWAE - {0xC1C5, 0xC1DF, prLVT}, // Lo [27] HANGUL SYLLABLE SWAEG..HANGUL SYLLABLE SWAEH - {0xC1E0, 0xC1E0, prLV}, // Lo HANGUL SYLLABLE SOE - {0xC1E1, 0xC1FB, prLVT}, // Lo [27] HANGUL SYLLABLE SOEG..HANGUL SYLLABLE SOEH - {0xC1FC, 0xC1FC, prLV}, // Lo HANGUL SYLLABLE SYO - {0xC1FD, 0xC217, prLVT}, // Lo [27] HANGUL SYLLABLE SYOG..HANGUL SYLLABLE SYOH - {0xC218, 0xC218, prLV}, // Lo HANGUL SYLLABLE SU - {0xC219, 0xC233, prLVT}, // Lo [27] HANGUL SYLLABLE SUG..HANGUL SYLLABLE SUH - {0xC234, 0xC234, prLV}, // Lo HANGUL SYLLABLE SWEO - {0xC235, 0xC24F, prLVT}, // Lo [27] HANGUL SYLLABLE SWEOG..HANGUL SYLLABLE SWEOH - {0xC250, 0xC250, prLV}, // Lo HANGUL SYLLABLE SWE - {0xC251, 0xC26B, prLVT}, // Lo [27] HANGUL SYLLABLE SWEG..HANGUL SYLLABLE SWEH - {0xC26C, 0xC26C, prLV}, // Lo HANGUL SYLLABLE SWI - {0xC26D, 0xC287, prLVT}, // Lo [27] HANGUL SYLLABLE SWIG..HANGUL SYLLABLE SWIH - {0xC288, 0xC288, prLV}, // Lo HANGUL SYLLABLE SYU - {0xC289, 0xC2A3, prLVT}, // Lo [27] HANGUL SYLLABLE SYUG..HANGUL SYLLABLE SYUH - {0xC2A4, 0xC2A4, prLV}, // Lo HANGUL SYLLABLE SEU - {0xC2A5, 0xC2BF, prLVT}, // Lo [27] HANGUL SYLLABLE SEUG..HANGUL SYLLABLE SEUH - {0xC2C0, 0xC2C0, prLV}, // Lo HANGUL SYLLABLE SYI - {0xC2C1, 0xC2DB, prLVT}, // Lo [27] HANGUL SYLLABLE SYIG..HANGUL SYLLABLE SYIH - {0xC2DC, 0xC2DC, prLV}, // Lo HANGUL SYLLABLE SI - {0xC2DD, 0xC2F7, prLVT}, // Lo [27] HANGUL SYLLABLE SIG..HANGUL SYLLABLE SIH - {0xC2F8, 0xC2F8, prLV}, // Lo HANGUL SYLLABLE SSA - {0xC2F9, 0xC313, prLVT}, // Lo [27] HANGUL SYLLABLE SSAG..HANGUL SYLLABLE SSAH - {0xC314, 0xC314, prLV}, // Lo HANGUL SYLLABLE SSAE - {0xC315, 0xC32F, prLVT}, // Lo [27] HANGUL SYLLABLE SSAEG..HANGUL SYLLABLE SSAEH - {0xC330, 0xC330, prLV}, // Lo HANGUL SYLLABLE SSYA - {0xC331, 0xC34B, prLVT}, // Lo [27] HANGUL SYLLABLE SSYAG..HANGUL SYLLABLE SSYAH - {0xC34C, 0xC34C, prLV}, // Lo HANGUL SYLLABLE SSYAE - {0xC34D, 0xC367, prLVT}, // Lo [27] HANGUL SYLLABLE SSYAEG..HANGUL SYLLABLE SSYAEH - {0xC368, 0xC368, prLV}, // Lo HANGUL SYLLABLE SSEO - {0xC369, 0xC383, prLVT}, // Lo [27] HANGUL SYLLABLE SSEOG..HANGUL SYLLABLE SSEOH - {0xC384, 0xC384, prLV}, // Lo HANGUL SYLLABLE SSE - {0xC385, 0xC39F, prLVT}, // Lo [27] HANGUL SYLLABLE SSEG..HANGUL SYLLABLE SSEH - {0xC3A0, 0xC3A0, prLV}, // Lo HANGUL SYLLABLE SSYEO - {0xC3A1, 0xC3BB, prLVT}, // Lo [27] HANGUL SYLLABLE SSYEOG..HANGUL SYLLABLE SSYEOH - {0xC3BC, 0xC3BC, prLV}, // Lo HANGUL SYLLABLE SSYE - {0xC3BD, 0xC3D7, prLVT}, // Lo [27] HANGUL SYLLABLE SSYEG..HANGUL SYLLABLE SSYEH - {0xC3D8, 0xC3D8, prLV}, // Lo HANGUL SYLLABLE SSO - {0xC3D9, 0xC3F3, prLVT}, // Lo [27] HANGUL SYLLABLE SSOG..HANGUL SYLLABLE SSOH - {0xC3F4, 0xC3F4, prLV}, // Lo HANGUL SYLLABLE SSWA - {0xC3F5, 0xC40F, prLVT}, // Lo [27] HANGUL SYLLABLE SSWAG..HANGUL SYLLABLE SSWAH - {0xC410, 0xC410, prLV}, // Lo HANGUL SYLLABLE SSWAE - {0xC411, 0xC42B, prLVT}, // Lo [27] HANGUL SYLLABLE SSWAEG..HANGUL SYLLABLE SSWAEH - {0xC42C, 0xC42C, prLV}, // Lo HANGUL SYLLABLE SSOE - {0xC42D, 0xC447, prLVT}, // Lo [27] HANGUL SYLLABLE SSOEG..HANGUL SYLLABLE SSOEH - {0xC448, 0xC448, prLV}, // Lo HANGUL SYLLABLE SSYO - {0xC449, 0xC463, prLVT}, // Lo [27] HANGUL SYLLABLE SSYOG..HANGUL SYLLABLE SSYOH - {0xC464, 0xC464, prLV}, // Lo HANGUL SYLLABLE SSU - {0xC465, 0xC47F, prLVT}, // Lo [27] HANGUL SYLLABLE SSUG..HANGUL SYLLABLE SSUH - {0xC480, 0xC480, prLV}, // Lo HANGUL SYLLABLE SSWEO - {0xC481, 0xC49B, prLVT}, // Lo [27] HANGUL SYLLABLE SSWEOG..HANGUL SYLLABLE SSWEOH - {0xC49C, 0xC49C, prLV}, // Lo HANGUL SYLLABLE SSWE - {0xC49D, 0xC4B7, prLVT}, // Lo [27] HANGUL SYLLABLE SSWEG..HANGUL SYLLABLE SSWEH - {0xC4B8, 0xC4B8, prLV}, // Lo HANGUL SYLLABLE SSWI - {0xC4B9, 0xC4D3, prLVT}, // Lo [27] HANGUL SYLLABLE SSWIG..HANGUL SYLLABLE SSWIH - {0xC4D4, 0xC4D4, prLV}, // Lo HANGUL SYLLABLE SSYU - {0xC4D5, 0xC4EF, prLVT}, // Lo [27] HANGUL SYLLABLE SSYUG..HANGUL SYLLABLE SSYUH - {0xC4F0, 0xC4F0, prLV}, // Lo HANGUL SYLLABLE SSEU - {0xC4F1, 0xC50B, prLVT}, // Lo [27] HANGUL SYLLABLE SSEUG..HANGUL SYLLABLE SSEUH - {0xC50C, 0xC50C, prLV}, // Lo HANGUL SYLLABLE SSYI - {0xC50D, 0xC527, prLVT}, // Lo [27] HANGUL SYLLABLE SSYIG..HANGUL SYLLABLE SSYIH - {0xC528, 0xC528, prLV}, // Lo HANGUL SYLLABLE SSI - {0xC529, 0xC543, prLVT}, // Lo [27] HANGUL SYLLABLE SSIG..HANGUL SYLLABLE SSIH - {0xC544, 0xC544, prLV}, // Lo HANGUL SYLLABLE A - {0xC545, 0xC55F, prLVT}, // Lo [27] HANGUL SYLLABLE AG..HANGUL SYLLABLE AH - {0xC560, 0xC560, prLV}, // Lo HANGUL SYLLABLE AE - {0xC561, 0xC57B, prLVT}, // Lo [27] HANGUL SYLLABLE AEG..HANGUL SYLLABLE AEH - {0xC57C, 0xC57C, prLV}, // Lo HANGUL SYLLABLE YA - {0xC57D, 0xC597, prLVT}, // Lo [27] HANGUL SYLLABLE YAG..HANGUL SYLLABLE YAH - {0xC598, 0xC598, prLV}, // Lo HANGUL SYLLABLE YAE - {0xC599, 0xC5B3, prLVT}, // Lo [27] HANGUL SYLLABLE YAEG..HANGUL SYLLABLE YAEH - {0xC5B4, 0xC5B4, prLV}, // Lo HANGUL SYLLABLE EO - {0xC5B5, 0xC5CF, prLVT}, // Lo [27] HANGUL SYLLABLE EOG..HANGUL SYLLABLE EOH - {0xC5D0, 0xC5D0, prLV}, // Lo HANGUL SYLLABLE E - {0xC5D1, 0xC5EB, prLVT}, // Lo [27] HANGUL SYLLABLE EG..HANGUL SYLLABLE EH - {0xC5EC, 0xC5EC, prLV}, // Lo HANGUL SYLLABLE YEO - {0xC5ED, 0xC607, prLVT}, // Lo [27] HANGUL SYLLABLE YEOG..HANGUL SYLLABLE YEOH - {0xC608, 0xC608, prLV}, // Lo HANGUL SYLLABLE YE - {0xC609, 0xC623, prLVT}, // Lo [27] HANGUL SYLLABLE YEG..HANGUL SYLLABLE YEH - {0xC624, 0xC624, prLV}, // Lo HANGUL SYLLABLE O - {0xC625, 0xC63F, prLVT}, // Lo [27] HANGUL SYLLABLE OG..HANGUL SYLLABLE OH - {0xC640, 0xC640, prLV}, // Lo HANGUL SYLLABLE WA - {0xC641, 0xC65B, prLVT}, // Lo [27] HANGUL SYLLABLE WAG..HANGUL SYLLABLE WAH - {0xC65C, 0xC65C, prLV}, // Lo HANGUL SYLLABLE WAE - {0xC65D, 0xC677, prLVT}, // Lo [27] HANGUL SYLLABLE WAEG..HANGUL SYLLABLE WAEH - {0xC678, 0xC678, prLV}, // Lo HANGUL SYLLABLE OE - {0xC679, 0xC693, prLVT}, // Lo [27] HANGUL SYLLABLE OEG..HANGUL SYLLABLE OEH - {0xC694, 0xC694, prLV}, // Lo HANGUL SYLLABLE YO - {0xC695, 0xC6AF, prLVT}, // Lo [27] HANGUL SYLLABLE YOG..HANGUL SYLLABLE YOH - {0xC6B0, 0xC6B0, prLV}, // Lo HANGUL SYLLABLE U - {0xC6B1, 0xC6CB, prLVT}, // Lo [27] HANGUL SYLLABLE UG..HANGUL SYLLABLE UH - {0xC6CC, 0xC6CC, prLV}, // Lo HANGUL SYLLABLE WEO - {0xC6CD, 0xC6E7, prLVT}, // Lo [27] HANGUL SYLLABLE WEOG..HANGUL SYLLABLE WEOH - {0xC6E8, 0xC6E8, prLV}, // Lo HANGUL SYLLABLE WE - {0xC6E9, 0xC703, prLVT}, // Lo [27] HANGUL SYLLABLE WEG..HANGUL SYLLABLE WEH - {0xC704, 0xC704, prLV}, // Lo HANGUL SYLLABLE WI - {0xC705, 0xC71F, prLVT}, // Lo [27] HANGUL SYLLABLE WIG..HANGUL SYLLABLE WIH - {0xC720, 0xC720, prLV}, // Lo HANGUL SYLLABLE YU - {0xC721, 0xC73B, prLVT}, // Lo [27] HANGUL SYLLABLE YUG..HANGUL SYLLABLE YUH - {0xC73C, 0xC73C, prLV}, // Lo HANGUL SYLLABLE EU - {0xC73D, 0xC757, prLVT}, // Lo [27] HANGUL SYLLABLE EUG..HANGUL SYLLABLE EUH - {0xC758, 0xC758, prLV}, // Lo HANGUL SYLLABLE YI - {0xC759, 0xC773, prLVT}, // Lo [27] HANGUL SYLLABLE YIG..HANGUL SYLLABLE YIH - {0xC774, 0xC774, prLV}, // Lo HANGUL SYLLABLE I - {0xC775, 0xC78F, prLVT}, // Lo [27] HANGUL SYLLABLE IG..HANGUL SYLLABLE IH - {0xC790, 0xC790, prLV}, // Lo HANGUL SYLLABLE JA - {0xC791, 0xC7AB, prLVT}, // Lo [27] HANGUL SYLLABLE JAG..HANGUL SYLLABLE JAH - {0xC7AC, 0xC7AC, prLV}, // Lo HANGUL SYLLABLE JAE - {0xC7AD, 0xC7C7, prLVT}, // Lo [27] HANGUL SYLLABLE JAEG..HANGUL SYLLABLE JAEH - {0xC7C8, 0xC7C8, prLV}, // Lo HANGUL SYLLABLE JYA - {0xC7C9, 0xC7E3, prLVT}, // Lo [27] HANGUL SYLLABLE JYAG..HANGUL SYLLABLE JYAH - {0xC7E4, 0xC7E4, prLV}, // Lo HANGUL SYLLABLE JYAE - {0xC7E5, 0xC7FF, prLVT}, // Lo [27] HANGUL SYLLABLE JYAEG..HANGUL SYLLABLE JYAEH - {0xC800, 0xC800, prLV}, // Lo HANGUL SYLLABLE JEO - {0xC801, 0xC81B, prLVT}, // Lo [27] HANGUL SYLLABLE JEOG..HANGUL SYLLABLE JEOH - {0xC81C, 0xC81C, prLV}, // Lo HANGUL SYLLABLE JE - {0xC81D, 0xC837, prLVT}, // Lo [27] HANGUL SYLLABLE JEG..HANGUL SYLLABLE JEH - {0xC838, 0xC838, prLV}, // Lo HANGUL SYLLABLE JYEO - {0xC839, 0xC853, prLVT}, // Lo [27] HANGUL SYLLABLE JYEOG..HANGUL SYLLABLE JYEOH - {0xC854, 0xC854, prLV}, // Lo HANGUL SYLLABLE JYE - {0xC855, 0xC86F, prLVT}, // Lo [27] HANGUL SYLLABLE JYEG..HANGUL SYLLABLE JYEH - {0xC870, 0xC870, prLV}, // Lo HANGUL SYLLABLE JO - {0xC871, 0xC88B, prLVT}, // Lo [27] HANGUL SYLLABLE JOG..HANGUL SYLLABLE JOH - {0xC88C, 0xC88C, prLV}, // Lo HANGUL SYLLABLE JWA - {0xC88D, 0xC8A7, prLVT}, // Lo [27] HANGUL SYLLABLE JWAG..HANGUL SYLLABLE JWAH - {0xC8A8, 0xC8A8, prLV}, // Lo HANGUL SYLLABLE JWAE - {0xC8A9, 0xC8C3, prLVT}, // Lo [27] HANGUL SYLLABLE JWAEG..HANGUL SYLLABLE JWAEH - {0xC8C4, 0xC8C4, prLV}, // Lo HANGUL SYLLABLE JOE - {0xC8C5, 0xC8DF, prLVT}, // Lo [27] HANGUL SYLLABLE JOEG..HANGUL SYLLABLE JOEH - {0xC8E0, 0xC8E0, prLV}, // Lo HANGUL SYLLABLE JYO - {0xC8E1, 0xC8FB, prLVT}, // Lo [27] HANGUL SYLLABLE JYOG..HANGUL SYLLABLE JYOH - {0xC8FC, 0xC8FC, prLV}, // Lo HANGUL SYLLABLE JU - {0xC8FD, 0xC917, prLVT}, // Lo [27] HANGUL SYLLABLE JUG..HANGUL SYLLABLE JUH - {0xC918, 0xC918, prLV}, // Lo HANGUL SYLLABLE JWEO - {0xC919, 0xC933, prLVT}, // Lo [27] HANGUL SYLLABLE JWEOG..HANGUL SYLLABLE JWEOH - {0xC934, 0xC934, prLV}, // Lo HANGUL SYLLABLE JWE - {0xC935, 0xC94F, prLVT}, // Lo [27] HANGUL SYLLABLE JWEG..HANGUL SYLLABLE JWEH - {0xC950, 0xC950, prLV}, // Lo HANGUL SYLLABLE JWI - {0xC951, 0xC96B, prLVT}, // Lo [27] HANGUL SYLLABLE JWIG..HANGUL SYLLABLE JWIH - {0xC96C, 0xC96C, prLV}, // Lo HANGUL SYLLABLE JYU - {0xC96D, 0xC987, prLVT}, // Lo [27] HANGUL SYLLABLE JYUG..HANGUL SYLLABLE JYUH - {0xC988, 0xC988, prLV}, // Lo HANGUL SYLLABLE JEU - {0xC989, 0xC9A3, prLVT}, // Lo [27] HANGUL SYLLABLE JEUG..HANGUL SYLLABLE JEUH - {0xC9A4, 0xC9A4, prLV}, // Lo HANGUL SYLLABLE JYI - {0xC9A5, 0xC9BF, prLVT}, // Lo [27] HANGUL SYLLABLE JYIG..HANGUL SYLLABLE JYIH - {0xC9C0, 0xC9C0, prLV}, // Lo HANGUL SYLLABLE JI - {0xC9C1, 0xC9DB, prLVT}, // Lo [27] HANGUL SYLLABLE JIG..HANGUL SYLLABLE JIH - {0xC9DC, 0xC9DC, prLV}, // Lo HANGUL SYLLABLE JJA - {0xC9DD, 0xC9F7, prLVT}, // Lo [27] HANGUL SYLLABLE JJAG..HANGUL SYLLABLE JJAH - {0xC9F8, 0xC9F8, prLV}, // Lo HANGUL SYLLABLE JJAE - {0xC9F9, 0xCA13, prLVT}, // Lo [27] HANGUL SYLLABLE JJAEG..HANGUL SYLLABLE JJAEH - {0xCA14, 0xCA14, prLV}, // Lo HANGUL SYLLABLE JJYA - {0xCA15, 0xCA2F, prLVT}, // Lo [27] HANGUL SYLLABLE JJYAG..HANGUL SYLLABLE JJYAH - {0xCA30, 0xCA30, prLV}, // Lo HANGUL SYLLABLE JJYAE - {0xCA31, 0xCA4B, prLVT}, // Lo [27] HANGUL SYLLABLE JJYAEG..HANGUL SYLLABLE JJYAEH - {0xCA4C, 0xCA4C, prLV}, // Lo HANGUL SYLLABLE JJEO - {0xCA4D, 0xCA67, prLVT}, // Lo [27] HANGUL SYLLABLE JJEOG..HANGUL SYLLABLE JJEOH - {0xCA68, 0xCA68, prLV}, // Lo HANGUL SYLLABLE JJE - {0xCA69, 0xCA83, prLVT}, // Lo [27] HANGUL SYLLABLE JJEG..HANGUL SYLLABLE JJEH - {0xCA84, 0xCA84, prLV}, // Lo HANGUL SYLLABLE JJYEO - {0xCA85, 0xCA9F, prLVT}, // Lo [27] HANGUL SYLLABLE JJYEOG..HANGUL SYLLABLE JJYEOH - {0xCAA0, 0xCAA0, prLV}, // Lo HANGUL SYLLABLE JJYE - {0xCAA1, 0xCABB, prLVT}, // Lo [27] HANGUL SYLLABLE JJYEG..HANGUL SYLLABLE JJYEH - {0xCABC, 0xCABC, prLV}, // Lo HANGUL SYLLABLE JJO - {0xCABD, 0xCAD7, prLVT}, // Lo [27] HANGUL SYLLABLE JJOG..HANGUL SYLLABLE JJOH - {0xCAD8, 0xCAD8, prLV}, // Lo HANGUL SYLLABLE JJWA - {0xCAD9, 0xCAF3, prLVT}, // Lo [27] HANGUL SYLLABLE JJWAG..HANGUL SYLLABLE JJWAH - {0xCAF4, 0xCAF4, prLV}, // Lo HANGUL SYLLABLE JJWAE - {0xCAF5, 0xCB0F, prLVT}, // Lo [27] HANGUL SYLLABLE JJWAEG..HANGUL SYLLABLE JJWAEH - {0xCB10, 0xCB10, prLV}, // Lo HANGUL SYLLABLE JJOE - {0xCB11, 0xCB2B, prLVT}, // Lo [27] HANGUL SYLLABLE JJOEG..HANGUL SYLLABLE JJOEH - {0xCB2C, 0xCB2C, prLV}, // Lo HANGUL SYLLABLE JJYO - {0xCB2D, 0xCB47, prLVT}, // Lo [27] HANGUL SYLLABLE JJYOG..HANGUL SYLLABLE JJYOH - {0xCB48, 0xCB48, prLV}, // Lo HANGUL SYLLABLE JJU - {0xCB49, 0xCB63, prLVT}, // Lo [27] HANGUL SYLLABLE JJUG..HANGUL SYLLABLE JJUH - {0xCB64, 0xCB64, prLV}, // Lo HANGUL SYLLABLE JJWEO - {0xCB65, 0xCB7F, prLVT}, // Lo [27] HANGUL SYLLABLE JJWEOG..HANGUL SYLLABLE JJWEOH - {0xCB80, 0xCB80, prLV}, // Lo HANGUL SYLLABLE JJWE - {0xCB81, 0xCB9B, prLVT}, // Lo [27] HANGUL SYLLABLE JJWEG..HANGUL SYLLABLE JJWEH - {0xCB9C, 0xCB9C, prLV}, // Lo HANGUL SYLLABLE JJWI - {0xCB9D, 0xCBB7, prLVT}, // Lo [27] HANGUL SYLLABLE JJWIG..HANGUL SYLLABLE JJWIH - {0xCBB8, 0xCBB8, prLV}, // Lo HANGUL SYLLABLE JJYU - {0xCBB9, 0xCBD3, prLVT}, // Lo [27] HANGUL SYLLABLE JJYUG..HANGUL SYLLABLE JJYUH - {0xCBD4, 0xCBD4, prLV}, // Lo HANGUL SYLLABLE JJEU - {0xCBD5, 0xCBEF, prLVT}, // Lo [27] HANGUL SYLLABLE JJEUG..HANGUL SYLLABLE JJEUH - {0xCBF0, 0xCBF0, prLV}, // Lo HANGUL SYLLABLE JJYI - {0xCBF1, 0xCC0B, prLVT}, // Lo [27] HANGUL SYLLABLE JJYIG..HANGUL SYLLABLE JJYIH - {0xCC0C, 0xCC0C, prLV}, // Lo HANGUL SYLLABLE JJI - {0xCC0D, 0xCC27, prLVT}, // Lo [27] HANGUL SYLLABLE JJIG..HANGUL SYLLABLE JJIH - {0xCC28, 0xCC28, prLV}, // Lo HANGUL SYLLABLE CA - {0xCC29, 0xCC43, prLVT}, // Lo [27] HANGUL SYLLABLE CAG..HANGUL SYLLABLE CAH - {0xCC44, 0xCC44, prLV}, // Lo HANGUL SYLLABLE CAE - {0xCC45, 0xCC5F, prLVT}, // Lo [27] HANGUL SYLLABLE CAEG..HANGUL SYLLABLE CAEH - {0xCC60, 0xCC60, prLV}, // Lo HANGUL SYLLABLE CYA - {0xCC61, 0xCC7B, prLVT}, // Lo [27] HANGUL SYLLABLE CYAG..HANGUL SYLLABLE CYAH - {0xCC7C, 0xCC7C, prLV}, // Lo HANGUL SYLLABLE CYAE - {0xCC7D, 0xCC97, prLVT}, // Lo [27] HANGUL SYLLABLE CYAEG..HANGUL SYLLABLE CYAEH - {0xCC98, 0xCC98, prLV}, // Lo HANGUL SYLLABLE CEO - {0xCC99, 0xCCB3, prLVT}, // Lo [27] HANGUL SYLLABLE CEOG..HANGUL SYLLABLE CEOH - {0xCCB4, 0xCCB4, prLV}, // Lo HANGUL SYLLABLE CE - {0xCCB5, 0xCCCF, prLVT}, // Lo [27] HANGUL SYLLABLE CEG..HANGUL SYLLABLE CEH - {0xCCD0, 0xCCD0, prLV}, // Lo HANGUL SYLLABLE CYEO - {0xCCD1, 0xCCEB, prLVT}, // Lo [27] HANGUL SYLLABLE CYEOG..HANGUL SYLLABLE CYEOH - {0xCCEC, 0xCCEC, prLV}, // Lo HANGUL SYLLABLE CYE - {0xCCED, 0xCD07, prLVT}, // Lo [27] HANGUL SYLLABLE CYEG..HANGUL SYLLABLE CYEH - {0xCD08, 0xCD08, prLV}, // Lo HANGUL SYLLABLE CO - {0xCD09, 0xCD23, prLVT}, // Lo [27] HANGUL SYLLABLE COG..HANGUL SYLLABLE COH - {0xCD24, 0xCD24, prLV}, // Lo HANGUL SYLLABLE CWA - {0xCD25, 0xCD3F, prLVT}, // Lo [27] HANGUL SYLLABLE CWAG..HANGUL SYLLABLE CWAH - {0xCD40, 0xCD40, prLV}, // Lo HANGUL SYLLABLE CWAE - {0xCD41, 0xCD5B, prLVT}, // Lo [27] HANGUL SYLLABLE CWAEG..HANGUL SYLLABLE CWAEH - {0xCD5C, 0xCD5C, prLV}, // Lo HANGUL SYLLABLE COE - {0xCD5D, 0xCD77, prLVT}, // Lo [27] HANGUL SYLLABLE COEG..HANGUL SYLLABLE COEH - {0xCD78, 0xCD78, prLV}, // Lo HANGUL SYLLABLE CYO - {0xCD79, 0xCD93, prLVT}, // Lo [27] HANGUL SYLLABLE CYOG..HANGUL SYLLABLE CYOH - {0xCD94, 0xCD94, prLV}, // Lo HANGUL SYLLABLE CU - {0xCD95, 0xCDAF, prLVT}, // Lo [27] HANGUL SYLLABLE CUG..HANGUL SYLLABLE CUH - {0xCDB0, 0xCDB0, prLV}, // Lo HANGUL SYLLABLE CWEO - {0xCDB1, 0xCDCB, prLVT}, // Lo [27] HANGUL SYLLABLE CWEOG..HANGUL SYLLABLE CWEOH - {0xCDCC, 0xCDCC, prLV}, // Lo HANGUL SYLLABLE CWE - {0xCDCD, 0xCDE7, prLVT}, // Lo [27] HANGUL SYLLABLE CWEG..HANGUL SYLLABLE CWEH - {0xCDE8, 0xCDE8, prLV}, // Lo HANGUL SYLLABLE CWI - {0xCDE9, 0xCE03, prLVT}, // Lo [27] HANGUL SYLLABLE CWIG..HANGUL SYLLABLE CWIH - {0xCE04, 0xCE04, prLV}, // Lo HANGUL SYLLABLE CYU - {0xCE05, 0xCE1F, prLVT}, // Lo [27] HANGUL SYLLABLE CYUG..HANGUL SYLLABLE CYUH - {0xCE20, 0xCE20, prLV}, // Lo HANGUL SYLLABLE CEU - {0xCE21, 0xCE3B, prLVT}, // Lo [27] HANGUL SYLLABLE CEUG..HANGUL SYLLABLE CEUH - {0xCE3C, 0xCE3C, prLV}, // Lo HANGUL SYLLABLE CYI - {0xCE3D, 0xCE57, prLVT}, // Lo [27] HANGUL SYLLABLE CYIG..HANGUL SYLLABLE CYIH - {0xCE58, 0xCE58, prLV}, // Lo HANGUL SYLLABLE CI - {0xCE59, 0xCE73, prLVT}, // Lo [27] HANGUL SYLLABLE CIG..HANGUL SYLLABLE CIH - {0xCE74, 0xCE74, prLV}, // Lo HANGUL SYLLABLE KA - {0xCE75, 0xCE8F, prLVT}, // Lo [27] HANGUL SYLLABLE KAG..HANGUL SYLLABLE KAH - {0xCE90, 0xCE90, prLV}, // Lo HANGUL SYLLABLE KAE - {0xCE91, 0xCEAB, prLVT}, // Lo [27] HANGUL SYLLABLE KAEG..HANGUL SYLLABLE KAEH - {0xCEAC, 0xCEAC, prLV}, // Lo HANGUL SYLLABLE KYA - {0xCEAD, 0xCEC7, prLVT}, // Lo [27] HANGUL SYLLABLE KYAG..HANGUL SYLLABLE KYAH - {0xCEC8, 0xCEC8, prLV}, // Lo HANGUL SYLLABLE KYAE - {0xCEC9, 0xCEE3, prLVT}, // Lo [27] HANGUL SYLLABLE KYAEG..HANGUL SYLLABLE KYAEH - {0xCEE4, 0xCEE4, prLV}, // Lo HANGUL SYLLABLE KEO - {0xCEE5, 0xCEFF, prLVT}, // Lo [27] HANGUL SYLLABLE KEOG..HANGUL SYLLABLE KEOH - {0xCF00, 0xCF00, prLV}, // Lo HANGUL SYLLABLE KE - {0xCF01, 0xCF1B, prLVT}, // Lo [27] HANGUL SYLLABLE KEG..HANGUL SYLLABLE KEH - {0xCF1C, 0xCF1C, prLV}, // Lo HANGUL SYLLABLE KYEO - {0xCF1D, 0xCF37, prLVT}, // Lo [27] HANGUL SYLLABLE KYEOG..HANGUL SYLLABLE KYEOH - {0xCF38, 0xCF38, prLV}, // Lo HANGUL SYLLABLE KYE - {0xCF39, 0xCF53, prLVT}, // Lo [27] HANGUL SYLLABLE KYEG..HANGUL SYLLABLE KYEH - {0xCF54, 0xCF54, prLV}, // Lo HANGUL SYLLABLE KO - {0xCF55, 0xCF6F, prLVT}, // Lo [27] HANGUL SYLLABLE KOG..HANGUL SYLLABLE KOH - {0xCF70, 0xCF70, prLV}, // Lo HANGUL SYLLABLE KWA - {0xCF71, 0xCF8B, prLVT}, // Lo [27] HANGUL SYLLABLE KWAG..HANGUL SYLLABLE KWAH - {0xCF8C, 0xCF8C, prLV}, // Lo HANGUL SYLLABLE KWAE - {0xCF8D, 0xCFA7, prLVT}, // Lo [27] HANGUL SYLLABLE KWAEG..HANGUL SYLLABLE KWAEH - {0xCFA8, 0xCFA8, prLV}, // Lo HANGUL SYLLABLE KOE - {0xCFA9, 0xCFC3, prLVT}, // Lo [27] HANGUL SYLLABLE KOEG..HANGUL SYLLABLE KOEH - {0xCFC4, 0xCFC4, prLV}, // Lo HANGUL SYLLABLE KYO - {0xCFC5, 0xCFDF, prLVT}, // Lo [27] HANGUL SYLLABLE KYOG..HANGUL SYLLABLE KYOH - {0xCFE0, 0xCFE0, prLV}, // Lo HANGUL SYLLABLE KU - {0xCFE1, 0xCFFB, prLVT}, // Lo [27] HANGUL SYLLABLE KUG..HANGUL SYLLABLE KUH - {0xCFFC, 0xCFFC, prLV}, // Lo HANGUL SYLLABLE KWEO - {0xCFFD, 0xD017, prLVT}, // Lo [27] HANGUL SYLLABLE KWEOG..HANGUL SYLLABLE KWEOH - {0xD018, 0xD018, prLV}, // Lo HANGUL SYLLABLE KWE - {0xD019, 0xD033, prLVT}, // Lo [27] HANGUL SYLLABLE KWEG..HANGUL SYLLABLE KWEH - {0xD034, 0xD034, prLV}, // Lo HANGUL SYLLABLE KWI - {0xD035, 0xD04F, prLVT}, // Lo [27] HANGUL SYLLABLE KWIG..HANGUL SYLLABLE KWIH - {0xD050, 0xD050, prLV}, // Lo HANGUL SYLLABLE KYU - {0xD051, 0xD06B, prLVT}, // Lo [27] HANGUL SYLLABLE KYUG..HANGUL SYLLABLE KYUH - {0xD06C, 0xD06C, prLV}, // Lo HANGUL SYLLABLE KEU - {0xD06D, 0xD087, prLVT}, // Lo [27] HANGUL SYLLABLE KEUG..HANGUL SYLLABLE KEUH - {0xD088, 0xD088, prLV}, // Lo HANGUL SYLLABLE KYI - {0xD089, 0xD0A3, prLVT}, // Lo [27] HANGUL SYLLABLE KYIG..HANGUL SYLLABLE KYIH - {0xD0A4, 0xD0A4, prLV}, // Lo HANGUL SYLLABLE KI - {0xD0A5, 0xD0BF, prLVT}, // Lo [27] HANGUL SYLLABLE KIG..HANGUL SYLLABLE KIH - {0xD0C0, 0xD0C0, prLV}, // Lo HANGUL SYLLABLE TA - {0xD0C1, 0xD0DB, prLVT}, // Lo [27] HANGUL SYLLABLE TAG..HANGUL SYLLABLE TAH - {0xD0DC, 0xD0DC, prLV}, // Lo HANGUL SYLLABLE TAE - {0xD0DD, 0xD0F7, prLVT}, // Lo [27] HANGUL SYLLABLE TAEG..HANGUL SYLLABLE TAEH - {0xD0F8, 0xD0F8, prLV}, // Lo HANGUL SYLLABLE TYA - {0xD0F9, 0xD113, prLVT}, // Lo [27] HANGUL SYLLABLE TYAG..HANGUL SYLLABLE TYAH - {0xD114, 0xD114, prLV}, // Lo HANGUL SYLLABLE TYAE - {0xD115, 0xD12F, prLVT}, // Lo [27] HANGUL SYLLABLE TYAEG..HANGUL SYLLABLE TYAEH - {0xD130, 0xD130, prLV}, // Lo HANGUL SYLLABLE TEO - {0xD131, 0xD14B, prLVT}, // Lo [27] HANGUL SYLLABLE TEOG..HANGUL SYLLABLE TEOH - {0xD14C, 0xD14C, prLV}, // Lo HANGUL SYLLABLE TE - {0xD14D, 0xD167, prLVT}, // Lo [27] HANGUL SYLLABLE TEG..HANGUL SYLLABLE TEH - {0xD168, 0xD168, prLV}, // Lo HANGUL SYLLABLE TYEO - {0xD169, 0xD183, prLVT}, // Lo [27] HANGUL SYLLABLE TYEOG..HANGUL SYLLABLE TYEOH - {0xD184, 0xD184, prLV}, // Lo HANGUL SYLLABLE TYE - {0xD185, 0xD19F, prLVT}, // Lo [27] HANGUL SYLLABLE TYEG..HANGUL SYLLABLE TYEH - {0xD1A0, 0xD1A0, prLV}, // Lo HANGUL SYLLABLE TO - {0xD1A1, 0xD1BB, prLVT}, // Lo [27] HANGUL SYLLABLE TOG..HANGUL SYLLABLE TOH - {0xD1BC, 0xD1BC, prLV}, // Lo HANGUL SYLLABLE TWA - {0xD1BD, 0xD1D7, prLVT}, // Lo [27] HANGUL SYLLABLE TWAG..HANGUL SYLLABLE TWAH - {0xD1D8, 0xD1D8, prLV}, // Lo HANGUL SYLLABLE TWAE - {0xD1D9, 0xD1F3, prLVT}, // Lo [27] HANGUL SYLLABLE TWAEG..HANGUL SYLLABLE TWAEH - {0xD1F4, 0xD1F4, prLV}, // Lo HANGUL SYLLABLE TOE - {0xD1F5, 0xD20F, prLVT}, // Lo [27] HANGUL SYLLABLE TOEG..HANGUL SYLLABLE TOEH - {0xD210, 0xD210, prLV}, // Lo HANGUL SYLLABLE TYO - {0xD211, 0xD22B, prLVT}, // Lo [27] HANGUL SYLLABLE TYOG..HANGUL SYLLABLE TYOH - {0xD22C, 0xD22C, prLV}, // Lo HANGUL SYLLABLE TU - {0xD22D, 0xD247, prLVT}, // Lo [27] HANGUL SYLLABLE TUG..HANGUL SYLLABLE TUH - {0xD248, 0xD248, prLV}, // Lo HANGUL SYLLABLE TWEO - {0xD249, 0xD263, prLVT}, // Lo [27] HANGUL SYLLABLE TWEOG..HANGUL SYLLABLE TWEOH - {0xD264, 0xD264, prLV}, // Lo HANGUL SYLLABLE TWE - {0xD265, 0xD27F, prLVT}, // Lo [27] HANGUL SYLLABLE TWEG..HANGUL SYLLABLE TWEH - {0xD280, 0xD280, prLV}, // Lo HANGUL SYLLABLE TWI - {0xD281, 0xD29B, prLVT}, // Lo [27] HANGUL SYLLABLE TWIG..HANGUL SYLLABLE TWIH - {0xD29C, 0xD29C, prLV}, // Lo HANGUL SYLLABLE TYU - {0xD29D, 0xD2B7, prLVT}, // Lo [27] HANGUL SYLLABLE TYUG..HANGUL SYLLABLE TYUH - {0xD2B8, 0xD2B8, prLV}, // Lo HANGUL SYLLABLE TEU - {0xD2B9, 0xD2D3, prLVT}, // Lo [27] HANGUL SYLLABLE TEUG..HANGUL SYLLABLE TEUH - {0xD2D4, 0xD2D4, prLV}, // Lo HANGUL SYLLABLE TYI - {0xD2D5, 0xD2EF, prLVT}, // Lo [27] HANGUL SYLLABLE TYIG..HANGUL SYLLABLE TYIH - {0xD2F0, 0xD2F0, prLV}, // Lo HANGUL SYLLABLE TI - {0xD2F1, 0xD30B, prLVT}, // Lo [27] HANGUL SYLLABLE TIG..HANGUL SYLLABLE TIH - {0xD30C, 0xD30C, prLV}, // Lo HANGUL SYLLABLE PA - {0xD30D, 0xD327, prLVT}, // Lo [27] HANGUL SYLLABLE PAG..HANGUL SYLLABLE PAH - {0xD328, 0xD328, prLV}, // Lo HANGUL SYLLABLE PAE - {0xD329, 0xD343, prLVT}, // Lo [27] HANGUL SYLLABLE PAEG..HANGUL SYLLABLE PAEH - {0xD344, 0xD344, prLV}, // Lo HANGUL SYLLABLE PYA - {0xD345, 0xD35F, prLVT}, // Lo [27] HANGUL SYLLABLE PYAG..HANGUL SYLLABLE PYAH - {0xD360, 0xD360, prLV}, // Lo HANGUL SYLLABLE PYAE - {0xD361, 0xD37B, prLVT}, // Lo [27] HANGUL SYLLABLE PYAEG..HANGUL SYLLABLE PYAEH - {0xD37C, 0xD37C, prLV}, // Lo HANGUL SYLLABLE PEO - {0xD37D, 0xD397, prLVT}, // Lo [27] HANGUL SYLLABLE PEOG..HANGUL SYLLABLE PEOH - {0xD398, 0xD398, prLV}, // Lo HANGUL SYLLABLE PE - {0xD399, 0xD3B3, prLVT}, // Lo [27] HANGUL SYLLABLE PEG..HANGUL SYLLABLE PEH - {0xD3B4, 0xD3B4, prLV}, // Lo HANGUL SYLLABLE PYEO - {0xD3B5, 0xD3CF, prLVT}, // Lo [27] HANGUL SYLLABLE PYEOG..HANGUL SYLLABLE PYEOH - {0xD3D0, 0xD3D0, prLV}, // Lo HANGUL SYLLABLE PYE - {0xD3D1, 0xD3EB, prLVT}, // Lo [27] HANGUL SYLLABLE PYEG..HANGUL SYLLABLE PYEH - {0xD3EC, 0xD3EC, prLV}, // Lo HANGUL SYLLABLE PO - {0xD3ED, 0xD407, prLVT}, // Lo [27] HANGUL SYLLABLE POG..HANGUL SYLLABLE POH - {0xD408, 0xD408, prLV}, // Lo HANGUL SYLLABLE PWA - {0xD409, 0xD423, prLVT}, // Lo [27] HANGUL SYLLABLE PWAG..HANGUL SYLLABLE PWAH - {0xD424, 0xD424, prLV}, // Lo HANGUL SYLLABLE PWAE - {0xD425, 0xD43F, prLVT}, // Lo [27] HANGUL SYLLABLE PWAEG..HANGUL SYLLABLE PWAEH - {0xD440, 0xD440, prLV}, // Lo HANGUL SYLLABLE POE - {0xD441, 0xD45B, prLVT}, // Lo [27] HANGUL SYLLABLE POEG..HANGUL SYLLABLE POEH - {0xD45C, 0xD45C, prLV}, // Lo HANGUL SYLLABLE PYO - {0xD45D, 0xD477, prLVT}, // Lo [27] HANGUL SYLLABLE PYOG..HANGUL SYLLABLE PYOH - {0xD478, 0xD478, prLV}, // Lo HANGUL SYLLABLE PU - {0xD479, 0xD493, prLVT}, // Lo [27] HANGUL SYLLABLE PUG..HANGUL SYLLABLE PUH - {0xD494, 0xD494, prLV}, // Lo HANGUL SYLLABLE PWEO - {0xD495, 0xD4AF, prLVT}, // Lo [27] HANGUL SYLLABLE PWEOG..HANGUL SYLLABLE PWEOH - {0xD4B0, 0xD4B0, prLV}, // Lo HANGUL SYLLABLE PWE - {0xD4B1, 0xD4CB, prLVT}, // Lo [27] HANGUL SYLLABLE PWEG..HANGUL SYLLABLE PWEH - {0xD4CC, 0xD4CC, prLV}, // Lo HANGUL SYLLABLE PWI - {0xD4CD, 0xD4E7, prLVT}, // Lo [27] HANGUL SYLLABLE PWIG..HANGUL SYLLABLE PWIH - {0xD4E8, 0xD4E8, prLV}, // Lo HANGUL SYLLABLE PYU - {0xD4E9, 0xD503, prLVT}, // Lo [27] HANGUL SYLLABLE PYUG..HANGUL SYLLABLE PYUH - {0xD504, 0xD504, prLV}, // Lo HANGUL SYLLABLE PEU - {0xD505, 0xD51F, prLVT}, // Lo [27] HANGUL SYLLABLE PEUG..HANGUL SYLLABLE PEUH - {0xD520, 0xD520, prLV}, // Lo HANGUL SYLLABLE PYI - {0xD521, 0xD53B, prLVT}, // Lo [27] HANGUL SYLLABLE PYIG..HANGUL SYLLABLE PYIH - {0xD53C, 0xD53C, prLV}, // Lo HANGUL SYLLABLE PI - {0xD53D, 0xD557, prLVT}, // Lo [27] HANGUL SYLLABLE PIG..HANGUL SYLLABLE PIH - {0xD558, 0xD558, prLV}, // Lo HANGUL SYLLABLE HA - {0xD559, 0xD573, prLVT}, // Lo [27] HANGUL SYLLABLE HAG..HANGUL SYLLABLE HAH - {0xD574, 0xD574, prLV}, // Lo HANGUL SYLLABLE HAE - {0xD575, 0xD58F, prLVT}, // Lo [27] HANGUL SYLLABLE HAEG..HANGUL SYLLABLE HAEH - {0xD590, 0xD590, prLV}, // Lo HANGUL SYLLABLE HYA - {0xD591, 0xD5AB, prLVT}, // Lo [27] HANGUL SYLLABLE HYAG..HANGUL SYLLABLE HYAH - {0xD5AC, 0xD5AC, prLV}, // Lo HANGUL SYLLABLE HYAE - {0xD5AD, 0xD5C7, prLVT}, // Lo [27] HANGUL SYLLABLE HYAEG..HANGUL SYLLABLE HYAEH - {0xD5C8, 0xD5C8, prLV}, // Lo HANGUL SYLLABLE HEO - {0xD5C9, 0xD5E3, prLVT}, // Lo [27] HANGUL SYLLABLE HEOG..HANGUL SYLLABLE HEOH - {0xD5E4, 0xD5E4, prLV}, // Lo HANGUL SYLLABLE HE - {0xD5E5, 0xD5FF, prLVT}, // Lo [27] HANGUL SYLLABLE HEG..HANGUL SYLLABLE HEH - {0xD600, 0xD600, prLV}, // Lo HANGUL SYLLABLE HYEO - {0xD601, 0xD61B, prLVT}, // Lo [27] HANGUL SYLLABLE HYEOG..HANGUL SYLLABLE HYEOH - {0xD61C, 0xD61C, prLV}, // Lo HANGUL SYLLABLE HYE - {0xD61D, 0xD637, prLVT}, // Lo [27] HANGUL SYLLABLE HYEG..HANGUL SYLLABLE HYEH - {0xD638, 0xD638, prLV}, // Lo HANGUL SYLLABLE HO - {0xD639, 0xD653, prLVT}, // Lo [27] HANGUL SYLLABLE HOG..HANGUL SYLLABLE HOH - {0xD654, 0xD654, prLV}, // Lo HANGUL SYLLABLE HWA - {0xD655, 0xD66F, prLVT}, // Lo [27] HANGUL SYLLABLE HWAG..HANGUL SYLLABLE HWAH - {0xD670, 0xD670, prLV}, // Lo HANGUL SYLLABLE HWAE - {0xD671, 0xD68B, prLVT}, // Lo [27] HANGUL SYLLABLE HWAEG..HANGUL SYLLABLE HWAEH - {0xD68C, 0xD68C, prLV}, // Lo HANGUL SYLLABLE HOE - {0xD68D, 0xD6A7, prLVT}, // Lo [27] HANGUL SYLLABLE HOEG..HANGUL SYLLABLE HOEH - {0xD6A8, 0xD6A8, prLV}, // Lo HANGUL SYLLABLE HYO - {0xD6A9, 0xD6C3, prLVT}, // Lo [27] HANGUL SYLLABLE HYOG..HANGUL SYLLABLE HYOH - {0xD6C4, 0xD6C4, prLV}, // Lo HANGUL SYLLABLE HU - {0xD6C5, 0xD6DF, prLVT}, // Lo [27] HANGUL SYLLABLE HUG..HANGUL SYLLABLE HUH - {0xD6E0, 0xD6E0, prLV}, // Lo HANGUL SYLLABLE HWEO - {0xD6E1, 0xD6FB, prLVT}, // Lo [27] HANGUL SYLLABLE HWEOG..HANGUL SYLLABLE HWEOH - {0xD6FC, 0xD6FC, prLV}, // Lo HANGUL SYLLABLE HWE - {0xD6FD, 0xD717, prLVT}, // Lo [27] HANGUL SYLLABLE HWEG..HANGUL SYLLABLE HWEH - {0xD718, 0xD718, prLV}, // Lo HANGUL SYLLABLE HWI - {0xD719, 0xD733, prLVT}, // Lo [27] HANGUL SYLLABLE HWIG..HANGUL SYLLABLE HWIH - {0xD734, 0xD734, prLV}, // Lo HANGUL SYLLABLE HYU - {0xD735, 0xD74F, prLVT}, // Lo [27] HANGUL SYLLABLE HYUG..HANGUL SYLLABLE HYUH - {0xD750, 0xD750, prLV}, // Lo HANGUL SYLLABLE HEU - {0xD751, 0xD76B, prLVT}, // Lo [27] HANGUL SYLLABLE HEUG..HANGUL SYLLABLE HEUH - {0xD76C, 0xD76C, prLV}, // Lo HANGUL SYLLABLE HYI - {0xD76D, 0xD787, prLVT}, // Lo [27] HANGUL SYLLABLE HYIG..HANGUL SYLLABLE HYIH - {0xD788, 0xD788, prLV}, // Lo HANGUL SYLLABLE HI - {0xD789, 0xD7A3, prLVT}, // Lo [27] HANGUL SYLLABLE HIG..HANGUL SYLLABLE HIH - {0xD7B0, 0xD7C6, prV}, // Lo [23] HANGUL JUNGSEONG O-YEO..HANGUL JUNGSEONG ARAEA-E - {0xD7CB, 0xD7FB, prT}, // Lo [49] HANGUL JONGSEONG NIEUN-RIEUL..HANGUL JONGSEONG PHIEUPH-THIEUTH - {0xFB1E, 0xFB1E, prExtend}, // Mn HEBREW POINT JUDEO-SPANISH VARIKA - {0xFE00, 0xFE0F, prExtend}, // Mn [16] VARIATION SELECTOR-1..VARIATION SELECTOR-16 - {0xFE20, 0xFE2F, prExtend}, // Mn [16] COMBINING LIGATURE LEFT HALF..COMBINING CYRILLIC TITLO RIGHT HALF - {0xFEFF, 0xFEFF, prControl}, // Cf ZERO WIDTH NO-BREAK SPACE - {0xFF9E, 0xFF9F, prExtend}, // Lm [2] HALFWIDTH KATAKANA VOICED SOUND MARK..HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK - {0xFFF0, 0xFFF8, prControl}, // Cn [9] .. - {0xFFF9, 0xFFFB, prControl}, // Cf [3] INTERLINEAR ANNOTATION ANCHOR..INTERLINEAR ANNOTATION TERMINATOR - {0x101FD, 0x101FD, prExtend}, // Mn PHAISTOS DISC SIGN COMBINING OBLIQUE STROKE - {0x102E0, 0x102E0, prExtend}, // Mn COPTIC EPACT THOUSANDS MARK - {0x10376, 0x1037A, prExtend}, // Mn [5] COMBINING OLD PERMIC LETTER AN..COMBINING OLD PERMIC LETTER SII - {0x10A01, 0x10A03, prExtend}, // Mn [3] KHAROSHTHI VOWEL SIGN I..KHAROSHTHI VOWEL SIGN VOCALIC R - {0x10A05, 0x10A06, prExtend}, // Mn [2] KHAROSHTHI VOWEL SIGN E..KHAROSHTHI VOWEL SIGN O - {0x10A0C, 0x10A0F, prExtend}, // Mn [4] KHAROSHTHI VOWEL LENGTH MARK..KHAROSHTHI SIGN VISARGA - {0x10A38, 0x10A3A, prExtend}, // Mn [3] KHAROSHTHI SIGN BAR ABOVE..KHAROSHTHI SIGN DOT BELOW - {0x10A3F, 0x10A3F, prExtend}, // Mn KHAROSHTHI VIRAMA - {0x10AE5, 0x10AE6, prExtend}, // Mn [2] MANICHAEAN ABBREVIATION MARK ABOVE..MANICHAEAN ABBREVIATION MARK BELOW - {0x10D24, 0x10D27, prExtend}, // Mn [4] HANIFI ROHINGYA SIGN HARBAHAY..HANIFI ROHINGYA SIGN TASSI - {0x10F46, 0x10F50, prExtend}, // Mn [11] SOGDIAN COMBINING DOT BELOW..SOGDIAN COMBINING STROKE BELOW - {0x11000, 0x11000, prSpacingMark}, // Mc BRAHMI SIGN CANDRABINDU - {0x11001, 0x11001, prExtend}, // Mn BRAHMI SIGN ANUSVARA - {0x11002, 0x11002, prSpacingMark}, // Mc BRAHMI SIGN VISARGA - {0x11038, 0x11046, prExtend}, // Mn [15] BRAHMI VOWEL SIGN AA..BRAHMI VIRAMA - {0x1107F, 0x11081, prExtend}, // Mn [3] BRAHMI NUMBER JOINER..KAITHI SIGN ANUSVARA - {0x11082, 0x11082, prSpacingMark}, // Mc KAITHI SIGN VISARGA - {0x110B0, 0x110B2, prSpacingMark}, // Mc [3] KAITHI VOWEL SIGN AA..KAITHI VOWEL SIGN II - {0x110B3, 0x110B6, prExtend}, // Mn [4] KAITHI VOWEL SIGN U..KAITHI VOWEL SIGN AI - {0x110B7, 0x110B8, prSpacingMark}, // Mc [2] KAITHI VOWEL SIGN O..KAITHI VOWEL SIGN AU - {0x110B9, 0x110BA, prExtend}, // Mn [2] KAITHI SIGN VIRAMA..KAITHI SIGN NUKTA - {0x110BD, 0x110BD, prPreprend}, // Cf KAITHI NUMBER SIGN - {0x110CD, 0x110CD, prPreprend}, // Cf KAITHI NUMBER SIGN ABOVE - {0x11100, 0x11102, prExtend}, // Mn [3] CHAKMA SIGN CANDRABINDU..CHAKMA SIGN VISARGA - {0x11127, 0x1112B, prExtend}, // Mn [5] CHAKMA VOWEL SIGN A..CHAKMA VOWEL SIGN UU - {0x1112C, 0x1112C, prSpacingMark}, // Mc CHAKMA VOWEL SIGN E - {0x1112D, 0x11134, prExtend}, // Mn [8] CHAKMA VOWEL SIGN AI..CHAKMA MAAYYAA - {0x11145, 0x11146, prSpacingMark}, // Mc [2] CHAKMA VOWEL SIGN AA..CHAKMA VOWEL SIGN EI - {0x11173, 0x11173, prExtend}, // Mn MAHAJANI SIGN NUKTA - {0x11180, 0x11181, prExtend}, // Mn [2] SHARADA SIGN CANDRABINDU..SHARADA SIGN ANUSVARA - {0x11182, 0x11182, prSpacingMark}, // Mc SHARADA SIGN VISARGA - {0x111B3, 0x111B5, prSpacingMark}, // Mc [3] SHARADA VOWEL SIGN AA..SHARADA VOWEL SIGN II - {0x111B6, 0x111BE, prExtend}, // Mn [9] SHARADA VOWEL SIGN U..SHARADA VOWEL SIGN O - {0x111BF, 0x111C0, prSpacingMark}, // Mc [2] SHARADA VOWEL SIGN AU..SHARADA SIGN VIRAMA - {0x111C2, 0x111C3, prPreprend}, // Lo [2] SHARADA SIGN JIHVAMULIYA..SHARADA SIGN UPADHMANIYA - {0x111C9, 0x111CC, prExtend}, // Mn [4] SHARADA SANDHI MARK..SHARADA EXTRA SHORT VOWEL MARK - {0x1122C, 0x1122E, prSpacingMark}, // Mc [3] KHOJKI VOWEL SIGN AA..KHOJKI VOWEL SIGN II - {0x1122F, 0x11231, prExtend}, // Mn [3] KHOJKI VOWEL SIGN U..KHOJKI VOWEL SIGN AI - {0x11232, 0x11233, prSpacingMark}, // Mc [2] KHOJKI VOWEL SIGN O..KHOJKI VOWEL SIGN AU - {0x11234, 0x11234, prExtend}, // Mn KHOJKI SIGN ANUSVARA - {0x11235, 0x11235, prSpacingMark}, // Mc KHOJKI SIGN VIRAMA - {0x11236, 0x11237, prExtend}, // Mn [2] KHOJKI SIGN NUKTA..KHOJKI SIGN SHADDA - {0x1123E, 0x1123E, prExtend}, // Mn KHOJKI SIGN SUKUN - {0x112DF, 0x112DF, prExtend}, // Mn KHUDAWADI SIGN ANUSVARA - {0x112E0, 0x112E2, prSpacingMark}, // Mc [3] KHUDAWADI VOWEL SIGN AA..KHUDAWADI VOWEL SIGN II - {0x112E3, 0x112EA, prExtend}, // Mn [8] KHUDAWADI VOWEL SIGN U..KHUDAWADI SIGN VIRAMA - {0x11300, 0x11301, prExtend}, // Mn [2] GRANTHA SIGN COMBINING ANUSVARA ABOVE..GRANTHA SIGN CANDRABINDU - {0x11302, 0x11303, prSpacingMark}, // Mc [2] GRANTHA SIGN ANUSVARA..GRANTHA SIGN VISARGA - {0x1133B, 0x1133C, prExtend}, // Mn [2] COMBINING BINDU BELOW..GRANTHA SIGN NUKTA - {0x1133E, 0x1133E, prExtend}, // Mc GRANTHA VOWEL SIGN AA - {0x1133F, 0x1133F, prSpacingMark}, // Mc GRANTHA VOWEL SIGN I - {0x11340, 0x11340, prExtend}, // Mn GRANTHA VOWEL SIGN II - {0x11341, 0x11344, prSpacingMark}, // Mc [4] GRANTHA VOWEL SIGN U..GRANTHA VOWEL SIGN VOCALIC RR - {0x11347, 0x11348, prSpacingMark}, // Mc [2] GRANTHA VOWEL SIGN EE..GRANTHA VOWEL SIGN AI - {0x1134B, 0x1134D, prSpacingMark}, // Mc [3] GRANTHA VOWEL SIGN OO..GRANTHA SIGN VIRAMA - {0x11357, 0x11357, prExtend}, // Mc GRANTHA AU LENGTH MARK - {0x11362, 0x11363, prSpacingMark}, // Mc [2] GRANTHA VOWEL SIGN VOCALIC L..GRANTHA VOWEL SIGN VOCALIC LL - {0x11366, 0x1136C, prExtend}, // Mn [7] COMBINING GRANTHA DIGIT ZERO..COMBINING GRANTHA DIGIT SIX - {0x11370, 0x11374, prExtend}, // Mn [5] COMBINING GRANTHA LETTER A..COMBINING GRANTHA LETTER PA - {0x11435, 0x11437, prSpacingMark}, // Mc [3] NEWA VOWEL SIGN AA..NEWA VOWEL SIGN II - {0x11438, 0x1143F, prExtend}, // Mn [8] NEWA VOWEL SIGN U..NEWA VOWEL SIGN AI - {0x11440, 0x11441, prSpacingMark}, // Mc [2] NEWA VOWEL SIGN O..NEWA VOWEL SIGN AU - {0x11442, 0x11444, prExtend}, // Mn [3] NEWA SIGN VIRAMA..NEWA SIGN ANUSVARA - {0x11445, 0x11445, prSpacingMark}, // Mc NEWA SIGN VISARGA - {0x11446, 0x11446, prExtend}, // Mn NEWA SIGN NUKTA - {0x1145E, 0x1145E, prExtend}, // Mn NEWA SANDHI MARK - {0x114B0, 0x114B0, prExtend}, // Mc TIRHUTA VOWEL SIGN AA - {0x114B1, 0x114B2, prSpacingMark}, // Mc [2] TIRHUTA VOWEL SIGN I..TIRHUTA VOWEL SIGN II - {0x114B3, 0x114B8, prExtend}, // Mn [6] TIRHUTA VOWEL SIGN U..TIRHUTA VOWEL SIGN VOCALIC LL - {0x114B9, 0x114B9, prSpacingMark}, // Mc TIRHUTA VOWEL SIGN E - {0x114BA, 0x114BA, prExtend}, // Mn TIRHUTA VOWEL SIGN SHORT E - {0x114BB, 0x114BC, prSpacingMark}, // Mc [2] TIRHUTA VOWEL SIGN AI..TIRHUTA VOWEL SIGN O - {0x114BD, 0x114BD, prExtend}, // Mc TIRHUTA VOWEL SIGN SHORT O - {0x114BE, 0x114BE, prSpacingMark}, // Mc TIRHUTA VOWEL SIGN AU - {0x114BF, 0x114C0, prExtend}, // Mn [2] TIRHUTA SIGN CANDRABINDU..TIRHUTA SIGN ANUSVARA - {0x114C1, 0x114C1, prSpacingMark}, // Mc TIRHUTA SIGN VISARGA - {0x114C2, 0x114C3, prExtend}, // Mn [2] TIRHUTA SIGN VIRAMA..TIRHUTA SIGN NUKTA - {0x115AF, 0x115AF, prExtend}, // Mc SIDDHAM VOWEL SIGN AA - {0x115B0, 0x115B1, prSpacingMark}, // Mc [2] SIDDHAM VOWEL SIGN I..SIDDHAM VOWEL SIGN II - {0x115B2, 0x115B5, prExtend}, // Mn [4] SIDDHAM VOWEL SIGN U..SIDDHAM VOWEL SIGN VOCALIC RR - {0x115B8, 0x115BB, prSpacingMark}, // Mc [4] SIDDHAM VOWEL SIGN E..SIDDHAM VOWEL SIGN AU - {0x115BC, 0x115BD, prExtend}, // Mn [2] SIDDHAM SIGN CANDRABINDU..SIDDHAM SIGN ANUSVARA - {0x115BE, 0x115BE, prSpacingMark}, // Mc SIDDHAM SIGN VISARGA - {0x115BF, 0x115C0, prExtend}, // Mn [2] SIDDHAM SIGN VIRAMA..SIDDHAM SIGN NUKTA - {0x115DC, 0x115DD, prExtend}, // Mn [2] SIDDHAM VOWEL SIGN ALTERNATE U..SIDDHAM VOWEL SIGN ALTERNATE UU - {0x11630, 0x11632, prSpacingMark}, // Mc [3] MODI VOWEL SIGN AA..MODI VOWEL SIGN II - {0x11633, 0x1163A, prExtend}, // Mn [8] MODI VOWEL SIGN U..MODI VOWEL SIGN AI - {0x1163B, 0x1163C, prSpacingMark}, // Mc [2] MODI VOWEL SIGN O..MODI VOWEL SIGN AU - {0x1163D, 0x1163D, prExtend}, // Mn MODI SIGN ANUSVARA - {0x1163E, 0x1163E, prSpacingMark}, // Mc MODI SIGN VISARGA - {0x1163F, 0x11640, prExtend}, // Mn [2] MODI SIGN VIRAMA..MODI SIGN ARDHACANDRA - {0x116AB, 0x116AB, prExtend}, // Mn TAKRI SIGN ANUSVARA - {0x116AC, 0x116AC, prSpacingMark}, // Mc TAKRI SIGN VISARGA - {0x116AD, 0x116AD, prExtend}, // Mn TAKRI VOWEL SIGN AA - {0x116AE, 0x116AF, prSpacingMark}, // Mc [2] TAKRI VOWEL SIGN I..TAKRI VOWEL SIGN II - {0x116B0, 0x116B5, prExtend}, // Mn [6] TAKRI VOWEL SIGN U..TAKRI VOWEL SIGN AU - {0x116B6, 0x116B6, prSpacingMark}, // Mc TAKRI SIGN VIRAMA - {0x116B7, 0x116B7, prExtend}, // Mn TAKRI SIGN NUKTA - {0x1171D, 0x1171F, prExtend}, // Mn [3] AHOM CONSONANT SIGN MEDIAL LA..AHOM CONSONANT SIGN MEDIAL LIGATING RA - {0x11720, 0x11721, prSpacingMark}, // Mc [2] AHOM VOWEL SIGN A..AHOM VOWEL SIGN AA - {0x11722, 0x11725, prExtend}, // Mn [4] AHOM VOWEL SIGN I..AHOM VOWEL SIGN UU - {0x11726, 0x11726, prSpacingMark}, // Mc AHOM VOWEL SIGN E - {0x11727, 0x1172B, prExtend}, // Mn [5] AHOM VOWEL SIGN AW..AHOM SIGN KILLER - {0x1182C, 0x1182E, prSpacingMark}, // Mc [3] DOGRA VOWEL SIGN AA..DOGRA VOWEL SIGN II - {0x1182F, 0x11837, prExtend}, // Mn [9] DOGRA VOWEL SIGN U..DOGRA SIGN ANUSVARA - {0x11838, 0x11838, prSpacingMark}, // Mc DOGRA SIGN VISARGA - {0x11839, 0x1183A, prExtend}, // Mn [2] DOGRA SIGN VIRAMA..DOGRA SIGN NUKTA - {0x119D1, 0x119D3, prSpacingMark}, // Mc [3] NANDINAGARI VOWEL SIGN AA..NANDINAGARI VOWEL SIGN II - {0x119D4, 0x119D7, prExtend}, // Mn [4] NANDINAGARI VOWEL SIGN U..NANDINAGARI VOWEL SIGN VOCALIC RR - {0x119DA, 0x119DB, prExtend}, // Mn [2] NANDINAGARI VOWEL SIGN E..NANDINAGARI VOWEL SIGN AI - {0x119DC, 0x119DF, prSpacingMark}, // Mc [4] NANDINAGARI VOWEL SIGN O..NANDINAGARI SIGN VISARGA - {0x119E0, 0x119E0, prExtend}, // Mn NANDINAGARI SIGN VIRAMA - {0x119E4, 0x119E4, prSpacingMark}, // Mc NANDINAGARI VOWEL SIGN PRISHTHAMATRA E - {0x11A01, 0x11A0A, prExtend}, // Mn [10] ZANABAZAR SQUARE VOWEL SIGN I..ZANABAZAR SQUARE VOWEL LENGTH MARK - {0x11A33, 0x11A38, prExtend}, // Mn [6] ZANABAZAR SQUARE FINAL CONSONANT MARK..ZANABAZAR SQUARE SIGN ANUSVARA - {0x11A39, 0x11A39, prSpacingMark}, // Mc ZANABAZAR SQUARE SIGN VISARGA - {0x11A3A, 0x11A3A, prPreprend}, // Lo ZANABAZAR SQUARE CLUSTER-INITIAL LETTER RA - {0x11A3B, 0x11A3E, prExtend}, // Mn [4] ZANABAZAR SQUARE CLUSTER-FINAL LETTER YA..ZANABAZAR SQUARE CLUSTER-FINAL LETTER VA - {0x11A47, 0x11A47, prExtend}, // Mn ZANABAZAR SQUARE SUBJOINER - {0x11A51, 0x11A56, prExtend}, // Mn [6] SOYOMBO VOWEL SIGN I..SOYOMBO VOWEL SIGN OE - {0x11A57, 0x11A58, prSpacingMark}, // Mc [2] SOYOMBO VOWEL SIGN AI..SOYOMBO VOWEL SIGN AU - {0x11A59, 0x11A5B, prExtend}, // Mn [3] SOYOMBO VOWEL SIGN VOCALIC R..SOYOMBO VOWEL LENGTH MARK - {0x11A84, 0x11A89, prPreprend}, // Lo [6] SOYOMBO SIGN JIHVAMULIYA..SOYOMBO CLUSTER-INITIAL LETTER SA - {0x11A8A, 0x11A96, prExtend}, // Mn [13] SOYOMBO FINAL CONSONANT SIGN G..SOYOMBO SIGN ANUSVARA - {0x11A97, 0x11A97, prSpacingMark}, // Mc SOYOMBO SIGN VISARGA - {0x11A98, 0x11A99, prExtend}, // Mn [2] SOYOMBO GEMINATION MARK..SOYOMBO SUBJOINER - {0x11C2F, 0x11C2F, prSpacingMark}, // Mc BHAIKSUKI VOWEL SIGN AA - {0x11C30, 0x11C36, prExtend}, // Mn [7] BHAIKSUKI VOWEL SIGN I..BHAIKSUKI VOWEL SIGN VOCALIC L - {0x11C38, 0x11C3D, prExtend}, // Mn [6] BHAIKSUKI VOWEL SIGN E..BHAIKSUKI SIGN ANUSVARA - {0x11C3E, 0x11C3E, prSpacingMark}, // Mc BHAIKSUKI SIGN VISARGA - {0x11C3F, 0x11C3F, prExtend}, // Mn BHAIKSUKI SIGN VIRAMA - {0x11C92, 0x11CA7, prExtend}, // Mn [22] MARCHEN SUBJOINED LETTER KA..MARCHEN SUBJOINED LETTER ZA - {0x11CA9, 0x11CA9, prSpacingMark}, // Mc MARCHEN SUBJOINED LETTER YA - {0x11CAA, 0x11CB0, prExtend}, // Mn [7] MARCHEN SUBJOINED LETTER RA..MARCHEN VOWEL SIGN AA - {0x11CB1, 0x11CB1, prSpacingMark}, // Mc MARCHEN VOWEL SIGN I - {0x11CB2, 0x11CB3, prExtend}, // Mn [2] MARCHEN VOWEL SIGN U..MARCHEN VOWEL SIGN E - {0x11CB4, 0x11CB4, prSpacingMark}, // Mc MARCHEN VOWEL SIGN O - {0x11CB5, 0x11CB6, prExtend}, // Mn [2] MARCHEN SIGN ANUSVARA..MARCHEN SIGN CANDRABINDU - {0x11D31, 0x11D36, prExtend}, // Mn [6] MASARAM GONDI VOWEL SIGN AA..MASARAM GONDI VOWEL SIGN VOCALIC R - {0x11D3A, 0x11D3A, prExtend}, // Mn MASARAM GONDI VOWEL SIGN E - {0x11D3C, 0x11D3D, prExtend}, // Mn [2] MASARAM GONDI VOWEL SIGN AI..MASARAM GONDI VOWEL SIGN O - {0x11D3F, 0x11D45, prExtend}, // Mn [7] MASARAM GONDI VOWEL SIGN AU..MASARAM GONDI VIRAMA - {0x11D46, 0x11D46, prPreprend}, // Lo MASARAM GONDI REPHA - {0x11D47, 0x11D47, prExtend}, // Mn MASARAM GONDI RA-KARA - {0x11D8A, 0x11D8E, prSpacingMark}, // Mc [5] GUNJALA GONDI VOWEL SIGN AA..GUNJALA GONDI VOWEL SIGN UU - {0x11D90, 0x11D91, prExtend}, // Mn [2] GUNJALA GONDI VOWEL SIGN EE..GUNJALA GONDI VOWEL SIGN AI - {0x11D93, 0x11D94, prSpacingMark}, // Mc [2] GUNJALA GONDI VOWEL SIGN OO..GUNJALA GONDI VOWEL SIGN AU - {0x11D95, 0x11D95, prExtend}, // Mn GUNJALA GONDI SIGN ANUSVARA - {0x11D96, 0x11D96, prSpacingMark}, // Mc GUNJALA GONDI SIGN VISARGA - {0x11D97, 0x11D97, prExtend}, // Mn GUNJALA GONDI VIRAMA - {0x11EF3, 0x11EF4, prExtend}, // Mn [2] MAKASAR VOWEL SIGN I..MAKASAR VOWEL SIGN U - {0x11EF5, 0x11EF6, prSpacingMark}, // Mc [2] MAKASAR VOWEL SIGN E..MAKASAR VOWEL SIGN O - {0x13430, 0x13438, prControl}, // Cf [9] EGYPTIAN HIEROGLYPH VERTICAL JOINER..EGYPTIAN HIEROGLYPH END SEGMENT - {0x16AF0, 0x16AF4, prExtend}, // Mn [5] BASSA VAH COMBINING HIGH TONE..BASSA VAH COMBINING HIGH-LOW TONE - {0x16B30, 0x16B36, prExtend}, // Mn [7] PAHAWH HMONG MARK CIM TUB..PAHAWH HMONG MARK CIM TAUM - {0x16F4F, 0x16F4F, prExtend}, // Mn MIAO SIGN CONSONANT MODIFIER BAR - {0x16F51, 0x16F87, prSpacingMark}, // Mc [55] MIAO SIGN ASPIRATION..MIAO VOWEL SIGN UI - {0x16F8F, 0x16F92, prExtend}, // Mn [4] MIAO TONE RIGHT..MIAO TONE BELOW - {0x1BC9D, 0x1BC9E, prExtend}, // Mn [2] DUPLOYAN THICK LETTER SELECTOR..DUPLOYAN DOUBLE MARK - {0x1BCA0, 0x1BCA3, prControl}, // Cf [4] SHORTHAND FORMAT LETTER OVERLAP..SHORTHAND FORMAT UP STEP - {0x1D165, 0x1D165, prExtend}, // Mc MUSICAL SYMBOL COMBINING STEM - {0x1D166, 0x1D166, prSpacingMark}, // Mc MUSICAL SYMBOL COMBINING SPRECHGESANG STEM - {0x1D167, 0x1D169, prExtend}, // Mn [3] MUSICAL SYMBOL COMBINING TREMOLO-1..MUSICAL SYMBOL COMBINING TREMOLO-3 - {0x1D16D, 0x1D16D, prSpacingMark}, // Mc MUSICAL SYMBOL COMBINING AUGMENTATION DOT - {0x1D16E, 0x1D172, prExtend}, // Mc [5] MUSICAL SYMBOL COMBINING FLAG-1..MUSICAL SYMBOL COMBINING FLAG-5 - {0x1D173, 0x1D17A, prControl}, // Cf [8] MUSICAL SYMBOL BEGIN BEAM..MUSICAL SYMBOL END PHRASE - {0x1D17B, 0x1D182, prExtend}, // Mn [8] MUSICAL SYMBOL COMBINING ACCENT..MUSICAL SYMBOL COMBINING LOURE - {0x1D185, 0x1D18B, prExtend}, // Mn [7] MUSICAL SYMBOL COMBINING DOIT..MUSICAL SYMBOL COMBINING TRIPLE TONGUE - {0x1D1AA, 0x1D1AD, prExtend}, // Mn [4] MUSICAL SYMBOL COMBINING DOWN BOW..MUSICAL SYMBOL COMBINING SNAP PIZZICATO - {0x1D242, 0x1D244, prExtend}, // Mn [3] COMBINING GREEK MUSICAL TRISEME..COMBINING GREEK MUSICAL PENTASEME - {0x1DA00, 0x1DA36, prExtend}, // Mn [55] SIGNWRITING HEAD RIM..SIGNWRITING AIR SUCKING IN - {0x1DA3B, 0x1DA6C, prExtend}, // Mn [50] SIGNWRITING MOUTH CLOSED NEUTRAL..SIGNWRITING EXCITEMENT - {0x1DA75, 0x1DA75, prExtend}, // Mn SIGNWRITING UPPER BODY TILTING FROM HIP JOINTS - {0x1DA84, 0x1DA84, prExtend}, // Mn SIGNWRITING LOCATION HEAD NECK - {0x1DA9B, 0x1DA9F, prExtend}, // Mn [5] SIGNWRITING FILL MODIFIER-2..SIGNWRITING FILL MODIFIER-6 - {0x1DAA1, 0x1DAAF, prExtend}, // Mn [15] SIGNWRITING ROTATION MODIFIER-2..SIGNWRITING ROTATION MODIFIER-16 - {0x1E000, 0x1E006, prExtend}, // Mn [7] COMBINING GLAGOLITIC LETTER AZU..COMBINING GLAGOLITIC LETTER ZHIVETE - {0x1E008, 0x1E018, prExtend}, // Mn [17] COMBINING GLAGOLITIC LETTER ZEMLJA..COMBINING GLAGOLITIC LETTER HERU - {0x1E01B, 0x1E021, prExtend}, // Mn [7] COMBINING GLAGOLITIC LETTER SHTA..COMBINING GLAGOLITIC LETTER YATI - {0x1E023, 0x1E024, prExtend}, // Mn [2] COMBINING GLAGOLITIC LETTER YU..COMBINING GLAGOLITIC LETTER SMALL YUS - {0x1E026, 0x1E02A, prExtend}, // Mn [5] COMBINING GLAGOLITIC LETTER YO..COMBINING GLAGOLITIC LETTER FITA - {0x1E130, 0x1E136, prExtend}, // Mn [7] NYIAKENG PUACHUE HMONG TONE-B..NYIAKENG PUACHUE HMONG TONE-D - {0x1E2EC, 0x1E2EF, prExtend}, // Mn [4] WANCHO TONE TUP..WANCHO TONE KOINI - {0x1E8D0, 0x1E8D6, prExtend}, // Mn [7] MENDE KIKAKUI COMBINING NUMBER TEENS..MENDE KIKAKUI COMBINING NUMBER MILLIONS - {0x1E944, 0x1E94A, prExtend}, // Mn [7] ADLAM ALIF LENGTHENER..ADLAM NUKTA - {0x1F000, 0x1F02B, prExtendedPictographic}, // 5.1 [44] (🀀..🀫) MAHJONG TILE EAST WIND..MAHJONG TILE BACK - {0x1F02C, 0x1F02F, prExtendedPictographic}, // NA [4] (🀬..🀯) .. - {0x1F030, 0x1F093, prExtendedPictographic}, // 5.1[100] (🀰..🂓) DOMINO TILE HORIZONTAL BACK..DOMINO TILE VERTICAL-06-06 - {0x1F094, 0x1F09F, prExtendedPictographic}, // NA [12] (🂔..🂟) .. - {0x1F0A0, 0x1F0AE, prExtendedPictographic}, // 6.0 [15] (🂠..🂮) PLAYING CARD BACK..PLAYING CARD KING OF SPADES - {0x1F0AF, 0x1F0B0, prExtendedPictographic}, // NA [2] (🂯..🂰) .. - {0x1F0B1, 0x1F0BE, prExtendedPictographic}, // 6.0 [14] (🂱..🂾) PLAYING CARD ACE OF HEARTS..PLAYING CARD KING OF HEARTS - {0x1F0BF, 0x1F0BF, prExtendedPictographic}, // 7.0 [1] (🂿) PLAYING CARD RED JOKER - {0x1F0C0, 0x1F0C0, prExtendedPictographic}, // NA [1] (🃀) - {0x1F0C1, 0x1F0CF, prExtendedPictographic}, // 6.0 [15] (🃁..🃏) PLAYING CARD ACE OF DIAMONDS..joker - {0x1F0D0, 0x1F0D0, prExtendedPictographic}, // NA [1] (🃐) - {0x1F0D1, 0x1F0DF, prExtendedPictographic}, // 6.0 [15] (🃑..🃟) PLAYING CARD ACE OF CLUBS..PLAYING CARD WHITE JOKER - {0x1F0E0, 0x1F0F5, prExtendedPictographic}, // 7.0 [22] (🃠..🃵) PLAYING CARD FOOL..PLAYING CARD TRUMP-21 - {0x1F0F6, 0x1F0FF, prExtendedPictographic}, // NA [10] (🃶..🃿) .. - {0x1F10D, 0x1F10F, prExtendedPictographic}, // NA [3] (🄍..🄏) .. - {0x1F12F, 0x1F12F, prExtendedPictographic}, // 11.0 [1] (🄯) COPYLEFT SYMBOL - {0x1F16C, 0x1F16C, prExtendedPictographic}, // 12.0 [1] (🅬) RAISED MR SIGN - {0x1F16D, 0x1F16F, prExtendedPictographic}, // NA [3] (🅭..🅯) .. - {0x1F170, 0x1F171, prExtendedPictographic}, // 6.0 [2] (🅰️..🅱️) A button (blood type)..B button (blood type) - {0x1F17E, 0x1F17E, prExtendedPictographic}, // 6.0 [1] (🅾️) O button (blood type) - {0x1F17F, 0x1F17F, prExtendedPictographic}, // 5.2 [1] (🅿️) P button - {0x1F18E, 0x1F18E, prExtendedPictographic}, // 6.0 [1] (🆎) AB button (blood type) - {0x1F191, 0x1F19A, prExtendedPictographic}, // 6.0 [10] (🆑..🆚) CL button..VS button - {0x1F1AD, 0x1F1E5, prExtendedPictographic}, // NA [57] (🆭..🇥) .. - {0x1F1E6, 0x1F1FF, prRegionalIndicator}, // So [26] REGIONAL INDICATOR SYMBOL LETTER A..REGIONAL INDICATOR SYMBOL LETTER Z - {0x1F201, 0x1F202, prExtendedPictographic}, // 6.0 [2] (🈁..🈂️) Japanese “here” button..Japanese “service charge” button - {0x1F203, 0x1F20F, prExtendedPictographic}, // NA [13] (🈃..🈏) .. - {0x1F21A, 0x1F21A, prExtendedPictographic}, // 5.2 [1] (🈚) Japanese “free of charge” button - {0x1F22F, 0x1F22F, prExtendedPictographic}, // 5.2 [1] (🈯) Japanese “reserved” button - {0x1F232, 0x1F23A, prExtendedPictographic}, // 6.0 [9] (🈲..🈺) Japanese “prohibited” button..Japanese “open for business” button - {0x1F23C, 0x1F23F, prExtendedPictographic}, // NA [4] (🈼..🈿) .. - {0x1F249, 0x1F24F, prExtendedPictographic}, // NA [7] (🉉..🉏) .. - {0x1F250, 0x1F251, prExtendedPictographic}, // 6.0 [2] (🉐..🉑) Japanese “bargain” button..Japanese “acceptable” button - {0x1F252, 0x1F25F, prExtendedPictographic}, // NA [14] (🉒..🉟) .. - {0x1F260, 0x1F265, prExtendedPictographic}, // 10.0 [6] (🉠..🉥) ROUNDED SYMBOL FOR FU..ROUNDED SYMBOL FOR CAI - {0x1F266, 0x1F2FF, prExtendedPictographic}, // NA[154] (🉦..🋿) .. - {0x1F300, 0x1F320, prExtendedPictographic}, // 6.0 [33] (🌀..🌠) cyclone..shooting star - {0x1F321, 0x1F32C, prExtendedPictographic}, // 7.0 [12] (🌡️..🌬️) thermometer..wind face - {0x1F32D, 0x1F32F, prExtendedPictographic}, // 8.0 [3] (🌭..🌯) hot dog..burrito - {0x1F330, 0x1F335, prExtendedPictographic}, // 6.0 [6] (🌰..🌵) chestnut..cactus - {0x1F336, 0x1F336, prExtendedPictographic}, // 7.0 [1] (🌶️) hot pepper - {0x1F337, 0x1F37C, prExtendedPictographic}, // 6.0 [70] (🌷..🍼) tulip..baby bottle - {0x1F37D, 0x1F37D, prExtendedPictographic}, // 7.0 [1] (🍽️) fork and knife with plate - {0x1F37E, 0x1F37F, prExtendedPictographic}, // 8.0 [2] (🍾..🍿) bottle with popping cork..popcorn - {0x1F380, 0x1F393, prExtendedPictographic}, // 6.0 [20] (🎀..🎓) ribbon..graduation cap - {0x1F394, 0x1F39F, prExtendedPictographic}, // 7.0 [12] (🎔..🎟️) HEART WITH TIP ON THE LEFT..admission tickets - {0x1F3A0, 0x1F3C4, prExtendedPictographic}, // 6.0 [37] (🎠..🏄) carousel horse..person surfing - {0x1F3C5, 0x1F3C5, prExtendedPictographic}, // 7.0 [1] (🏅) sports medal - {0x1F3C6, 0x1F3CA, prExtendedPictographic}, // 6.0 [5] (🏆..🏊) trophy..person swimming - {0x1F3CB, 0x1F3CE, prExtendedPictographic}, // 7.0 [4] (🏋️..🏎️) person lifting weights..racing car - {0x1F3CF, 0x1F3D3, prExtendedPictographic}, // 8.0 [5] (🏏..🏓) cricket game..ping pong - {0x1F3D4, 0x1F3DF, prExtendedPictographic}, // 7.0 [12] (🏔️..🏟️) snow-capped mountain..stadium - {0x1F3E0, 0x1F3F0, prExtendedPictographic}, // 6.0 [17] (🏠..🏰) house..castle - {0x1F3F1, 0x1F3F7, prExtendedPictographic}, // 7.0 [7] (🏱..🏷️) WHITE PENNANT..label - {0x1F3F8, 0x1F3FA, prExtendedPictographic}, // 8.0 [3] (🏸..🏺) badminton..amphora - {0x1F3FB, 0x1F3FF, prExtend}, // Sk [5] EMOJI MODIFIER FITZPATRICK TYPE-1-2..EMOJI MODIFIER FITZPATRICK TYPE-6 - {0x1F400, 0x1F43E, prExtendedPictographic}, // 6.0 [63] (🐀..🐾) rat..paw prints - {0x1F43F, 0x1F43F, prExtendedPictographic}, // 7.0 [1] (🐿️) chipmunk - {0x1F440, 0x1F440, prExtendedPictographic}, // 6.0 [1] (👀) eyes - {0x1F441, 0x1F441, prExtendedPictographic}, // 7.0 [1] (👁️) eye - {0x1F442, 0x1F4F7, prExtendedPictographic}, // 6.0[182] (👂..📷) ear..camera - {0x1F4F8, 0x1F4F8, prExtendedPictographic}, // 7.0 [1] (📸) camera with flash - {0x1F4F9, 0x1F4FC, prExtendedPictographic}, // 6.0 [4] (📹..📼) video camera..videocassette - {0x1F4FD, 0x1F4FE, prExtendedPictographic}, // 7.0 [2] (📽️..📾) film projector..PORTABLE STEREO - {0x1F4FF, 0x1F4FF, prExtendedPictographic}, // 8.0 [1] (📿) prayer beads - {0x1F500, 0x1F53D, prExtendedPictographic}, // 6.0 [62] (🔀..🔽) shuffle tracks button..downwards button - {0x1F546, 0x1F54A, prExtendedPictographic}, // 7.0 [5] (🕆..🕊️) WHITE LATIN CROSS..dove - {0x1F54B, 0x1F54F, prExtendedPictographic}, // 8.0 [5] (🕋..🕏) kaaba..BOWL OF HYGIEIA - {0x1F550, 0x1F567, prExtendedPictographic}, // 6.0 [24] (🕐..🕧) one o’clock..twelve-thirty - {0x1F568, 0x1F579, prExtendedPictographic}, // 7.0 [18] (🕨..🕹️) RIGHT SPEAKER..joystick - {0x1F57A, 0x1F57A, prExtendedPictographic}, // 9.0 [1] (🕺) man dancing - {0x1F57B, 0x1F5A3, prExtendedPictographic}, // 7.0 [41] (🕻..🖣) LEFT HAND TELEPHONE RECEIVER..BLACK DOWN POINTING BACKHAND INDEX - {0x1F5A4, 0x1F5A4, prExtendedPictographic}, // 9.0 [1] (🖤) black heart - {0x1F5A5, 0x1F5FA, prExtendedPictographic}, // 7.0 [86] (🖥️..🗺️) desktop computer..world map - {0x1F5FB, 0x1F5FF, prExtendedPictographic}, // 6.0 [5] (🗻..🗿) mount fuji..moai - {0x1F600, 0x1F600, prExtendedPictographic}, // 6.1 [1] (😀) grinning face - {0x1F601, 0x1F610, prExtendedPictographic}, // 6.0 [16] (😁..😐) beaming face with smiling eyes..neutral face - {0x1F611, 0x1F611, prExtendedPictographic}, // 6.1 [1] (😑) expressionless face - {0x1F612, 0x1F614, prExtendedPictographic}, // 6.0 [3] (😒..😔) unamused face..pensive face - {0x1F615, 0x1F615, prExtendedPictographic}, // 6.1 [1] (😕) confused face - {0x1F616, 0x1F616, prExtendedPictographic}, // 6.0 [1] (😖) confounded face - {0x1F617, 0x1F617, prExtendedPictographic}, // 6.1 [1] (😗) kissing face - {0x1F618, 0x1F618, prExtendedPictographic}, // 6.0 [1] (😘) face blowing a kiss - {0x1F619, 0x1F619, prExtendedPictographic}, // 6.1 [1] (😙) kissing face with smiling eyes - {0x1F61A, 0x1F61A, prExtendedPictographic}, // 6.0 [1] (😚) kissing face with closed eyes - {0x1F61B, 0x1F61B, prExtendedPictographic}, // 6.1 [1] (😛) face with tongue - {0x1F61C, 0x1F61E, prExtendedPictographic}, // 6.0 [3] (😜..😞) winking face with tongue..disappointed face - {0x1F61F, 0x1F61F, prExtendedPictographic}, // 6.1 [1] (😟) worried face - {0x1F620, 0x1F625, prExtendedPictographic}, // 6.0 [6] (😠..😥) angry face..sad but relieved face - {0x1F626, 0x1F627, prExtendedPictographic}, // 6.1 [2] (😦..😧) frowning face with open mouth..anguished face - {0x1F628, 0x1F62B, prExtendedPictographic}, // 6.0 [4] (😨..😫) fearful face..tired face - {0x1F62C, 0x1F62C, prExtendedPictographic}, // 6.1 [1] (😬) grimacing face - {0x1F62D, 0x1F62D, prExtendedPictographic}, // 6.0 [1] (😭) loudly crying face - {0x1F62E, 0x1F62F, prExtendedPictographic}, // 6.1 [2] (😮..😯) face with open mouth..hushed face - {0x1F630, 0x1F633, prExtendedPictographic}, // 6.0 [4] (😰..😳) anxious face with sweat..flushed face - {0x1F634, 0x1F634, prExtendedPictographic}, // 6.1 [1] (😴) sleeping face - {0x1F635, 0x1F640, prExtendedPictographic}, // 6.0 [12] (😵..🙀) dizzy face..weary cat - {0x1F641, 0x1F642, prExtendedPictographic}, // 7.0 [2] (🙁..🙂) slightly frowning face..slightly smiling face - {0x1F643, 0x1F644, prExtendedPictographic}, // 8.0 [2] (🙃..🙄) upside-down face..face with rolling eyes - {0x1F645, 0x1F64F, prExtendedPictographic}, // 6.0 [11] (🙅..🙏) person gesturing NO..folded hands - {0x1F680, 0x1F6C5, prExtendedPictographic}, // 6.0 [70] (🚀..🛅) rocket..left luggage - {0x1F6C6, 0x1F6CF, prExtendedPictographic}, // 7.0 [10] (🛆..🛏️) TRIANGLE WITH ROUNDED CORNERS..bed - {0x1F6D0, 0x1F6D0, prExtendedPictographic}, // 8.0 [1] (🛐) place of worship - {0x1F6D1, 0x1F6D2, prExtendedPictographic}, // 9.0 [2] (🛑..🛒) stop sign..shopping cart - {0x1F6D3, 0x1F6D4, prExtendedPictographic}, // 10.0 [2] (🛓..🛔) STUPA..PAGODA - {0x1F6D5, 0x1F6D5, prExtendedPictographic}, // 12.0 [1] (🛕) hindu temple - {0x1F6D6, 0x1F6DF, prExtendedPictographic}, // NA [10] (🛖..🛟) .. - {0x1F6E0, 0x1F6EC, prExtendedPictographic}, // 7.0 [13] (🛠️..🛬) hammer and wrench..airplane arrival - {0x1F6ED, 0x1F6EF, prExtendedPictographic}, // NA [3] (🛭..🛯) .. - {0x1F6F0, 0x1F6F3, prExtendedPictographic}, // 7.0 [4] (🛰️..🛳️) satellite..passenger ship - {0x1F6F4, 0x1F6F6, prExtendedPictographic}, // 9.0 [3] (🛴..🛶) kick scooter..canoe - {0x1F6F7, 0x1F6F8, prExtendedPictographic}, // 10.0 [2] (🛷..🛸) sled..flying saucer - {0x1F6F9, 0x1F6F9, prExtendedPictographic}, // 11.0 [1] (🛹) skateboard - {0x1F6FA, 0x1F6FA, prExtendedPictographic}, // 12.0 [1] (🛺) auto rickshaw - {0x1F6FB, 0x1F6FF, prExtendedPictographic}, // NA [5] (🛻..🛿) .. - {0x1F774, 0x1F77F, prExtendedPictographic}, // NA [12] (🝴..🝿) .. - {0x1F7D5, 0x1F7D8, prExtendedPictographic}, // 11.0 [4] (🟕..🟘) CIRCLED TRIANGLE..NEGATIVE CIRCLED SQUARE - {0x1F7D9, 0x1F7DF, prExtendedPictographic}, // NA [7] (🟙..🟟) .. - {0x1F7E0, 0x1F7EB, prExtendedPictographic}, // 12.0 [12] (🟠..🟫) orange circle..brown square - {0x1F7EC, 0x1F7FF, prExtendedPictographic}, // NA [20] (🟬..🟿) .. - {0x1F80C, 0x1F80F, prExtendedPictographic}, // NA [4] (🠌..🠏) .. - {0x1F848, 0x1F84F, prExtendedPictographic}, // NA [8] (🡈..🡏) .. - {0x1F85A, 0x1F85F, prExtendedPictographic}, // NA [6] (🡚..🡟) .. - {0x1F888, 0x1F88F, prExtendedPictographic}, // NA [8] (🢈..🢏) .. - {0x1F8AE, 0x1F8FF, prExtendedPictographic}, // NA [82] (🢮..🣿) .. - {0x1F90C, 0x1F90C, prExtendedPictographic}, // NA [1] (🤌) - {0x1F90D, 0x1F90F, prExtendedPictographic}, // 12.0 [3] (🤍..🤏) white heart..pinching hand - {0x1F910, 0x1F918, prExtendedPictographic}, // 8.0 [9] (🤐..🤘) zipper-mouth face..sign of the horns - {0x1F919, 0x1F91E, prExtendedPictographic}, // 9.0 [6] (🤙..🤞) call me hand..crossed fingers - {0x1F91F, 0x1F91F, prExtendedPictographic}, // 10.0 [1] (🤟) love-you gesture - {0x1F920, 0x1F927, prExtendedPictographic}, // 9.0 [8] (🤠..🤧) cowboy hat face..sneezing face - {0x1F928, 0x1F92F, prExtendedPictographic}, // 10.0 [8] (🤨..🤯) face with raised eyebrow..exploding head - {0x1F930, 0x1F930, prExtendedPictographic}, // 9.0 [1] (🤰) pregnant woman - {0x1F931, 0x1F932, prExtendedPictographic}, // 10.0 [2] (🤱..🤲) breast-feeding..palms up together - {0x1F933, 0x1F93A, prExtendedPictographic}, // 9.0 [8] (🤳..🤺) selfie..person fencing - {0x1F93C, 0x1F93E, prExtendedPictographic}, // 9.0 [3] (🤼..🤾) people wrestling..person playing handball - {0x1F93F, 0x1F93F, prExtendedPictographic}, // 12.0 [1] (🤿) diving mask - {0x1F940, 0x1F945, prExtendedPictographic}, // 9.0 [6] (🥀..🥅) wilted flower..goal net - {0x1F947, 0x1F94B, prExtendedPictographic}, // 9.0 [5] (🥇..🥋) 1st place medal..martial arts uniform - {0x1F94C, 0x1F94C, prExtendedPictographic}, // 10.0 [1] (🥌) curling stone - {0x1F94D, 0x1F94F, prExtendedPictographic}, // 11.0 [3] (🥍..🥏) lacrosse..flying disc - {0x1F950, 0x1F95E, prExtendedPictographic}, // 9.0 [15] (🥐..🥞) croissant..pancakes - {0x1F95F, 0x1F96B, prExtendedPictographic}, // 10.0 [13] (🥟..🥫) dumpling..canned food - {0x1F96C, 0x1F970, prExtendedPictographic}, // 11.0 [5] (🥬..🥰) leafy green..smiling face with hearts - {0x1F971, 0x1F971, prExtendedPictographic}, // 12.0 [1] (🥱) yawning face - {0x1F972, 0x1F972, prExtendedPictographic}, // NA [1] (🥲) - {0x1F973, 0x1F976, prExtendedPictographic}, // 11.0 [4] (🥳..🥶) partying face..cold face - {0x1F977, 0x1F979, prExtendedPictographic}, // NA [3] (🥷..🥹) .. - {0x1F97A, 0x1F97A, prExtendedPictographic}, // 11.0 [1] (🥺) pleading face - {0x1F97B, 0x1F97B, prExtendedPictographic}, // 12.0 [1] (🥻) sari - {0x1F97C, 0x1F97F, prExtendedPictographic}, // 11.0 [4] (🥼..🥿) lab coat..flat shoe - {0x1F980, 0x1F984, prExtendedPictographic}, // 8.0 [5] (🦀..🦄) crab..unicorn - {0x1F985, 0x1F991, prExtendedPictographic}, // 9.0 [13] (🦅..🦑) eagle..squid - {0x1F992, 0x1F997, prExtendedPictographic}, // 10.0 [6] (🦒..🦗) giraffe..cricket - {0x1F998, 0x1F9A2, prExtendedPictographic}, // 11.0 [11] (🦘..🦢) kangaroo..swan - {0x1F9A3, 0x1F9A4, prExtendedPictographic}, // NA [2] (🦣..🦤) .. - {0x1F9A5, 0x1F9AA, prExtendedPictographic}, // 12.0 [6] (🦥..🦪) sloth..oyster - {0x1F9AB, 0x1F9AD, prExtendedPictographic}, // NA [3] (🦫..🦭) .. - {0x1F9AE, 0x1F9AF, prExtendedPictographic}, // 12.0 [2] (🦮..🦯) guide dog..probing cane - {0x1F9B0, 0x1F9B9, prExtendedPictographic}, // 11.0 [10] (🦰..🦹) red hair..supervillain - {0x1F9BA, 0x1F9BF, prExtendedPictographic}, // 12.0 [6] (🦺..🦿) safety vest..mechanical leg - {0x1F9C0, 0x1F9C0, prExtendedPictographic}, // 8.0 [1] (🧀) cheese wedge - {0x1F9C1, 0x1F9C2, prExtendedPictographic}, // 11.0 [2] (🧁..🧂) cupcake..salt - {0x1F9C3, 0x1F9CA, prExtendedPictographic}, // 12.0 [8] (🧃..🧊) beverage box..ice cube - {0x1F9CB, 0x1F9CC, prExtendedPictographic}, // NA [2] (🧋..🧌) .. - {0x1F9CD, 0x1F9CF, prExtendedPictographic}, // 12.0 [3] (🧍..🧏) person standing..deaf person - {0x1F9D0, 0x1F9E6, prExtendedPictographic}, // 10.0 [23] (🧐..🧦) face with monocle..socks - {0x1F9E7, 0x1F9FF, prExtendedPictographic}, // 11.0 [25] (🧧..🧿) red envelope..nazar amulet - {0x1FA00, 0x1FA53, prExtendedPictographic}, // 12.0 [84] (🨀..🩓) NEUTRAL CHESS KING..BLACK CHESS KNIGHT-BISHOP - {0x1FA54, 0x1FA5F, prExtendedPictographic}, // NA [12] (🩔..🩟) .. - {0x1FA60, 0x1FA6D, prExtendedPictographic}, // 11.0 [14] (🩠..🩭) XIANGQI RED GENERAL..XIANGQI BLACK SOLDIER - {0x1FA6E, 0x1FA6F, prExtendedPictographic}, // NA [2] (🩮..🩯) .. - {0x1FA70, 0x1FA73, prExtendedPictographic}, // 12.0 [4] (🩰..🩳) ballet shoes..shorts - {0x1FA74, 0x1FA77, prExtendedPictographic}, // NA [4] (🩴..🩷) .. - {0x1FA78, 0x1FA7A, prExtendedPictographic}, // 12.0 [3] (🩸..🩺) drop of blood..stethoscope - {0x1FA7B, 0x1FA7F, prExtendedPictographic}, // NA [5] (🩻..🩿) .. - {0x1FA80, 0x1FA82, prExtendedPictographic}, // 12.0 [3] (🪀..🪂) yo-yo..parachute - {0x1FA83, 0x1FA8F, prExtendedPictographic}, // NA [13] (🪃..🪏) .. - {0x1FA90, 0x1FA95, prExtendedPictographic}, // 12.0 [6] (🪐..🪕) ringed planet..banjo - {0x1FA96, 0x1FFFD, prExtendedPictographic}, // NA[1384] (🪖..🿽) .. - {0xE0000, 0xE0000, prControl}, // Cn - {0xE0001, 0xE0001, prControl}, // Cf LANGUAGE TAG - {0xE0002, 0xE001F, prControl}, // Cn [30] .. - {0xE0020, 0xE007F, prExtend}, // Cf [96] TAG SPACE..CANCEL TAG - {0xE0080, 0xE00FF, prControl}, // Cn [128] .. - {0xE0100, 0xE01EF, prExtend}, // Mn [240] VARIATION SELECTOR-17..VARIATION SELECTOR-256 - {0xE01F0, 0xE0FFF, prControl}, // Cn [3600] .. -} - -// property returns the Unicode property value (see constants above) of the -// given code point. -func property(r rune) int { - // Run a binary search. - from := 0 - to := len(codePoints) - for to > from { - middle := (from + to) / 2 - cpRange := codePoints[middle] - if int(r) < cpRange[0] { - to = middle - continue - } - if int(r) > cpRange[1] { - from = middle + 1 - continue - } - return cpRange[2] - } - return prAny -} diff --git a/vendor/golang.org/x/text/encoding/encoding.go b/vendor/golang.org/x/text/encoding/encoding.go deleted file mode 100644 index a0bd7cd4..00000000 --- a/vendor/golang.org/x/text/encoding/encoding.go +++ /dev/null @@ -1,335 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package encoding defines an interface for character encodings, such as Shift -// JIS and Windows 1252, that can convert to and from UTF-8. -// -// Encoding implementations are provided in other packages, such as -// golang.org/x/text/encoding/charmap and -// golang.org/x/text/encoding/japanese. -package encoding // import "golang.org/x/text/encoding" - -import ( - "errors" - "io" - "strconv" - "unicode/utf8" - - "golang.org/x/text/encoding/internal/identifier" - "golang.org/x/text/transform" -) - -// TODO: -// - There seems to be some inconsistency in when decoders return errors -// and when not. Also documentation seems to suggest they shouldn't return -// errors at all (except for UTF-16). -// - Encoders seem to rely on or at least benefit from the input being in NFC -// normal form. Perhaps add an example how users could prepare their output. - -// Encoding is a character set encoding that can be transformed to and from -// UTF-8. -type Encoding interface { - // NewDecoder returns a Decoder. - NewDecoder() *Decoder - - // NewEncoder returns an Encoder. - NewEncoder() *Encoder -} - -// A Decoder converts bytes to UTF-8. It implements transform.Transformer. -// -// Transforming source bytes that are not of that encoding will not result in an -// error per se. Each byte that cannot be transcoded will be represented in the -// output by the UTF-8 encoding of '\uFFFD', the replacement rune. -type Decoder struct { - transform.Transformer - - // This forces external creators of Decoders to use names in struct - // initializers, allowing for future extendibility without having to break - // code. - _ struct{} -} - -// Bytes converts the given encoded bytes to UTF-8. It returns the converted -// bytes or nil, err if any error occurred. -func (d *Decoder) Bytes(b []byte) ([]byte, error) { - b, _, err := transform.Bytes(d, b) - if err != nil { - return nil, err - } - return b, nil -} - -// String converts the given encoded string to UTF-8. It returns the converted -// string or "", err if any error occurred. -func (d *Decoder) String(s string) (string, error) { - s, _, err := transform.String(d, s) - if err != nil { - return "", err - } - return s, nil -} - -// Reader wraps another Reader to decode its bytes. -// -// The Decoder may not be used for any other operation as long as the returned -// Reader is in use. -func (d *Decoder) Reader(r io.Reader) io.Reader { - return transform.NewReader(r, d) -} - -// An Encoder converts bytes from UTF-8. It implements transform.Transformer. -// -// Each rune that cannot be transcoded will result in an error. In this case, -// the transform will consume all source byte up to, not including the offending -// rune. Transforming source bytes that are not valid UTF-8 will be replaced by -// `\uFFFD`. To return early with an error instead, use transform.Chain to -// preprocess the data with a UTF8Validator. -type Encoder struct { - transform.Transformer - - // This forces external creators of Encoders to use names in struct - // initializers, allowing for future extendibility without having to break - // code. - _ struct{} -} - -// Bytes converts bytes from UTF-8. It returns the converted bytes or nil, err if -// any error occurred. -func (e *Encoder) Bytes(b []byte) ([]byte, error) { - b, _, err := transform.Bytes(e, b) - if err != nil { - return nil, err - } - return b, nil -} - -// String converts a string from UTF-8. It returns the converted string or -// "", err if any error occurred. -func (e *Encoder) String(s string) (string, error) { - s, _, err := transform.String(e, s) - if err != nil { - return "", err - } - return s, nil -} - -// Writer wraps another Writer to encode its UTF-8 output. -// -// The Encoder may not be used for any other operation as long as the returned -// Writer is in use. -func (e *Encoder) Writer(w io.Writer) io.Writer { - return transform.NewWriter(w, e) -} - -// ASCIISub is the ASCII substitute character, as recommended by -// https://unicode.org/reports/tr36/#Text_Comparison -const ASCIISub = '\x1a' - -// Nop is the nop encoding. Its transformed bytes are the same as the source -// bytes; it does not replace invalid UTF-8 sequences. -var Nop Encoding = nop{} - -type nop struct{} - -func (nop) NewDecoder() *Decoder { - return &Decoder{Transformer: transform.Nop} -} -func (nop) NewEncoder() *Encoder { - return &Encoder{Transformer: transform.Nop} -} - -// Replacement is the replacement encoding. Decoding from the replacement -// encoding yields a single '\uFFFD' replacement rune. Encoding from UTF-8 to -// the replacement encoding yields the same as the source bytes except that -// invalid UTF-8 is converted to '\uFFFD'. -// -// It is defined at http://encoding.spec.whatwg.org/#replacement -var Replacement Encoding = replacement{} - -type replacement struct{} - -func (replacement) NewDecoder() *Decoder { - return &Decoder{Transformer: replacementDecoder{}} -} - -func (replacement) NewEncoder() *Encoder { - return &Encoder{Transformer: replacementEncoder{}} -} - -func (replacement) ID() (mib identifier.MIB, other string) { - return identifier.Replacement, "" -} - -type replacementDecoder struct{ transform.NopResetter } - -func (replacementDecoder) Transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error) { - if len(dst) < 3 { - return 0, 0, transform.ErrShortDst - } - if atEOF { - const fffd = "\ufffd" - dst[0] = fffd[0] - dst[1] = fffd[1] - dst[2] = fffd[2] - nDst = 3 - } - return nDst, len(src), nil -} - -type replacementEncoder struct{ transform.NopResetter } - -func (replacementEncoder) Transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error) { - r, size := rune(0), 0 - - for ; nSrc < len(src); nSrc += size { - r = rune(src[nSrc]) - - // Decode a 1-byte rune. - if r < utf8.RuneSelf { - size = 1 - - } else { - // Decode a multi-byte rune. - r, size = utf8.DecodeRune(src[nSrc:]) - if size == 1 { - // All valid runes of size 1 (those below utf8.RuneSelf) were - // handled above. We have invalid UTF-8 or we haven't seen the - // full character yet. - if !atEOF && !utf8.FullRune(src[nSrc:]) { - err = transform.ErrShortSrc - break - } - r = '\ufffd' - } - } - - if nDst+utf8.RuneLen(r) > len(dst) { - err = transform.ErrShortDst - break - } - nDst += utf8.EncodeRune(dst[nDst:], r) - } - return nDst, nSrc, err -} - -// HTMLEscapeUnsupported wraps encoders to replace source runes outside the -// repertoire of the destination encoding with HTML escape sequences. -// -// This wrapper exists to comply to URL and HTML forms requiring a -// non-terminating legacy encoder. The produced sequences may lead to data -// loss as they are indistinguishable from legitimate input. To avoid this -// issue, use UTF-8 encodings whenever possible. -func HTMLEscapeUnsupported(e *Encoder) *Encoder { - return &Encoder{Transformer: &errorHandler{e, errorToHTML}} -} - -// ReplaceUnsupported wraps encoders to replace source runes outside the -// repertoire of the destination encoding with an encoding-specific -// replacement. -// -// This wrapper is only provided for backwards compatibility and legacy -// handling. Its use is strongly discouraged. Use UTF-8 whenever possible. -func ReplaceUnsupported(e *Encoder) *Encoder { - return &Encoder{Transformer: &errorHandler{e, errorToReplacement}} -} - -type errorHandler struct { - *Encoder - handler func(dst []byte, r rune, err repertoireError) (n int, ok bool) -} - -// TODO: consider making this error public in some form. -type repertoireError interface { - Replacement() byte -} - -func (h errorHandler) Transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error) { - nDst, nSrc, err = h.Transformer.Transform(dst, src, atEOF) - for err != nil { - rerr, ok := err.(repertoireError) - if !ok { - return nDst, nSrc, err - } - r, sz := utf8.DecodeRune(src[nSrc:]) - n, ok := h.handler(dst[nDst:], r, rerr) - if !ok { - return nDst, nSrc, transform.ErrShortDst - } - err = nil - nDst += n - if nSrc += sz; nSrc < len(src) { - var dn, sn int - dn, sn, err = h.Transformer.Transform(dst[nDst:], src[nSrc:], atEOF) - nDst += dn - nSrc += sn - } - } - return nDst, nSrc, err -} - -func errorToHTML(dst []byte, r rune, err repertoireError) (n int, ok bool) { - buf := [8]byte{} - b := strconv.AppendUint(buf[:0], uint64(r), 10) - if n = len(b) + len("&#;"); n >= len(dst) { - return 0, false - } - dst[0] = '&' - dst[1] = '#' - dst[copy(dst[2:], b)+2] = ';' - return n, true -} - -func errorToReplacement(dst []byte, r rune, err repertoireError) (n int, ok bool) { - if len(dst) == 0 { - return 0, false - } - dst[0] = err.Replacement() - return 1, true -} - -// ErrInvalidUTF8 means that a transformer encountered invalid UTF-8. -var ErrInvalidUTF8 = errors.New("encoding: invalid UTF-8") - -// UTF8Validator is a transformer that returns ErrInvalidUTF8 on the first -// input byte that is not valid UTF-8. -var UTF8Validator transform.Transformer = utf8Validator{} - -type utf8Validator struct{ transform.NopResetter } - -func (utf8Validator) Transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error) { - n := len(src) - if n > len(dst) { - n = len(dst) - } - for i := 0; i < n; { - if c := src[i]; c < utf8.RuneSelf { - dst[i] = c - i++ - continue - } - _, size := utf8.DecodeRune(src[i:]) - if size == 1 { - // All valid runes of size 1 (those below utf8.RuneSelf) were - // handled above. We have invalid UTF-8 or we haven't seen the - // full character yet. - err = ErrInvalidUTF8 - if !atEOF && !utf8.FullRune(src[i:]) { - err = transform.ErrShortSrc - } - return i, i, err - } - if i+size > len(dst) { - return i, i, transform.ErrShortDst - } - for ; size > 0; size-- { - dst[i] = src[i] - i++ - } - } - if len(src) > len(dst) { - err = transform.ErrShortDst - } - return n, n, err -} diff --git a/vendor/golang.org/x/text/encoding/internal/identifier/identifier.go b/vendor/golang.org/x/text/encoding/internal/identifier/identifier.go deleted file mode 100644 index 5c9b85c2..00000000 --- a/vendor/golang.org/x/text/encoding/internal/identifier/identifier.go +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:generate go run gen.go - -// Package identifier defines the contract between implementations of Encoding -// and Index by defining identifiers that uniquely identify standardized coded -// character sets (CCS) and character encoding schemes (CES), which we will -// together refer to as encodings, for which Encoding implementations provide -// converters to and from UTF-8. This package is typically only of concern to -// implementers of Indexes and Encodings. -// -// One part of the identifier is the MIB code, which is defined by IANA and -// uniquely identifies a CCS or CES. Each code is associated with data that -// references authorities, official documentation as well as aliases and MIME -// names. -// -// Not all CESs are covered by the IANA registry. The "other" string that is -// returned by ID can be used to identify other character sets or versions of -// existing ones. -// -// It is recommended that each package that provides a set of Encodings provide -// the All and Common variables to reference all supported encodings and -// commonly used subset. This allows Index implementations to include all -// available encodings without explicitly referencing or knowing about them. -package identifier - -// Note: this package is internal, but could be made public if there is a need -// for writing third-party Indexes and Encodings. - -// References: -// - http://source.icu-project.org/repos/icu/icu/trunk/source/data/mappings/convrtrs.txt -// - http://www.iana.org/assignments/character-sets/character-sets.xhtml -// - http://www.iana.org/assignments/ianacharset-mib/ianacharset-mib -// - http://www.ietf.org/rfc/rfc2978.txt -// - https://www.unicode.org/reports/tr22/ -// - http://www.w3.org/TR/encoding/ -// - https://encoding.spec.whatwg.org/ -// - https://encoding.spec.whatwg.org/encodings.json -// - https://tools.ietf.org/html/rfc6657#section-5 - -// Interface can be implemented by Encodings to define the CCS or CES for which -// it implements conversions. -type Interface interface { - // ID returns an encoding identifier. Exactly one of the mib and other - // values should be non-zero. - // - // In the usual case it is only necessary to indicate the MIB code. The - // other string can be used to specify encodings for which there is no MIB, - // such as "x-mac-dingbat". - // - // The other string may only contain the characters a-z, A-Z, 0-9, - and _. - ID() (mib MIB, other string) - - // NOTE: the restrictions on the encoding are to allow extending the syntax - // with additional information such as versions, vendors and other variants. -} - -// A MIB identifies an encoding. It is derived from the IANA MIB codes and adds -// some identifiers for some encodings that are not covered by the IANA -// standard. -// -// See http://www.iana.org/assignments/ianacharset-mib. -type MIB uint16 - -// These additional MIB types are not defined in IANA. They are added because -// they are common and defined within the text repo. -const ( - // Unofficial marks the start of encodings not registered by IANA. - Unofficial MIB = 10000 + iota - - // Replacement is the WhatWG replacement encoding. - Replacement - - // XUserDefined is the code for x-user-defined. - XUserDefined - - // MacintoshCyrillic is the code for x-mac-cyrillic. - MacintoshCyrillic -) diff --git a/vendor/golang.org/x/text/encoding/internal/identifier/mib.go b/vendor/golang.org/x/text/encoding/internal/identifier/mib.go deleted file mode 100644 index fc7df1bc..00000000 --- a/vendor/golang.org/x/text/encoding/internal/identifier/mib.go +++ /dev/null @@ -1,1619 +0,0 @@ -// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. - -package identifier - -const ( - // ASCII is the MIB identifier with IANA name US-ASCII (MIME: US-ASCII). - // - // ANSI X3.4-1986 - // Reference: RFC2046 - ASCII MIB = 3 - - // ISOLatin1 is the MIB identifier with IANA name ISO_8859-1:1987 (MIME: ISO-8859-1). - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISOLatin1 MIB = 4 - - // ISOLatin2 is the MIB identifier with IANA name ISO_8859-2:1987 (MIME: ISO-8859-2). - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISOLatin2 MIB = 5 - - // ISOLatin3 is the MIB identifier with IANA name ISO_8859-3:1988 (MIME: ISO-8859-3). - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISOLatin3 MIB = 6 - - // ISOLatin4 is the MIB identifier with IANA name ISO_8859-4:1988 (MIME: ISO-8859-4). - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISOLatin4 MIB = 7 - - // ISOLatinCyrillic is the MIB identifier with IANA name ISO_8859-5:1988 (MIME: ISO-8859-5). - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISOLatinCyrillic MIB = 8 - - // ISOLatinArabic is the MIB identifier with IANA name ISO_8859-6:1987 (MIME: ISO-8859-6). - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISOLatinArabic MIB = 9 - - // ISOLatinGreek is the MIB identifier with IANA name ISO_8859-7:1987 (MIME: ISO-8859-7). - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1947 - // Reference: RFC1345 - ISOLatinGreek MIB = 10 - - // ISOLatinHebrew is the MIB identifier with IANA name ISO_8859-8:1988 (MIME: ISO-8859-8). - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISOLatinHebrew MIB = 11 - - // ISOLatin5 is the MIB identifier with IANA name ISO_8859-9:1989 (MIME: ISO-8859-9). - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISOLatin5 MIB = 12 - - // ISOLatin6 is the MIB identifier with IANA name ISO-8859-10 (MIME: ISO-8859-10). - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISOLatin6 MIB = 13 - - // ISOTextComm is the MIB identifier with IANA name ISO_6937-2-add. - // - // ISO-IR: International Register of Escape Sequences and ISO 6937-2:1983 - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISOTextComm MIB = 14 - - // HalfWidthKatakana is the MIB identifier with IANA name JIS_X0201. - // - // JIS X 0201-1976. One byte only, this is equivalent to - // JIS/Roman (similar to ASCII) plus eight-bit half-width - // Katakana - // Reference: RFC1345 - HalfWidthKatakana MIB = 15 - - // JISEncoding is the MIB identifier with IANA name JIS_Encoding. - // - // JIS X 0202-1991. Uses ISO 2022 escape sequences to - // shift code sets as documented in JIS X 0202-1991. - JISEncoding MIB = 16 - - // ShiftJIS is the MIB identifier with IANA name Shift_JIS (MIME: Shift_JIS). - // - // This charset is an extension of csHalfWidthKatakana by - // adding graphic characters in JIS X 0208. The CCS's are - // JIS X0201:1997 and JIS X0208:1997. The - // complete definition is shown in Appendix 1 of JIS - // X0208:1997. - // This charset can be used for the top-level media type "text". - ShiftJIS MIB = 17 - - // EUCPkdFmtJapanese is the MIB identifier with IANA name Extended_UNIX_Code_Packed_Format_for_Japanese (MIME: EUC-JP). - // - // Standardized by OSF, UNIX International, and UNIX Systems - // Laboratories Pacific. Uses ISO 2022 rules to select - // code set 0: US-ASCII (a single 7-bit byte set) - // code set 1: JIS X0208-1990 (a double 8-bit byte set) - // restricted to A0-FF in both bytes - // code set 2: Half Width Katakana (a single 7-bit byte set) - // requiring SS2 as the character prefix - // code set 3: JIS X0212-1990 (a double 7-bit byte set) - // restricted to A0-FF in both bytes - // requiring SS3 as the character prefix - EUCPkdFmtJapanese MIB = 18 - - // EUCFixWidJapanese is the MIB identifier with IANA name Extended_UNIX_Code_Fixed_Width_for_Japanese. - // - // Used in Japan. Each character is 2 octets. - // code set 0: US-ASCII (a single 7-bit byte set) - // 1st byte = 00 - // 2nd byte = 20-7E - // code set 1: JIS X0208-1990 (a double 7-bit byte set) - // restricted to A0-FF in both bytes - // code set 2: Half Width Katakana (a single 7-bit byte set) - // 1st byte = 00 - // 2nd byte = A0-FF - // code set 3: JIS X0212-1990 (a double 7-bit byte set) - // restricted to A0-FF in - // the first byte - // and 21-7E in the second byte - EUCFixWidJapanese MIB = 19 - - // ISO4UnitedKingdom is the MIB identifier with IANA name BS_4730. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO4UnitedKingdom MIB = 20 - - // ISO11SwedishForNames is the MIB identifier with IANA name SEN_850200_C. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO11SwedishForNames MIB = 21 - - // ISO15Italian is the MIB identifier with IANA name IT. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO15Italian MIB = 22 - - // ISO17Spanish is the MIB identifier with IANA name ES. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO17Spanish MIB = 23 - - // ISO21German is the MIB identifier with IANA name DIN_66003. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO21German MIB = 24 - - // ISO60Norwegian1 is the MIB identifier with IANA name NS_4551-1. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO60Norwegian1 MIB = 25 - - // ISO69French is the MIB identifier with IANA name NF_Z_62-010. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO69French MIB = 26 - - // ISO10646UTF1 is the MIB identifier with IANA name ISO-10646-UTF-1. - // - // Universal Transfer Format (1), this is the multibyte - // encoding, that subsets ASCII-7. It does not have byte - // ordering issues. - ISO10646UTF1 MIB = 27 - - // ISO646basic1983 is the MIB identifier with IANA name ISO_646.basic:1983. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO646basic1983 MIB = 28 - - // INVARIANT is the MIB identifier with IANA name INVARIANT. - // - // Reference: RFC1345 - INVARIANT MIB = 29 - - // ISO2IntlRefVersion is the MIB identifier with IANA name ISO_646.irv:1983. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO2IntlRefVersion MIB = 30 - - // NATSSEFI is the MIB identifier with IANA name NATS-SEFI. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - NATSSEFI MIB = 31 - - // NATSSEFIADD is the MIB identifier with IANA name NATS-SEFI-ADD. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - NATSSEFIADD MIB = 32 - - // NATSDANO is the MIB identifier with IANA name NATS-DANO. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - NATSDANO MIB = 33 - - // NATSDANOADD is the MIB identifier with IANA name NATS-DANO-ADD. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - NATSDANOADD MIB = 34 - - // ISO10Swedish is the MIB identifier with IANA name SEN_850200_B. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO10Swedish MIB = 35 - - // KSC56011987 is the MIB identifier with IANA name KS_C_5601-1987. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - KSC56011987 MIB = 36 - - // ISO2022KR is the MIB identifier with IANA name ISO-2022-KR (MIME: ISO-2022-KR). - // - // rfc1557 (see also KS_C_5601-1987) - // Reference: RFC1557 - ISO2022KR MIB = 37 - - // EUCKR is the MIB identifier with IANA name EUC-KR (MIME: EUC-KR). - // - // rfc1557 (see also KS_C_5861-1992) - // Reference: RFC1557 - EUCKR MIB = 38 - - // ISO2022JP is the MIB identifier with IANA name ISO-2022-JP (MIME: ISO-2022-JP). - // - // rfc1468 (see also rfc2237 ) - // Reference: RFC1468 - ISO2022JP MIB = 39 - - // ISO2022JP2 is the MIB identifier with IANA name ISO-2022-JP-2 (MIME: ISO-2022-JP-2). - // - // rfc1554 - // Reference: RFC1554 - ISO2022JP2 MIB = 40 - - // ISO13JISC6220jp is the MIB identifier with IANA name JIS_C6220-1969-jp. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO13JISC6220jp MIB = 41 - - // ISO14JISC6220ro is the MIB identifier with IANA name JIS_C6220-1969-ro. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO14JISC6220ro MIB = 42 - - // ISO16Portuguese is the MIB identifier with IANA name PT. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO16Portuguese MIB = 43 - - // ISO18Greek7Old is the MIB identifier with IANA name greek7-old. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO18Greek7Old MIB = 44 - - // ISO19LatinGreek is the MIB identifier with IANA name latin-greek. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO19LatinGreek MIB = 45 - - // ISO25French is the MIB identifier with IANA name NF_Z_62-010_(1973). - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO25French MIB = 46 - - // ISO27LatinGreek1 is the MIB identifier with IANA name Latin-greek-1. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO27LatinGreek1 MIB = 47 - - // ISO5427Cyrillic is the MIB identifier with IANA name ISO_5427. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO5427Cyrillic MIB = 48 - - // ISO42JISC62261978 is the MIB identifier with IANA name JIS_C6226-1978. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO42JISC62261978 MIB = 49 - - // ISO47BSViewdata is the MIB identifier with IANA name BS_viewdata. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO47BSViewdata MIB = 50 - - // ISO49INIS is the MIB identifier with IANA name INIS. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO49INIS MIB = 51 - - // ISO50INIS8 is the MIB identifier with IANA name INIS-8. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO50INIS8 MIB = 52 - - // ISO51INISCyrillic is the MIB identifier with IANA name INIS-cyrillic. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO51INISCyrillic MIB = 53 - - // ISO54271981 is the MIB identifier with IANA name ISO_5427:1981. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO54271981 MIB = 54 - - // ISO5428Greek is the MIB identifier with IANA name ISO_5428:1980. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO5428Greek MIB = 55 - - // ISO57GB1988 is the MIB identifier with IANA name GB_1988-80. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO57GB1988 MIB = 56 - - // ISO58GB231280 is the MIB identifier with IANA name GB_2312-80. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO58GB231280 MIB = 57 - - // ISO61Norwegian2 is the MIB identifier with IANA name NS_4551-2. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO61Norwegian2 MIB = 58 - - // ISO70VideotexSupp1 is the MIB identifier with IANA name videotex-suppl. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO70VideotexSupp1 MIB = 59 - - // ISO84Portuguese2 is the MIB identifier with IANA name PT2. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO84Portuguese2 MIB = 60 - - // ISO85Spanish2 is the MIB identifier with IANA name ES2. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO85Spanish2 MIB = 61 - - // ISO86Hungarian is the MIB identifier with IANA name MSZ_7795.3. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO86Hungarian MIB = 62 - - // ISO87JISX0208 is the MIB identifier with IANA name JIS_C6226-1983. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO87JISX0208 MIB = 63 - - // ISO88Greek7 is the MIB identifier with IANA name greek7. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO88Greek7 MIB = 64 - - // ISO89ASMO449 is the MIB identifier with IANA name ASMO_449. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO89ASMO449 MIB = 65 - - // ISO90 is the MIB identifier with IANA name iso-ir-90. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO90 MIB = 66 - - // ISO91JISC62291984a is the MIB identifier with IANA name JIS_C6229-1984-a. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO91JISC62291984a MIB = 67 - - // ISO92JISC62991984b is the MIB identifier with IANA name JIS_C6229-1984-b. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO92JISC62991984b MIB = 68 - - // ISO93JIS62291984badd is the MIB identifier with IANA name JIS_C6229-1984-b-add. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO93JIS62291984badd MIB = 69 - - // ISO94JIS62291984hand is the MIB identifier with IANA name JIS_C6229-1984-hand. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO94JIS62291984hand MIB = 70 - - // ISO95JIS62291984handadd is the MIB identifier with IANA name JIS_C6229-1984-hand-add. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO95JIS62291984handadd MIB = 71 - - // ISO96JISC62291984kana is the MIB identifier with IANA name JIS_C6229-1984-kana. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO96JISC62291984kana MIB = 72 - - // ISO2033 is the MIB identifier with IANA name ISO_2033-1983. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO2033 MIB = 73 - - // ISO99NAPLPS is the MIB identifier with IANA name ANSI_X3.110-1983. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO99NAPLPS MIB = 74 - - // ISO102T617bit is the MIB identifier with IANA name T.61-7bit. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO102T617bit MIB = 75 - - // ISO103T618bit is the MIB identifier with IANA name T.61-8bit. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO103T618bit MIB = 76 - - // ISO111ECMACyrillic is the MIB identifier with IANA name ECMA-cyrillic. - // - // ISO registry - ISO111ECMACyrillic MIB = 77 - - // ISO121Canadian1 is the MIB identifier with IANA name CSA_Z243.4-1985-1. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO121Canadian1 MIB = 78 - - // ISO122Canadian2 is the MIB identifier with IANA name CSA_Z243.4-1985-2. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO122Canadian2 MIB = 79 - - // ISO123CSAZ24341985gr is the MIB identifier with IANA name CSA_Z243.4-1985-gr. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO123CSAZ24341985gr MIB = 80 - - // ISO88596E is the MIB identifier with IANA name ISO_8859-6-E (MIME: ISO-8859-6-E). - // - // rfc1556 - // Reference: RFC1556 - ISO88596E MIB = 81 - - // ISO88596I is the MIB identifier with IANA name ISO_8859-6-I (MIME: ISO-8859-6-I). - // - // rfc1556 - // Reference: RFC1556 - ISO88596I MIB = 82 - - // ISO128T101G2 is the MIB identifier with IANA name T.101-G2. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO128T101G2 MIB = 83 - - // ISO88598E is the MIB identifier with IANA name ISO_8859-8-E (MIME: ISO-8859-8-E). - // - // rfc1556 - // Reference: RFC1556 - ISO88598E MIB = 84 - - // ISO88598I is the MIB identifier with IANA name ISO_8859-8-I (MIME: ISO-8859-8-I). - // - // rfc1556 - // Reference: RFC1556 - ISO88598I MIB = 85 - - // ISO139CSN369103 is the MIB identifier with IANA name CSN_369103. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO139CSN369103 MIB = 86 - - // ISO141JUSIB1002 is the MIB identifier with IANA name JUS_I.B1.002. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO141JUSIB1002 MIB = 87 - - // ISO143IECP271 is the MIB identifier with IANA name IEC_P27-1. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO143IECP271 MIB = 88 - - // ISO146Serbian is the MIB identifier with IANA name JUS_I.B1.003-serb. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO146Serbian MIB = 89 - - // ISO147Macedonian is the MIB identifier with IANA name JUS_I.B1.003-mac. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO147Macedonian MIB = 90 - - // ISO150GreekCCITT is the MIB identifier with IANA name greek-ccitt. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO150GreekCCITT MIB = 91 - - // ISO151Cuba is the MIB identifier with IANA name NC_NC00-10:81. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO151Cuba MIB = 92 - - // ISO6937Add is the MIB identifier with IANA name ISO_6937-2-25. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO6937Add MIB = 93 - - // ISO153GOST1976874 is the MIB identifier with IANA name GOST_19768-74. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO153GOST1976874 MIB = 94 - - // ISO8859Supp is the MIB identifier with IANA name ISO_8859-supp. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO8859Supp MIB = 95 - - // ISO10367Box is the MIB identifier with IANA name ISO_10367-box. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO10367Box MIB = 96 - - // ISO158Lap is the MIB identifier with IANA name latin-lap. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO158Lap MIB = 97 - - // ISO159JISX02121990 is the MIB identifier with IANA name JIS_X0212-1990. - // - // ISO-IR: International Register of Escape Sequences - // Note: The current registration authority is IPSJ/ITSCJ, Japan. - // Reference: RFC1345 - ISO159JISX02121990 MIB = 98 - - // ISO646Danish is the MIB identifier with IANA name DS_2089. - // - // Danish Standard, DS 2089, February 1974 - // Reference: RFC1345 - ISO646Danish MIB = 99 - - // USDK is the MIB identifier with IANA name us-dk. - // - // Reference: RFC1345 - USDK MIB = 100 - - // DKUS is the MIB identifier with IANA name dk-us. - // - // Reference: RFC1345 - DKUS MIB = 101 - - // KSC5636 is the MIB identifier with IANA name KSC5636. - // - // Reference: RFC1345 - KSC5636 MIB = 102 - - // Unicode11UTF7 is the MIB identifier with IANA name UNICODE-1-1-UTF-7. - // - // rfc1642 - // Reference: RFC1642 - Unicode11UTF7 MIB = 103 - - // ISO2022CN is the MIB identifier with IANA name ISO-2022-CN. - // - // rfc1922 - // Reference: RFC1922 - ISO2022CN MIB = 104 - - // ISO2022CNEXT is the MIB identifier with IANA name ISO-2022-CN-EXT. - // - // rfc1922 - // Reference: RFC1922 - ISO2022CNEXT MIB = 105 - - // UTF8 is the MIB identifier with IANA name UTF-8. - // - // rfc3629 - // Reference: RFC3629 - UTF8 MIB = 106 - - // ISO885913 is the MIB identifier with IANA name ISO-8859-13. - // - // ISO See https://www.iana.org/assignments/charset-reg/ISO-8859-13 https://www.iana.org/assignments/charset-reg/ISO-8859-13 - ISO885913 MIB = 109 - - // ISO885914 is the MIB identifier with IANA name ISO-8859-14. - // - // ISO See https://www.iana.org/assignments/charset-reg/ISO-8859-14 - ISO885914 MIB = 110 - - // ISO885915 is the MIB identifier with IANA name ISO-8859-15. - // - // ISO - // Please see: https://www.iana.org/assignments/charset-reg/ISO-8859-15 - ISO885915 MIB = 111 - - // ISO885916 is the MIB identifier with IANA name ISO-8859-16. - // - // ISO - ISO885916 MIB = 112 - - // GBK is the MIB identifier with IANA name GBK. - // - // Chinese IT Standardization Technical Committee - // Please see: https://www.iana.org/assignments/charset-reg/GBK - GBK MIB = 113 - - // GB18030 is the MIB identifier with IANA name GB18030. - // - // Chinese IT Standardization Technical Committee - // Please see: https://www.iana.org/assignments/charset-reg/GB18030 - GB18030 MIB = 114 - - // OSDEBCDICDF0415 is the MIB identifier with IANA name OSD_EBCDIC_DF04_15. - // - // Fujitsu-Siemens standard mainframe EBCDIC encoding - // Please see: https://www.iana.org/assignments/charset-reg/OSD-EBCDIC-DF04-15 - OSDEBCDICDF0415 MIB = 115 - - // OSDEBCDICDF03IRV is the MIB identifier with IANA name OSD_EBCDIC_DF03_IRV. - // - // Fujitsu-Siemens standard mainframe EBCDIC encoding - // Please see: https://www.iana.org/assignments/charset-reg/OSD-EBCDIC-DF03-IRV - OSDEBCDICDF03IRV MIB = 116 - - // OSDEBCDICDF041 is the MIB identifier with IANA name OSD_EBCDIC_DF04_1. - // - // Fujitsu-Siemens standard mainframe EBCDIC encoding - // Please see: https://www.iana.org/assignments/charset-reg/OSD-EBCDIC-DF04-1 - OSDEBCDICDF041 MIB = 117 - - // ISO115481 is the MIB identifier with IANA name ISO-11548-1. - // - // See https://www.iana.org/assignments/charset-reg/ISO-11548-1 - ISO115481 MIB = 118 - - // KZ1048 is the MIB identifier with IANA name KZ-1048. - // - // See https://www.iana.org/assignments/charset-reg/KZ-1048 - KZ1048 MIB = 119 - - // Unicode is the MIB identifier with IANA name ISO-10646-UCS-2. - // - // the 2-octet Basic Multilingual Plane, aka Unicode - // this needs to specify network byte order: the standard - // does not specify (it is a 16-bit integer space) - Unicode MIB = 1000 - - // UCS4 is the MIB identifier with IANA name ISO-10646-UCS-4. - // - // the full code space. (same comment about byte order, - // these are 31-bit numbers. - UCS4 MIB = 1001 - - // UnicodeASCII is the MIB identifier with IANA name ISO-10646-UCS-Basic. - // - // ASCII subset of Unicode. Basic Latin = collection 1 - // See ISO 10646, Appendix A - UnicodeASCII MIB = 1002 - - // UnicodeLatin1 is the MIB identifier with IANA name ISO-10646-Unicode-Latin1. - // - // ISO Latin-1 subset of Unicode. Basic Latin and Latin-1 - // Supplement = collections 1 and 2. See ISO 10646, - // Appendix A. See rfc1815 . - UnicodeLatin1 MIB = 1003 - - // UnicodeJapanese is the MIB identifier with IANA name ISO-10646-J-1. - // - // ISO 10646 Japanese, see rfc1815 . - UnicodeJapanese MIB = 1004 - - // UnicodeIBM1261 is the MIB identifier with IANA name ISO-Unicode-IBM-1261. - // - // IBM Latin-2, -3, -5, Extended Presentation Set, GCSGID: 1261 - UnicodeIBM1261 MIB = 1005 - - // UnicodeIBM1268 is the MIB identifier with IANA name ISO-Unicode-IBM-1268. - // - // IBM Latin-4 Extended Presentation Set, GCSGID: 1268 - UnicodeIBM1268 MIB = 1006 - - // UnicodeIBM1276 is the MIB identifier with IANA name ISO-Unicode-IBM-1276. - // - // IBM Cyrillic Greek Extended Presentation Set, GCSGID: 1276 - UnicodeIBM1276 MIB = 1007 - - // UnicodeIBM1264 is the MIB identifier with IANA name ISO-Unicode-IBM-1264. - // - // IBM Arabic Presentation Set, GCSGID: 1264 - UnicodeIBM1264 MIB = 1008 - - // UnicodeIBM1265 is the MIB identifier with IANA name ISO-Unicode-IBM-1265. - // - // IBM Hebrew Presentation Set, GCSGID: 1265 - UnicodeIBM1265 MIB = 1009 - - // Unicode11 is the MIB identifier with IANA name UNICODE-1-1. - // - // rfc1641 - // Reference: RFC1641 - Unicode11 MIB = 1010 - - // SCSU is the MIB identifier with IANA name SCSU. - // - // SCSU See https://www.iana.org/assignments/charset-reg/SCSU - SCSU MIB = 1011 - - // UTF7 is the MIB identifier with IANA name UTF-7. - // - // rfc2152 - // Reference: RFC2152 - UTF7 MIB = 1012 - - // UTF16BE is the MIB identifier with IANA name UTF-16BE. - // - // rfc2781 - // Reference: RFC2781 - UTF16BE MIB = 1013 - - // UTF16LE is the MIB identifier with IANA name UTF-16LE. - // - // rfc2781 - // Reference: RFC2781 - UTF16LE MIB = 1014 - - // UTF16 is the MIB identifier with IANA name UTF-16. - // - // rfc2781 - // Reference: RFC2781 - UTF16 MIB = 1015 - - // CESU8 is the MIB identifier with IANA name CESU-8. - // - // https://www.unicode.org/reports/tr26 - CESU8 MIB = 1016 - - // UTF32 is the MIB identifier with IANA name UTF-32. - // - // https://www.unicode.org/reports/tr19/ - UTF32 MIB = 1017 - - // UTF32BE is the MIB identifier with IANA name UTF-32BE. - // - // https://www.unicode.org/reports/tr19/ - UTF32BE MIB = 1018 - - // UTF32LE is the MIB identifier with IANA name UTF-32LE. - // - // https://www.unicode.org/reports/tr19/ - UTF32LE MIB = 1019 - - // BOCU1 is the MIB identifier with IANA name BOCU-1. - // - // https://www.unicode.org/notes/tn6/ - BOCU1 MIB = 1020 - - // Windows30Latin1 is the MIB identifier with IANA name ISO-8859-1-Windows-3.0-Latin-1. - // - // Extended ISO 8859-1 Latin-1 for Windows 3.0. - // PCL Symbol Set id: 9U - Windows30Latin1 MIB = 2000 - - // Windows31Latin1 is the MIB identifier with IANA name ISO-8859-1-Windows-3.1-Latin-1. - // - // Extended ISO 8859-1 Latin-1 for Windows 3.1. - // PCL Symbol Set id: 19U - Windows31Latin1 MIB = 2001 - - // Windows31Latin2 is the MIB identifier with IANA name ISO-8859-2-Windows-Latin-2. - // - // Extended ISO 8859-2. Latin-2 for Windows 3.1. - // PCL Symbol Set id: 9E - Windows31Latin2 MIB = 2002 - - // Windows31Latin5 is the MIB identifier with IANA name ISO-8859-9-Windows-Latin-5. - // - // Extended ISO 8859-9. Latin-5 for Windows 3.1 - // PCL Symbol Set id: 5T - Windows31Latin5 MIB = 2003 - - // HPRoman8 is the MIB identifier with IANA name hp-roman8. - // - // LaserJet IIP Printer User's Manual, - // HP part no 33471-90901, Hewlet-Packard, June 1989. - // Reference: RFC1345 - HPRoman8 MIB = 2004 - - // AdobeStandardEncoding is the MIB identifier with IANA name Adobe-Standard-Encoding. - // - // PostScript Language Reference Manual - // PCL Symbol Set id: 10J - AdobeStandardEncoding MIB = 2005 - - // VenturaUS is the MIB identifier with IANA name Ventura-US. - // - // Ventura US. ASCII plus characters typically used in - // publishing, like pilcrow, copyright, registered, trade mark, - // section, dagger, and double dagger in the range A0 (hex) - // to FF (hex). - // PCL Symbol Set id: 14J - VenturaUS MIB = 2006 - - // VenturaInternational is the MIB identifier with IANA name Ventura-International. - // - // Ventura International. ASCII plus coded characters similar - // to Roman8. - // PCL Symbol Set id: 13J - VenturaInternational MIB = 2007 - - // DECMCS is the MIB identifier with IANA name DEC-MCS. - // - // VAX/VMS User's Manual, - // Order Number: AI-Y517A-TE, April 1986. - // Reference: RFC1345 - DECMCS MIB = 2008 - - // PC850Multilingual is the MIB identifier with IANA name IBM850. - // - // IBM NLS RM Vol2 SE09-8002-01, March 1990 - // Reference: RFC1345 - PC850Multilingual MIB = 2009 - - // PC8DanishNorwegian is the MIB identifier with IANA name PC8-Danish-Norwegian. - // - // PC Danish Norwegian - // 8-bit PC set for Danish Norwegian - // PCL Symbol Set id: 11U - PC8DanishNorwegian MIB = 2012 - - // PC862LatinHebrew is the MIB identifier with IANA name IBM862. - // - // IBM NLS RM Vol2 SE09-8002-01, March 1990 - // Reference: RFC1345 - PC862LatinHebrew MIB = 2013 - - // PC8Turkish is the MIB identifier with IANA name PC8-Turkish. - // - // PC Latin Turkish. PCL Symbol Set id: 9T - PC8Turkish MIB = 2014 - - // IBMSymbols is the MIB identifier with IANA name IBM-Symbols. - // - // Presentation Set, CPGID: 259 - IBMSymbols MIB = 2015 - - // IBMThai is the MIB identifier with IANA name IBM-Thai. - // - // Presentation Set, CPGID: 838 - IBMThai MIB = 2016 - - // HPLegal is the MIB identifier with IANA name HP-Legal. - // - // PCL 5 Comparison Guide, Hewlett-Packard, - // HP part number 5961-0510, October 1992 - // PCL Symbol Set id: 1U - HPLegal MIB = 2017 - - // HPPiFont is the MIB identifier with IANA name HP-Pi-font. - // - // PCL 5 Comparison Guide, Hewlett-Packard, - // HP part number 5961-0510, October 1992 - // PCL Symbol Set id: 15U - HPPiFont MIB = 2018 - - // HPMath8 is the MIB identifier with IANA name HP-Math8. - // - // PCL 5 Comparison Guide, Hewlett-Packard, - // HP part number 5961-0510, October 1992 - // PCL Symbol Set id: 8M - HPMath8 MIB = 2019 - - // HPPSMath is the MIB identifier with IANA name Adobe-Symbol-Encoding. - // - // PostScript Language Reference Manual - // PCL Symbol Set id: 5M - HPPSMath MIB = 2020 - - // HPDesktop is the MIB identifier with IANA name HP-DeskTop. - // - // PCL 5 Comparison Guide, Hewlett-Packard, - // HP part number 5961-0510, October 1992 - // PCL Symbol Set id: 7J - HPDesktop MIB = 2021 - - // VenturaMath is the MIB identifier with IANA name Ventura-Math. - // - // PCL 5 Comparison Guide, Hewlett-Packard, - // HP part number 5961-0510, October 1992 - // PCL Symbol Set id: 6M - VenturaMath MIB = 2022 - - // MicrosoftPublishing is the MIB identifier with IANA name Microsoft-Publishing. - // - // PCL 5 Comparison Guide, Hewlett-Packard, - // HP part number 5961-0510, October 1992 - // PCL Symbol Set id: 6J - MicrosoftPublishing MIB = 2023 - - // Windows31J is the MIB identifier with IANA name Windows-31J. - // - // Windows Japanese. A further extension of Shift_JIS - // to include NEC special characters (Row 13), NEC - // selection of IBM extensions (Rows 89 to 92), and IBM - // extensions (Rows 115 to 119). The CCS's are - // JIS X0201:1997, JIS X0208:1997, and these extensions. - // This charset can be used for the top-level media type "text", - // but it is of limited or specialized use (see rfc2278 ). - // PCL Symbol Set id: 19K - Windows31J MIB = 2024 - - // GB2312 is the MIB identifier with IANA name GB2312 (MIME: GB2312). - // - // Chinese for People's Republic of China (PRC) mixed one byte, - // two byte set: - // 20-7E = one byte ASCII - // A1-FE = two byte PRC Kanji - // See GB 2312-80 - // PCL Symbol Set Id: 18C - GB2312 MIB = 2025 - - // Big5 is the MIB identifier with IANA name Big5 (MIME: Big5). - // - // Chinese for Taiwan Multi-byte set. - // PCL Symbol Set Id: 18T - Big5 MIB = 2026 - - // Macintosh is the MIB identifier with IANA name macintosh. - // - // The Unicode Standard ver1.0, ISBN 0-201-56788-1, Oct 1991 - // Reference: RFC1345 - Macintosh MIB = 2027 - - // IBM037 is the MIB identifier with IANA name IBM037. - // - // IBM NLS RM Vol2 SE09-8002-01, March 1990 - // Reference: RFC1345 - IBM037 MIB = 2028 - - // IBM038 is the MIB identifier with IANA name IBM038. - // - // IBM 3174 Character Set Ref, GA27-3831-02, March 1990 - // Reference: RFC1345 - IBM038 MIB = 2029 - - // IBM273 is the MIB identifier with IANA name IBM273. - // - // IBM NLS RM Vol2 SE09-8002-01, March 1990 - // Reference: RFC1345 - IBM273 MIB = 2030 - - // IBM274 is the MIB identifier with IANA name IBM274. - // - // IBM 3174 Character Set Ref, GA27-3831-02, March 1990 - // Reference: RFC1345 - IBM274 MIB = 2031 - - // IBM275 is the MIB identifier with IANA name IBM275. - // - // IBM NLS RM Vol2 SE09-8002-01, March 1990 - // Reference: RFC1345 - IBM275 MIB = 2032 - - // IBM277 is the MIB identifier with IANA name IBM277. - // - // IBM NLS RM Vol2 SE09-8002-01, March 1990 - // Reference: RFC1345 - IBM277 MIB = 2033 - - // IBM278 is the MIB identifier with IANA name IBM278. - // - // IBM NLS RM Vol2 SE09-8002-01, March 1990 - // Reference: RFC1345 - IBM278 MIB = 2034 - - // IBM280 is the MIB identifier with IANA name IBM280. - // - // IBM NLS RM Vol2 SE09-8002-01, March 1990 - // Reference: RFC1345 - IBM280 MIB = 2035 - - // IBM281 is the MIB identifier with IANA name IBM281. - // - // IBM 3174 Character Set Ref, GA27-3831-02, March 1990 - // Reference: RFC1345 - IBM281 MIB = 2036 - - // IBM284 is the MIB identifier with IANA name IBM284. - // - // IBM NLS RM Vol2 SE09-8002-01, March 1990 - // Reference: RFC1345 - IBM284 MIB = 2037 - - // IBM285 is the MIB identifier with IANA name IBM285. - // - // IBM NLS RM Vol2 SE09-8002-01, March 1990 - // Reference: RFC1345 - IBM285 MIB = 2038 - - // IBM290 is the MIB identifier with IANA name IBM290. - // - // IBM 3174 Character Set Ref, GA27-3831-02, March 1990 - // Reference: RFC1345 - IBM290 MIB = 2039 - - // IBM297 is the MIB identifier with IANA name IBM297. - // - // IBM NLS RM Vol2 SE09-8002-01, March 1990 - // Reference: RFC1345 - IBM297 MIB = 2040 - - // IBM420 is the MIB identifier with IANA name IBM420. - // - // IBM NLS RM Vol2 SE09-8002-01, March 1990, - // IBM NLS RM p 11-11 - // Reference: RFC1345 - IBM420 MIB = 2041 - - // IBM423 is the MIB identifier with IANA name IBM423. - // - // IBM NLS RM Vol2 SE09-8002-01, March 1990 - // Reference: RFC1345 - IBM423 MIB = 2042 - - // IBM424 is the MIB identifier with IANA name IBM424. - // - // IBM NLS RM Vol2 SE09-8002-01, March 1990 - // Reference: RFC1345 - IBM424 MIB = 2043 - - // PC8CodePage437 is the MIB identifier with IANA name IBM437. - // - // IBM NLS RM Vol2 SE09-8002-01, March 1990 - // Reference: RFC1345 - PC8CodePage437 MIB = 2011 - - // IBM500 is the MIB identifier with IANA name IBM500. - // - // IBM NLS RM Vol2 SE09-8002-01, March 1990 - // Reference: RFC1345 - IBM500 MIB = 2044 - - // IBM851 is the MIB identifier with IANA name IBM851. - // - // IBM NLS RM Vol2 SE09-8002-01, March 1990 - // Reference: RFC1345 - IBM851 MIB = 2045 - - // PCp852 is the MIB identifier with IANA name IBM852. - // - // IBM NLS RM Vol2 SE09-8002-01, March 1990 - // Reference: RFC1345 - PCp852 MIB = 2010 - - // IBM855 is the MIB identifier with IANA name IBM855. - // - // IBM NLS RM Vol2 SE09-8002-01, March 1990 - // Reference: RFC1345 - IBM855 MIB = 2046 - - // IBM857 is the MIB identifier with IANA name IBM857. - // - // IBM NLS RM Vol2 SE09-8002-01, March 1990 - // Reference: RFC1345 - IBM857 MIB = 2047 - - // IBM860 is the MIB identifier with IANA name IBM860. - // - // IBM NLS RM Vol2 SE09-8002-01, March 1990 - // Reference: RFC1345 - IBM860 MIB = 2048 - - // IBM861 is the MIB identifier with IANA name IBM861. - // - // IBM NLS RM Vol2 SE09-8002-01, March 1990 - // Reference: RFC1345 - IBM861 MIB = 2049 - - // IBM863 is the MIB identifier with IANA name IBM863. - // - // IBM Keyboard layouts and code pages, PN 07G4586 June 1991 - // Reference: RFC1345 - IBM863 MIB = 2050 - - // IBM864 is the MIB identifier with IANA name IBM864. - // - // IBM Keyboard layouts and code pages, PN 07G4586 June 1991 - // Reference: RFC1345 - IBM864 MIB = 2051 - - // IBM865 is the MIB identifier with IANA name IBM865. - // - // IBM DOS 3.3 Ref (Abridged), 94X9575 (Feb 1987) - // Reference: RFC1345 - IBM865 MIB = 2052 - - // IBM868 is the MIB identifier with IANA name IBM868. - // - // IBM NLS RM Vol2 SE09-8002-01, March 1990 - // Reference: RFC1345 - IBM868 MIB = 2053 - - // IBM869 is the MIB identifier with IANA name IBM869. - // - // IBM Keyboard layouts and code pages, PN 07G4586 June 1991 - // Reference: RFC1345 - IBM869 MIB = 2054 - - // IBM870 is the MIB identifier with IANA name IBM870. - // - // IBM NLS RM Vol2 SE09-8002-01, March 1990 - // Reference: RFC1345 - IBM870 MIB = 2055 - - // IBM871 is the MIB identifier with IANA name IBM871. - // - // IBM NLS RM Vol2 SE09-8002-01, March 1990 - // Reference: RFC1345 - IBM871 MIB = 2056 - - // IBM880 is the MIB identifier with IANA name IBM880. - // - // IBM NLS RM Vol2 SE09-8002-01, March 1990 - // Reference: RFC1345 - IBM880 MIB = 2057 - - // IBM891 is the MIB identifier with IANA name IBM891. - // - // IBM NLS RM Vol2 SE09-8002-01, March 1990 - // Reference: RFC1345 - IBM891 MIB = 2058 - - // IBM903 is the MIB identifier with IANA name IBM903. - // - // IBM NLS RM Vol2 SE09-8002-01, March 1990 - // Reference: RFC1345 - IBM903 MIB = 2059 - - // IBBM904 is the MIB identifier with IANA name IBM904. - // - // IBM NLS RM Vol2 SE09-8002-01, March 1990 - // Reference: RFC1345 - IBBM904 MIB = 2060 - - // IBM905 is the MIB identifier with IANA name IBM905. - // - // IBM 3174 Character Set Ref, GA27-3831-02, March 1990 - // Reference: RFC1345 - IBM905 MIB = 2061 - - // IBM918 is the MIB identifier with IANA name IBM918. - // - // IBM NLS RM Vol2 SE09-8002-01, March 1990 - // Reference: RFC1345 - IBM918 MIB = 2062 - - // IBM1026 is the MIB identifier with IANA name IBM1026. - // - // IBM NLS RM Vol2 SE09-8002-01, March 1990 - // Reference: RFC1345 - IBM1026 MIB = 2063 - - // IBMEBCDICATDE is the MIB identifier with IANA name EBCDIC-AT-DE. - // - // IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 - // Reference: RFC1345 - IBMEBCDICATDE MIB = 2064 - - // EBCDICATDEA is the MIB identifier with IANA name EBCDIC-AT-DE-A. - // - // IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 - // Reference: RFC1345 - EBCDICATDEA MIB = 2065 - - // EBCDICCAFR is the MIB identifier with IANA name EBCDIC-CA-FR. - // - // IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 - // Reference: RFC1345 - EBCDICCAFR MIB = 2066 - - // EBCDICDKNO is the MIB identifier with IANA name EBCDIC-DK-NO. - // - // IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 - // Reference: RFC1345 - EBCDICDKNO MIB = 2067 - - // EBCDICDKNOA is the MIB identifier with IANA name EBCDIC-DK-NO-A. - // - // IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 - // Reference: RFC1345 - EBCDICDKNOA MIB = 2068 - - // EBCDICFISE is the MIB identifier with IANA name EBCDIC-FI-SE. - // - // IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 - // Reference: RFC1345 - EBCDICFISE MIB = 2069 - - // EBCDICFISEA is the MIB identifier with IANA name EBCDIC-FI-SE-A. - // - // IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 - // Reference: RFC1345 - EBCDICFISEA MIB = 2070 - - // EBCDICFR is the MIB identifier with IANA name EBCDIC-FR. - // - // IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 - // Reference: RFC1345 - EBCDICFR MIB = 2071 - - // EBCDICIT is the MIB identifier with IANA name EBCDIC-IT. - // - // IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 - // Reference: RFC1345 - EBCDICIT MIB = 2072 - - // EBCDICPT is the MIB identifier with IANA name EBCDIC-PT. - // - // IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 - // Reference: RFC1345 - EBCDICPT MIB = 2073 - - // EBCDICES is the MIB identifier with IANA name EBCDIC-ES. - // - // IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 - // Reference: RFC1345 - EBCDICES MIB = 2074 - - // EBCDICESA is the MIB identifier with IANA name EBCDIC-ES-A. - // - // IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 - // Reference: RFC1345 - EBCDICESA MIB = 2075 - - // EBCDICESS is the MIB identifier with IANA name EBCDIC-ES-S. - // - // IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 - // Reference: RFC1345 - EBCDICESS MIB = 2076 - - // EBCDICUK is the MIB identifier with IANA name EBCDIC-UK. - // - // IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 - // Reference: RFC1345 - EBCDICUK MIB = 2077 - - // EBCDICUS is the MIB identifier with IANA name EBCDIC-US. - // - // IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 - // Reference: RFC1345 - EBCDICUS MIB = 2078 - - // Unknown8BiT is the MIB identifier with IANA name UNKNOWN-8BIT. - // - // Reference: RFC1428 - Unknown8BiT MIB = 2079 - - // Mnemonic is the MIB identifier with IANA name MNEMONIC. - // - // rfc1345 , also known as "mnemonic+ascii+38" - // Reference: RFC1345 - Mnemonic MIB = 2080 - - // Mnem is the MIB identifier with IANA name MNEM. - // - // rfc1345 , also known as "mnemonic+ascii+8200" - // Reference: RFC1345 - Mnem MIB = 2081 - - // VISCII is the MIB identifier with IANA name VISCII. - // - // rfc1456 - // Reference: RFC1456 - VISCII MIB = 2082 - - // VIQR is the MIB identifier with IANA name VIQR. - // - // rfc1456 - // Reference: RFC1456 - VIQR MIB = 2083 - - // KOI8R is the MIB identifier with IANA name KOI8-R (MIME: KOI8-R). - // - // rfc1489 , based on GOST-19768-74, ISO-6937/8, - // INIS-Cyrillic, ISO-5427. - // Reference: RFC1489 - KOI8R MIB = 2084 - - // HZGB2312 is the MIB identifier with IANA name HZ-GB-2312. - // - // rfc1842 , rfc1843 rfc1843 rfc1842 - HZGB2312 MIB = 2085 - - // IBM866 is the MIB identifier with IANA name IBM866. - // - // IBM NLDG Volume 2 (SE09-8002-03) August 1994 - IBM866 MIB = 2086 - - // PC775Baltic is the MIB identifier with IANA name IBM775. - // - // HP PCL 5 Comparison Guide (P/N 5021-0329) pp B-13, 1996 - PC775Baltic MIB = 2087 - - // KOI8U is the MIB identifier with IANA name KOI8-U. - // - // rfc2319 - // Reference: RFC2319 - KOI8U MIB = 2088 - - // IBM00858 is the MIB identifier with IANA name IBM00858. - // - // IBM See https://www.iana.org/assignments/charset-reg/IBM00858 - IBM00858 MIB = 2089 - - // IBM00924 is the MIB identifier with IANA name IBM00924. - // - // IBM See https://www.iana.org/assignments/charset-reg/IBM00924 - IBM00924 MIB = 2090 - - // IBM01140 is the MIB identifier with IANA name IBM01140. - // - // IBM See https://www.iana.org/assignments/charset-reg/IBM01140 - IBM01140 MIB = 2091 - - // IBM01141 is the MIB identifier with IANA name IBM01141. - // - // IBM See https://www.iana.org/assignments/charset-reg/IBM01141 - IBM01141 MIB = 2092 - - // IBM01142 is the MIB identifier with IANA name IBM01142. - // - // IBM See https://www.iana.org/assignments/charset-reg/IBM01142 - IBM01142 MIB = 2093 - - // IBM01143 is the MIB identifier with IANA name IBM01143. - // - // IBM See https://www.iana.org/assignments/charset-reg/IBM01143 - IBM01143 MIB = 2094 - - // IBM01144 is the MIB identifier with IANA name IBM01144. - // - // IBM See https://www.iana.org/assignments/charset-reg/IBM01144 - IBM01144 MIB = 2095 - - // IBM01145 is the MIB identifier with IANA name IBM01145. - // - // IBM See https://www.iana.org/assignments/charset-reg/IBM01145 - IBM01145 MIB = 2096 - - // IBM01146 is the MIB identifier with IANA name IBM01146. - // - // IBM See https://www.iana.org/assignments/charset-reg/IBM01146 - IBM01146 MIB = 2097 - - // IBM01147 is the MIB identifier with IANA name IBM01147. - // - // IBM See https://www.iana.org/assignments/charset-reg/IBM01147 - IBM01147 MIB = 2098 - - // IBM01148 is the MIB identifier with IANA name IBM01148. - // - // IBM See https://www.iana.org/assignments/charset-reg/IBM01148 - IBM01148 MIB = 2099 - - // IBM01149 is the MIB identifier with IANA name IBM01149. - // - // IBM See https://www.iana.org/assignments/charset-reg/IBM01149 - IBM01149 MIB = 2100 - - // Big5HKSCS is the MIB identifier with IANA name Big5-HKSCS. - // - // See https://www.iana.org/assignments/charset-reg/Big5-HKSCS - Big5HKSCS MIB = 2101 - - // IBM1047 is the MIB identifier with IANA name IBM1047. - // - // IBM1047 (EBCDIC Latin 1/Open Systems) https://www-1.ibm.com/servers/eserver/iseries/software/globalization/pdf/cp01047z.pdf - IBM1047 MIB = 2102 - - // PTCP154 is the MIB identifier with IANA name PTCP154. - // - // See https://www.iana.org/assignments/charset-reg/PTCP154 - PTCP154 MIB = 2103 - - // Amiga1251 is the MIB identifier with IANA name Amiga-1251. - // - // See https://www.amiga.ultranet.ru/Amiga-1251.html - Amiga1251 MIB = 2104 - - // KOI7switched is the MIB identifier with IANA name KOI7-switched. - // - // See https://www.iana.org/assignments/charset-reg/KOI7-switched - KOI7switched MIB = 2105 - - // BRF is the MIB identifier with IANA name BRF. - // - // See https://www.iana.org/assignments/charset-reg/BRF - BRF MIB = 2106 - - // TSCII is the MIB identifier with IANA name TSCII. - // - // See https://www.iana.org/assignments/charset-reg/TSCII - TSCII MIB = 2107 - - // CP51932 is the MIB identifier with IANA name CP51932. - // - // See https://www.iana.org/assignments/charset-reg/CP51932 - CP51932 MIB = 2108 - - // Windows874 is the MIB identifier with IANA name windows-874. - // - // See https://www.iana.org/assignments/charset-reg/windows-874 - Windows874 MIB = 2109 - - // Windows1250 is the MIB identifier with IANA name windows-1250. - // - // Microsoft https://www.iana.org/assignments/charset-reg/windows-1250 - Windows1250 MIB = 2250 - - // Windows1251 is the MIB identifier with IANA name windows-1251. - // - // Microsoft https://www.iana.org/assignments/charset-reg/windows-1251 - Windows1251 MIB = 2251 - - // Windows1252 is the MIB identifier with IANA name windows-1252. - // - // Microsoft https://www.iana.org/assignments/charset-reg/windows-1252 - Windows1252 MIB = 2252 - - // Windows1253 is the MIB identifier with IANA name windows-1253. - // - // Microsoft https://www.iana.org/assignments/charset-reg/windows-1253 - Windows1253 MIB = 2253 - - // Windows1254 is the MIB identifier with IANA name windows-1254. - // - // Microsoft https://www.iana.org/assignments/charset-reg/windows-1254 - Windows1254 MIB = 2254 - - // Windows1255 is the MIB identifier with IANA name windows-1255. - // - // Microsoft https://www.iana.org/assignments/charset-reg/windows-1255 - Windows1255 MIB = 2255 - - // Windows1256 is the MIB identifier with IANA name windows-1256. - // - // Microsoft https://www.iana.org/assignments/charset-reg/windows-1256 - Windows1256 MIB = 2256 - - // Windows1257 is the MIB identifier with IANA name windows-1257. - // - // Microsoft https://www.iana.org/assignments/charset-reg/windows-1257 - Windows1257 MIB = 2257 - - // Windows1258 is the MIB identifier with IANA name windows-1258. - // - // Microsoft https://www.iana.org/assignments/charset-reg/windows-1258 - Windows1258 MIB = 2258 - - // TIS620 is the MIB identifier with IANA name TIS-620. - // - // Thai Industrial Standards Institute (TISI) - TIS620 MIB = 2259 - - // CP50220 is the MIB identifier with IANA name CP50220. - // - // See https://www.iana.org/assignments/charset-reg/CP50220 - CP50220 MIB = 2260 -) diff --git a/vendor/modules.txt b/vendor/modules.txt index d18395cb..ef54d20e 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -88,61 +88,6 @@ github.com/flynn/go-shlex # github.com/fsnotify/fsnotify v1.4.9 ## explicit; go 1.13 github.com/fsnotify/fsnotify -# github.com/gdamore/encoding v1.0.0 -## explicit; go 1.9 -github.com/gdamore/encoding -# github.com/gdamore/tcell v1.3.0 -## explicit; go 1.12 -github.com/gdamore/tcell -github.com/gdamore/tcell/terminfo -github.com/gdamore/tcell/terminfo/a/adm3a -github.com/gdamore/tcell/terminfo/a/aixterm -github.com/gdamore/tcell/terminfo/a/alacritty -github.com/gdamore/tcell/terminfo/a/ansi -github.com/gdamore/tcell/terminfo/a/aterm -github.com/gdamore/tcell/terminfo/b/beterm -github.com/gdamore/tcell/terminfo/b/bsdos_pc -github.com/gdamore/tcell/terminfo/base -github.com/gdamore/tcell/terminfo/c/cygwin -github.com/gdamore/tcell/terminfo/d/d200 -github.com/gdamore/tcell/terminfo/d/d210 -github.com/gdamore/tcell/terminfo/d/dtterm -github.com/gdamore/tcell/terminfo/dynamic -github.com/gdamore/tcell/terminfo/e/emacs -github.com/gdamore/tcell/terminfo/e/eterm -github.com/gdamore/tcell/terminfo/extended -github.com/gdamore/tcell/terminfo/g/gnome -github.com/gdamore/tcell/terminfo/h/hpterm -github.com/gdamore/tcell/terminfo/h/hz1500 -github.com/gdamore/tcell/terminfo/k/konsole -github.com/gdamore/tcell/terminfo/k/kterm -github.com/gdamore/tcell/terminfo/l/linux -github.com/gdamore/tcell/terminfo/p/pcansi -github.com/gdamore/tcell/terminfo/r/rxvt -github.com/gdamore/tcell/terminfo/s/screen -github.com/gdamore/tcell/terminfo/s/simpleterm -github.com/gdamore/tcell/terminfo/s/sun -github.com/gdamore/tcell/terminfo/t/termite -github.com/gdamore/tcell/terminfo/t/tvi910 -github.com/gdamore/tcell/terminfo/t/tvi912 -github.com/gdamore/tcell/terminfo/t/tvi921 -github.com/gdamore/tcell/terminfo/t/tvi925 -github.com/gdamore/tcell/terminfo/t/tvi950 -github.com/gdamore/tcell/terminfo/t/tvi970 -github.com/gdamore/tcell/terminfo/v/vt100 -github.com/gdamore/tcell/terminfo/v/vt102 -github.com/gdamore/tcell/terminfo/v/vt220 -github.com/gdamore/tcell/terminfo/v/vt320 -github.com/gdamore/tcell/terminfo/v/vt400 -github.com/gdamore/tcell/terminfo/v/vt420 -github.com/gdamore/tcell/terminfo/v/vt52 -github.com/gdamore/tcell/terminfo/w/wy50 -github.com/gdamore/tcell/terminfo/w/wy60 -github.com/gdamore/tcell/terminfo/w/wy99_ansi -github.com/gdamore/tcell/terminfo/x/xfce -github.com/gdamore/tcell/terminfo/x/xnuppc -github.com/gdamore/tcell/terminfo/x/xterm -github.com/gdamore/tcell/terminfo/x/xterm_kitty # github.com/getsentry/raven-go v0.0.0-20180517221441-ed7bcb39ff10 ## explicit github.com/getsentry/raven-go @@ -216,9 +161,6 @@ github.com/lucas-clemente/quic-go/internal/utils github.com/lucas-clemente/quic-go/internal/wire github.com/lucas-clemente/quic-go/logging github.com/lucas-clemente/quic-go/quicvarint -# github.com/lucasb-eyer/go-colorful v1.0.3 -## explicit; go 1.12 -github.com/lucasb-eyer/go-colorful # github.com/marten-seemann/qtls-go1-16 v0.1.5 ## explicit; go 1.16 github.com/marten-seemann/qtls-go1-16 @@ -234,9 +176,6 @@ github.com/mattn/go-colorable # github.com/mattn/go-isatty v0.0.12 ## explicit; go 1.12 github.com/mattn/go-isatty -# github.com/mattn/go-runewidth v0.0.8 -## explicit; go 1.9 -github.com/mattn/go-runewidth # github.com/matttproud/golang_protobuf_extensions v1.0.1 ## explicit github.com/matttproud/golang_protobuf_extensions/pbutil @@ -318,12 +257,6 @@ github.com/prometheus/common/model github.com/prometheus/procfs github.com/prometheus/procfs/internal/fs github.com/prometheus/procfs/internal/util -# github.com/rivo/tview v0.0.0-20200712113419-c65badfc3d92 -## explicit; go 1.12 -github.com/rivo/tview -# github.com/rivo/uniseg v0.1.0 -## explicit; go 1.12 -github.com/rivo/uniseg # github.com/rs/zerolog v1.20.0 ## explicit github.com/rs/zerolog @@ -447,8 +380,6 @@ golang.org/x/sys/windows/svc/mgr golang.org/x/term # golang.org/x/text v0.3.7 ## explicit; go 1.17 -golang.org/x/text/encoding -golang.org/x/text/encoding/internal/identifier golang.org/x/text/secure/bidirule golang.org/x/text/transform golang.org/x/text/unicode/bidi