@@ -71,8 +71,10 @@ func (p *textinputPlugin) InitPlugin(messenger plugin.BinaryMessenger) error {
7171 })
7272 // Ignored: This information is used by the flutter Web Engine
7373 p .channel .HandleFuncSync ("TextInput.setStyle" , func (_ interface {}) (interface {}, error ) { return nil , nil })
74- // Ignored: This information is used by the flutter Web Engine
74+ // Ignored: GLFW dosn't support setting the input method of the current cursor location #426
7575 p .channel .HandleFuncSync ("TextInput.setEditableSizeAndTransform" , func (_ interface {}) (interface {}, error ) { return nil , nil })
76+ // Ignored: GLFW dosn't support setting the input method of the current cursor location #426
77+ p .channel .HandleFuncSync ("TextInput.setMarkedTextRect" , func (_ interface {}) (interface {}, error ) { return nil , nil })
7678 // Ignored: This information is used by flutter on Android, iOS and web
7779 p .channel .HandleFuncSync ("TextInput.requestAutofill" , func (_ interface {}) (interface {}, error ) { return nil , nil })
7880
@@ -178,33 +180,6 @@ func (p *textinputPlugin) glfwKeyCallback(window *glfw.Window, key glfw.Key, sca
178180 // this action is described by argSetClientConf.
179181 p .performAction (p .clientConf .InputAction )
180182 }
181- // Backspace
182- if key == glfw .KeyBackspace {
183- // Selection Backspace
184- if p .removeSelectedText () {
185- p .updateEditingState ()
186- return
187- }
188- // Word Backspace
189- if keyboard .DetectWordMod (mods ) {
190- // Remove whitespace to the left
191- for p .ed .SelectionBase != 0 && unicode .IsSpace (utf16 .Decode ([]uint16 {p .ed .utf16Text [p .ed .SelectionBase - 1 ]})[0 ]) {
192- p .sliceLeftChar ()
193- }
194- // Remove non-whitespace to the left
195- for {
196- if p .ed .SelectionBase == 0 || unicode .IsSpace (utf16 .Decode ([]uint16 {p .ed .utf16Text [p .ed .SelectionBase - 1 ]})[0 ]) {
197- break
198- }
199- p .sliceLeftChar ()
200- }
201- p .updateEditingState ()
202- return
203- }
204- // single char Backspace
205- p .sliceLeftChar ()
206- p .updateEditingState ()
207- }
208183 // Mapping to some text navigation shortcut that are already implemented in
209184 // the flutter framework.
210185 // Home
@@ -284,16 +259,3 @@ func (p *textinputPlugin) getSelectedText() (int, int) {
284259 return selectionIndex [0 ],
285260 selectionIndex [1 ]
286261}
287-
288- func (p * textinputPlugin ) sliceLeftChar () {
289- if len (p .ed .utf16Text ) > 0 && p .ed .SelectionBase > 0 {
290- count := 1
291- // Check if code point appear in a surrogate pair
292- if utf16 .IsSurrogate (rune (p .ed .utf16Text [p .ed .SelectionBase - 1 ])) {
293- count = 2
294- }
295- p .ed .utf16Text = append (p .ed .utf16Text [:p .ed .SelectionBase - count ], p .ed .utf16Text [p .ed .SelectionBase :]... )
296- p .ed .SelectionBase -= count
297- p .ed .SelectionExtent = p .ed .SelectionBase
298- }
299- }
0 commit comments