InputState // Recognize EmptyIgnoringPreviousState as Empty.
- The only difference is that EmptyIgnoringPreviousState doesn't commit the contents of the previous state.
This commit is contained in:
parent
910a047a5b
commit
13d2569919
|
@ -83,12 +83,8 @@ class InputState {
|
||||||
// MARK: -
|
// MARK: -
|
||||||
|
|
||||||
/// Represents that the composing buffer is empty.
|
/// Represents that the composing buffer is empty.
|
||||||
class EmptyIgnoringPreviousState: InputState {
|
class EmptyIgnoringPreviousState: Empty {
|
||||||
var composingBuffer: String {
|
override var description: String {
|
||||||
""
|
|
||||||
}
|
|
||||||
|
|
||||||
var description: String {
|
|
||||||
"<InputState.EmptyIgnoringPreviousState>"
|
"<InputState.EmptyIgnoringPreviousState>"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -308,7 +308,9 @@ extension ctlInputMethod {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if let previous = previous as? InputState.NotEmpty {
|
if let previous = previous as? InputState.NotEmpty,
|
||||||
|
!(state is InputState.EmptyIgnoringPreviousState)
|
||||||
|
{
|
||||||
commit(text: previous.composingBuffer, client: client)
|
commit(text: previous.composingBuffer, client: client)
|
||||||
}
|
}
|
||||||
client.setMarkedText(
|
client.setMarkedText(
|
||||||
|
|
Loading…
Reference in New Issue