类型 TextEvent

API 文档由 Go 源码生成,内容为英文。

type TextEvent struct {
	Kind            TextEventKind
	Text            string
	Selection       TextRange
	MarkedSelection TextRange
	Replacement     TextRange
	HasReplacement  bool
	Command         TextCommand
}

TextEvent contains rune-indexed selection and replacement ranges.

方法

Apply#

func (event TextEvent) Apply(editor *text.Editor)

Apply routes one native text event into editor. The event kinds and commands are the platform's, value for value, so the one switch that maps them lives in internal/platform rather than in a second copy here.