configeditor

package
v0.26.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	FieldFile      = "file"
	FieldExtraArgs = "extraArgs"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Commander

type Commander interface {
	GetProfiles() map[string]*profile.Profile
	GetCurrentProfile() (string, *profile.Profile)
	FindProfiles(path string) ([]command.ProfileMatch, error)
	FS() (*command.FilteredFS, error)
}

type Config

type Config struct {
	CommonModel *common.CommonModel
}

type FilePicker

type FilePicker struct {
	// contains filtered or unexported fields
}

FilePicker is a form file file field.

func NewFilePicker

func NewFilePicker(base filepicker.Model) *FilePicker

NewFilePicker returns a new file field.

func (*FilePicker) Accessor

func (f *FilePicker) Accessor(accessor huh.Accessor[string]) *FilePicker

Accessor sets the accessor of the file field.

func (*FilePicker) AllowedTypes

func (f *FilePicker) AllowedTypes(types []string) *FilePicker

AllowedTypes sets the allowed types of the file field. These will be the only valid file types accepted, other files will show as disabled.

func (*FilePicker) Blur

func (f *FilePicker) Blur() tea.Cmd

Blur blurs the file field.

func (*FilePicker) CurrentDirectory

func (f *FilePicker) CurrentDirectory(directory string) *FilePicker

CurrentDirectory sets the directory of the file field.

func (*FilePicker) Cursor

func (f *FilePicker) Cursor(cursor string) *FilePicker

Cursor sets the cursor of the file field.

func (*FilePicker) Description

func (f *FilePicker) Description(description string) *FilePicker

Description sets the description of the file field.

func (*FilePicker) DirAllowed

func (f *FilePicker) DirAllowed(v bool) *FilePicker

DirAllowed sets whether to allow directories to be selected.

func (*FilePicker) Error

func (f *FilePicker) Error() error

Error returns the error of the file field.

func (*FilePicker) FileAllowed

func (f *FilePicker) FileAllowed(v bool) *FilePicker

FileAllowed sets whether to allow files to be selected.

func (*FilePicker) Focus

func (f *FilePicker) Focus() tea.Cmd

Focus focuses the file field.

func (*FilePicker) GetKey

func (f *FilePicker) GetKey() string

GetKey returns the key of the field.

func (*FilePicker) GetValue

func (f *FilePicker) GetValue() any

GetValue returns the value of the field.

func (*FilePicker) Height

func (f *FilePicker) Height(height int) *FilePicker

Height sets the height of the file field. If the number of options exceeds the height, the file field will become scrollable.

func (*FilePicker) Init

func (f *FilePicker) Init() tea.Cmd

Init initializes the file field.

func (*FilePicker) Key

func (f *FilePicker) Key(k string) *FilePicker

Key sets the key of the file field which can be used to retrieve the value after submission.

func (*FilePicker) KeyBinds

func (f *FilePicker) KeyBinds() []key.Binding

KeyBinds returns the help keybindings for the file field.

func (*FilePicker) Picking

func (f *FilePicker) Picking(v bool) *FilePicker

Picking sets whether the file picker should be in the picking files state.

func (*FilePicker) Run

func (f *FilePicker) Run() error

Run runs the file field.

func (*FilePicker) RunAccessible

func (f *FilePicker) RunAccessible(_ io.Writer, _ io.Reader) error

RunAccessible runs an accessible file field.

func (*FilePicker) ShowPermissions

func (f *FilePicker) ShowPermissions(v bool) *FilePicker

ShowPermissions sets whether to show file permissions.

func (*FilePicker) ShowSize

func (f *FilePicker) ShowSize(v bool) *FilePicker

ShowSize sets whether to show file sizes.

func (*FilePicker) Skip

func (*FilePicker) Skip() bool

Skip returns whether the file should be skipped or should be blocking.

func (*FilePicker) Title

func (f *FilePicker) Title(title string) *FilePicker

Title sets the title of the file field.

func (*FilePicker) Update

func (f *FilePicker) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update updates the file field.

func (*FilePicker) Validate

func (f *FilePicker) Validate(validate func(string) error) *FilePicker

Validate sets the validation function of the file field.

func (*FilePicker) Value

func (f *FilePicker) Value(value *string) *FilePicker

Value sets the value of the file field.

func (*FilePicker) View

func (f *FilePicker) View() string

View renders the file field.

func (*FilePicker) WithAccessible

func (f *FilePicker) WithAccessible(_ bool) huh.Field

func (*FilePicker) WithHeight

func (f *FilePicker) WithHeight(height int) huh.Field

WithHeight sets the height of the file field.

func (*FilePicker) WithKeyMap

func (f *FilePicker) WithKeyMap(k *huh.KeyMap) huh.Field

WithKeyMap sets the keymap on a file field.

func (*FilePicker) WithPosition

func (f *FilePicker) WithPosition(p huh.FieldPosition) huh.Field

WithPosition sets the position of the file field.

func (*FilePicker) WithTheme

func (f *FilePicker) WithTheme(theme *huh.Theme) huh.Field

WithTheme sets the theme of the file field.

func (*FilePicker) WithWidth

func (f *FilePicker) WithWidth(width int) huh.Field

WithWidth sets the width of the file field.

func (*FilePicker) Zoom

func (f *FilePicker) Zoom() bool

Zoom returns whether the input should be zoomed.

type Model

type Model struct {
	// contains filtered or unexported fields
}

func NewModel

func NewModel(cmd Commander, t *huh.Theme, km *huh.KeyMap) Model

func (Model) Focused

func (m Model) Focused() bool

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) IsCompleted

func (m Model) IsCompleted() bool

func (Model) Result

func (m Model) Result() Result

func (*Model) SetHeight

func (m *Model) SetHeight(h int)

func (Model) Update

func (m Model) Update(msg tea.Msg) (Model, tea.Cmd)

func (Model) View

func (m Model) View() string

type Result

type Result struct {
	File      string
	Profile   string
	ExtraArgs []string
}

Jump to

Keyboard shortcuts

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