searchmodal

package
v1.5.7 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package searchmodal is the full-text search modal TUI component.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyTheme

func ApplyTheme(accent, text, dim, help lipgloss.Color)

ApplyTheme updates the searchmodal style vars from theme colors.

Types

type Model

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

Model is the full-screen search modal component.

func New

func New(idx *vfiles.Index, cfg *config.Config) Model

New creates a new search modal with the given FTS index and config.

func (Model) IsSearching

func (m Model) IsSearching() bool

IsSearching reports whether a search is in progress.

func (*Model) SetIndex

func (m *Model) SetIndex(idx *vfiles.Index)

SetIndex updates the FTS index.

func (*Model) SetQuery

func (m *Model) SetQuery(q string)

SetQuery pre-fills the input and triggers a search.

func (*Model) SetSize

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

SetSize sets the available inner dimensions (excluding the surrounding border).

func (Model) StartSearch

func (m Model) StartSearch() tea.Cmd

StartSearch returns a tea.Cmd that executes the current query asynchronously. Call after SetQuery when the query is pre-filled.

func (Model) Update

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

Update handles messages for the search modal.

func (Model) View

func (m Model) View() string

View renders the search modal content

type OpenFileMsg

type OpenFileMsg struct{ Paths []string }

OpenFileMsg signals the parent to open one or more files. Empty Paths slice means close modal without opening anything.

type SearchDoneMsg

type SearchDoneMsg struct {
	Term    string
	Entries []vfiles.FileEntry
}

SearchDoneMsg is sent when an async search completes.

Jump to

Keyboard shortcuts

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