search

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMatchPosition

func GetMatchPosition(match Match) int

GetMatchPosition returns the viewport scroll position for a given match. This helps auto-scroll to the match location.

Types

type Match

type Match struct {
	FileName   string // File containing the match
	RowIndex   int    // Index in the DiffRow slice
	Side       string // "left" or "right"
	LineNumber int    // Line number in the file
	Column     int    // Column where match starts
	Length     int    // Length of the matched text
	Content    string // The line content containing the match
}

Match represents a search match in the diff.

func SearchInRows

func SearchInRows(rows []parser.DiffRow, query string, fileName string, caseSensitive bool) []Match

SearchInRows searches for a query string within a single file's diff rows. Returns all matches found in the current file.

Jump to

Keyboard shortcuts

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