locale

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 26, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Is

func Is(c Cell, flag CharClass) bool

Types

type BreakPolicy

type BreakPolicy interface {
	IsBreakPoint(p2, p1, c rune) bool
}

type BreakRule

type BreakRule func(p2, p1, c rune) bool

type Bullet

type Bullet struct {
	Marker []byte
	Width  int
}

type Cell

type Cell struct {
	Ch    rune // int32
	Style tcell.Style
	Size  int
	Width int // screen cell width
	Class CharClass
}

Cell represents a single character Cell on screen.

func (*Cell) Clear

func (c *Cell) Clear()

func (*Cell) IsEmpty

func (m *Cell) IsEmpty() bool

type CharClass

type CharClass int
const (
	OTHER CharClass = 1 << iota
	CONTROLCODE
	TAB
	NEWLINE
	DEL
	EOF
	WORD // Treat it as a set of words
	NUMBER
	ALPHABET
	PROHIBITED
	DECIMAL_SEPARATOR
	WIDECHAR // 全角文字
	UPPERCASE
	SYMBOL
	SPACE
	HIRAGANA
	KATAKANA
)

type Locale

type Locale interface {
	LocaleName() string
	DisplayName() string

	GetCharClass(r rune) CharClass
	RuneWidth(r rune) int

	Bullets() []Bullet
	BreakPolicy() BreakPolicy
	WordPolicy() WordPolicy
}

type WordPolicy

type WordPolicy interface {
	Boundary(text []byte, cursor int) (start, end int, ok bool)
}

Jump to

Keyboard shortcuts

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