spellmodal

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package spellmodal provides an interactive spell check modal TUI component.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddPersonalMsg

type AddPersonalMsg struct{ Word string }

AddPersonalMsg is sent when the user adds a word to their personal dictionary.

type CloseMsg

type CloseMsg struct{}

CloseMsg is sent when the modal closes.

type CorrectionMsg

type CorrectionMsg struct {
	FilePath string
	Line     int
	OldWord  string
	NewWord  string
}

CorrectionMsg is sent when the user picks a suggestion.

type Model

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

Model is the spell check modal component.

func New

func New(filePath string, errors []SpellError, startIdx int) Model

New creates a new spell modal for the given errors, starting at startIdx.

func (*Model) SetSize

func (m *Model) SetSize(w, h int)

SetSize updates the modal dimensions.

func (Model) Update

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

Update handles key events for the spell modal.

func (Model) View

func (m Model) View() string

View renders the spell check modal.

type OpenMsg

type OpenMsg struct {
	FilePath string
	Errors   []SpellError
	// StartIdx is the index into Errors of the first error to show (at or after cursor).
	StartIdx int
}

OpenMsg is sent to open the spell check modal with a list of errors.

type SpellError

type SpellError struct {
	Line     int // 0-based raw line index
	StartCol int // rune column (start)
	EndCol   int // rune column (end, exclusive)
	Word     string
	Suggest  []string
}

SpellError describes a misspelled word at a specific location.

Jump to

Keyboard shortcuts

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