mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
io/input,io/key: [API] replace SnippetOp with command
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+2
-5
@@ -554,7 +554,7 @@ func (e *Editor) Layout(gtx layout.Context, lt *text.Shaper, font font.Font, siz
|
||||
return e.layout(gtx, textMaterial, selectMaterial)
|
||||
}
|
||||
|
||||
// updateSnippet adds a key.SnippetOp if the snippet content or position
|
||||
// updateSnippet queues a key.SnippetCmd if the snippet content or position
|
||||
// have changed. off and len are in runes.
|
||||
func (e *Editor) updateSnippet(gtx layout.Context, start, end int) {
|
||||
if start > end {
|
||||
@@ -594,10 +594,7 @@ func (e *Editor) updateSnippet(gtx layout.Context, start, end int) {
|
||||
return
|
||||
}
|
||||
e.ime.snippet = newSnip
|
||||
key.SnippetOp{
|
||||
Tag: &e.eventKey,
|
||||
Snippet: newSnip,
|
||||
}.Add(gtx.Ops)
|
||||
gtx.Queue(key.SnippetCmd{Tag: &e.eventKey, Snippet: newSnip})
|
||||
}
|
||||
|
||||
func (e *Editor) layout(gtx layout.Context, textMaterial, selectMaterial op.CallOp) layout.Dimensions {
|
||||
|
||||
Reference in New Issue
Block a user