Skip to content

Commit

Permalink
Don't compose choseong when FlexibleComposeOrder is on (#524)
Browse files Browse the repository at this point in the history
* Add flexible_compose_check_jungseong test

* Don't compose choseong when FlexibleComposeOrder is on

* Update CHANGELOG
  • Loading branch information
Riey authored Sep 17, 2021
1 parent 7f3ef08 commit a1d357a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
3 changes: 2 additions & 1 deletion docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

* Update dependencies [#508](https://github.com/Riey/kime/issues/508)
* Fix sebeolsik-3sin-p2 '"' character [#509](https://github.com/Riey/kime/issues/509)
* Fix sebeolsik-391 "S-F" key [#509](https://github.com/Riey/kime/issues/521)
* Fix sebeolsik-391 "S-F" key [#521](https://github.com/Riey/kime/issues/521)
* Don't compose choseong when FlexibleComposeOrder is on [#520](https://github.com/Riey/kime/issues/520)

## 2.5.5

Expand Down
4 changes: 1 addition & 3 deletions src/engine/backends/hangul/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,9 +292,7 @@ impl CharacterState {
})
} else {
match prev_cho.try_add(cho, addons) {
Some(new)
if addons.contains(Addon::FlexibleComposeOrder) || self.jung.is_none() =>
{
Some(new) if self.jung.is_none() => {
self.cho = Some(new);
CharacterResult::Consume
}
Expand Down
13 changes: 13 additions & 0 deletions src/engine/core/tests/sebeolsik_3_91.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,16 @@ fn issue_521() {
fn colon() {
test_input(&[(Key::normal(Backslash), "", ":")]);
}

// https://github.com/Riey/kime/issues/520
#[test]
fn flexible_compose_check_jungseong() {
test_input_with_addon(
&[
(Key::normal(N), "ㅅ", ""),
(Key::normal(F), "사", ""),
(Key::normal(N), "ㅅ", "사"),
],
Addon::FlexibleComposeOrder | Addon::ComposeChoseongSsang,
);
}

0 comments on commit a1d357a

Please sign in to comment.