Help us shape the future of Go! Take the 2026 Go Developer Survey

tui

package
v0.0.0-...-6e1c298 Latest Latest
Warning

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

Go to latest
Published: May 26, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package tui implements the interactive split-screen TUI for dconv.

Layout:

┌ header: input-format selector ──────────── output-format selector ─┐
│ left: textarea (editable)  │  right: viewport (syntax-highlighted)  │
│                             │                                        │
└ status bar: errors / hints / vi mode indicator ────────────────────┘

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(opts convert.Options, mode EditorMode) error

Run starts the TUI program.

Types

type EditorMode

type EditorMode int

EditorMode selects which key-binding style the input pane uses.

const (
	ModeDefault EditorMode = iota
	ModeVi
	ModeEmacs
)

type Model

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

Model is the root Bubble Tea model for the dconv TUI.

func New

func New(inputFmt, outputFmt format.Format, opts convert.Options, mode EditorMode) Model

New creates a ready-to-use TUI model.

func (Model) Init

func (m Model) Init() tea.Cmd

Init implements tea.Model.

func (Model) Update

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

Update implements tea.Model.

func (Model) View

func (m Model) View() string

View implements tea.Model.

type ViState

type ViState int

ViState tracks whether vi is in insert or normal mode.

const (
	ViInsert ViState = iota
	ViNormal
)

Jump to

Keyboard shortcuts

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