textedit

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2026 License: MIT Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package textedit implements the workspace's pure text and revision policy.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTooLarge   = errors.New("textedit: text exceeds byte limit")
	ErrText       = errors.New("textedit: invalid UTF-8 text")
	ErrMatch      = errors.New("textedit: expected unique exact match")
	ErrLineEnding = errors.New("textedit: line-ending change")
)

Functions

func Digest

func Digest(s string) string

Digest returns the SHA-256 of the exact text bytes.

func Edit

func Edit(old, oldText, newText string, maxBytes int) (string, error)

Edit computes one exact replacement. Inputs have already passed the caller's text checks; the resulting text and line endings are revalidated.

func ValidRevision

func ValidRevision(s string) bool

ValidRevision checks the canonical lowercase hexadecimal representation.

func Validate

func Validate(s string, maxBytes int) error

Validate checks the text and byte limit.

Types

This section is empty.

Jump to

Keyboard shortcuts

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