utils

package
v0.1.0-pre-release-v3.3 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByteOffsetToRuneIndex

func ByteOffsetToRuneIndex(line []byte, byteOffset int) int

ByteOffsetToRuneIndex converts a byte offset to a rune index in a byte slice.

func GetLeadingWhitespace

func GetLeadingWhitespace(line []byte) []byte

GetLeadingWhitespace returns the leading whitespace characters (spaces/tabs) from a byte slice.

func RuneIndexToByteOffset

func RuneIndexToByteOffset(line []byte, runeIndex int) int

RuneIndexToByteOffset converts a rune index to a byte offset in a byte slice. Returns -1 if runeIndex is out of bounds.

Types

type Debouncer

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

Debouncer provides a way to debounce function calls

func (*Debouncer) Debounce

func (d *Debouncer) Debounce(duration time.Duration, fn func())

Debounce calls the provided function after the specified duration, canceling any previous pending calls

Jump to

Keyboard shortcuts

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