Skip to content

Commit 2a5ae05

Browse files
committed
fix: typos & fixes: #460
1 parent b27cd2e commit 2a5ae05

File tree

7 files changed

+16
-13
lines changed

7 files changed

+16
-13
lines changed

accessibility.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ var defaultAccessibilityPlugin = &accessibilityPlugin{}
99

1010
func (p *accessibilityPlugin) InitPlugin(messenger plugin.BinaryMessenger) error {
1111
channel := plugin.NewBasicMessageChannel(messenger, "flutter/accessibility", plugin.StandardMessageCodec{})
12-
// Ignored: go-flutter dosn't support accessibility events
12+
// Ignored: go-flutter doesn't support accessibility events
1313
channel.HandleFunc(func(_ interface{}) (interface{}, error) { return nil, nil })
1414
return nil
1515
}

go.mod

-1
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,4 @@ require (
1010
github.com/pkg/errors v0.9.1
1111
github.com/stretchr/testify v1.6.0
1212
golang.org/x/text v0.3.2
13-
gopkg.in/yaml.v2 v2.2.4 // indirect
1413
)

go.sum

+2-4
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIK
2323
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
2424
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
2525
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
26-
github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4=
27-
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
26+
github.com/stretchr/testify v1.6.0 h1:jlIyCplCJFULU/01vCkhKuTyc3OorI3bJFuw6obfgho=
2827
github.com/stretchr/testify v1.6.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
2928
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
3029
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
@@ -38,6 +37,5 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+
3837
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
3938
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
4039
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
41-
gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I=
42-
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
40+
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
4341
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

internal/keyboard/keyboard.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
)
1010

1111
// Event corresponds to a Flutter (dart) compatible RawKeyEventData keyevent data.
12-
// Multi-platform keycode translation is handled withing this package.
12+
// Multi-platform keycode translation is handled within this package.
1313
//
1414
// As input, go-flutter gets GLFW-keyevent who are only compatible with
1515
// RawKeyEventDataLinux. To fully support keyboard shortcut (like Command+C to

isolate.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ import "github.com/go-flutter-desktop/go-flutter/plugin"
44

55
type isolatePlugin struct{}
66

7-
// hardcoded because there is no swappable renderer interface.
7+
// hard-coded because there is no swappable renderer interface.
88
var defaultIsolatePlugin = &isolatePlugin{}
99

1010
func (p *isolatePlugin) InitPlugin(messenger plugin.BinaryMessenger) error {
1111
channel := plugin.NewBasicMessageChannel(messenger, "flutter/isolate", plugin.StringCodec{})
12-
// Ignored: go-flutter dosn't support isolate events
12+
// Ignored: go-flutter doesn't support isolate events
1313
channel.HandleFunc(func(_ interface{}) (interface{}, error) { return nil, nil })
1414
return nil
1515
}

plugin/method-channel.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ func (m *MethodChannel) HandleFuncSync(methodName string, f func(arguments inter
146146

147147
// ClearAllHandle clear all the handlers registered by
148148
// Handle\HandleFunc and HandleSync\HandleFuncSync.
149-
// ClearAllHandle dose not clear the handler registered by CatchAllHandle\CatchAllHandleFunc
149+
// ClearAllHandle doesn't not clear the handler registered by CatchAllHandle\CatchAllHandleFunc
150150
func (m *MethodChannel) ClearAllHandle() {
151151
m.methodsLock.Lock()
152152
m.methods = make(map[string]methodHandlerRegistration)

text-input.go

+9-3
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,15 @@ func (p *textinputPlugin) handleSetEditingState(arguments interface{}) (reply in
126126
p.ed.SelectionExtent < 0 ||
127127
p.ed.SelectionBase > utf16TextLen ||
128128
p.ed.SelectionExtent > utf16TextLen {
129-
// request a new EditingState
130-
err := p.channel.InvokeMethod("TextInputClient.requestExistingInputState", nil)
131-
return nil, err
129+
// request a new EditingState if text is present in the TextInput
130+
if p.ed.Text != "" {
131+
err := p.channel.InvokeMethod("TextInputClient.requestExistingInputState", nil)
132+
return nil, err
133+
}
134+
// otherwise, simply set sane default
135+
p.ed.SelectionBase = 0
136+
p.ed.SelectionExtent = 0
137+
return nil, nil
132138
}
133139

134140
return nil, nil

0 commit comments

Comments
 (0)