ui

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// Color formatter.
	Color = formatters.Register("Color", chroma.FormatterFunc(func(w io.Writer, s *chroma.Style, iterator chroma.Iterator) error {
		for t := iterator(); t != chroma.EOF; t = iterator() {
			colour := s.Get(t.Type).Colour
			backGroundColor = s.Get(t.Type).Background.String()
			var sb strings.Builder

			sb.WriteString("[")
			sb.WriteString(colour.String())
			sb.WriteString("]")
			sb.WriteString(t.Value)

			if _, err := w.Write([]byte(sb.String())); err != nil {
				return err
			}
		}
		return nil
	}))
)

Functions

func Colorize

func Colorize(partialFileContents string, fileContents string, filename string)

Types

type UI

type UI struct {
	App                    *tview.Application
	Label                  string
	EndOfOptionsSeparator  bool
	CommandText            *tview.TextView
	OptionsInput           *tview.InputField
	EndOptionsText         *tview.TextView
	OpeningQuoteText       *tview.TextView
	ArgumentsInput         *tview.InputField
	ArgumentsInputWide     *tview.TextArea
	ArgumentsInputWideFlex *tview.Flex
	ClosingQuoteText       *tview.TextView
	EndArgumentsText       *tview.TextView
	FileOptionsStdin       string
	FileOptionsText        *tview.TextView
	FileOptionsTreeNode    *tview.TreeNode
	FileOptionsTreeView    *tview.TreeView
	FileOptionsInputMap    map[string]bool
	FileOptionsInputSlice  []string
	OutputView             *tview.TextView
	FileView               *tview.TextView
	ChildFlex              *tview.Flex
	Flex                   *tview.Flex
	ActiveInput            **tview.InputField
	ActiveFlex             **tview.Flex
}

User interface

func NewUI

func NewUI(program string, respectsEndOfOptions bool, stdin string) *UI

UI constructor

func (*UI) InitUI

func (ui *UI) InitUI() error

Initialize UI

func (*UI) Run

func (ui *UI) Run() error

Run the application

Jump to

Keyboard shortcuts

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