mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-09 02:15:32 +00:00
handle delete with null context before
This commit is contained in:
parent
e5628b66fb
commit
a3202e0ff9
1 changed files with 6 additions and 1 deletions
|
|
@ -287,7 +287,7 @@ open class InputViewController: UIInputViewController, KeymanWebDelegate {
|
|||
return
|
||||
}
|
||||
|
||||
// What the actual heck, Apple. Apparently, in system-keyboard mode, this is also self-triggered if we erase back to a newline.
|
||||
// Apparently, in system-keyboard mode, this is also self-triggered if we erase back to a newline.
|
||||
// Refer to https://github.com/keymanapp/keyman/pull/2770 for context.
|
||||
if self.swallowBackspaceTextChange && Manager.shared.isSystemKeyboard && textDocumentProxy.documentContextBeforeInput == "\n" {
|
||||
self.swallowBackspaceTextChange = false
|
||||
|
|
@ -333,6 +333,11 @@ open class InputViewController: UIInputViewController, KeymanWebDelegate {
|
|||
return
|
||||
}
|
||||
|
||||
if numCharsToDelete > 0 && textDocumentProxy.documentContextBeforeInput == nil {
|
||||
textDocumentProxy.deleteBackward()
|
||||
return
|
||||
}
|
||||
|
||||
for _ in 0..<numCharsToDelete {
|
||||
let oldContext = textDocumentProxy.documentContextBeforeInput ?? ""
|
||||
textDocumentProxy.deleteBackward()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue