Skip to content

Commit

Permalink
Fix jongseong input bug `$ㅋㅕ + $ㅋㅕ = ㅋㅋ
Browse files Browse the repository at this point in the history
  • Loading branch information
Riey committed Oct 21, 2021
1 parent 76a583e commit f1097d7
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 17 deletions.
15 changes: 4 additions & 11 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [

{
"type": "lldb",
"request": "attach",
Expand All @@ -18,18 +17,12 @@
"program": "/nix/store/xayryd4aps8pw1v3xwq5g2pzw3lif6kk-gedit-40.1/bin/.gedit-wrapped"
},
{
"type": "lldb",
"type": "gdb",
"request": "launch",
"name": "Cargo test",
"cargo": {
"args": [
"test",
"--no-run",
"--lib"
]
},
"program": "${cargo:program}",
"args": []
"target": "/home/riey/repos/kime/target/debug/deps/sebeolsik_3sin_p2-b3402d3703139896",
"cwd": "${workspaceRoot}"
// "arguments": "double_jongseong --exact --nocapture",
},
{
"type": "lldb",
Expand Down
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* Fix preedit character error on chromium family [#535](https://github.com/Riey/kime/issues/535)
* Let incomplete character can commit multiple jamos
* Support johab encoding for preedit string
* Fix jongseong input bug `$ㅋㅕ + $ㅋㅕ = ㅋㅋ`

## 2.5.6

Expand Down
19 changes: 13 additions & 6 deletions src/engine/backends/hangul/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,14 +301,21 @@ impl CharacterState {
// 아 + $ㄴㅖ = 안
// ㅇ + $ㅜ + $ㅊㅔ = 웨
// ㅇ + ㅜ + $ㅊㅔ = 웇
if self.jung.map_or(true, |j| {
self.compose_jung && j.try_add(jung, addons).is_some()
}) {
// $ㅋ + $ㅋ$ㅕ = ㅋㅋ

if self.cho.is_none() && self.jung.is_none() {
if first {
self.jung(jung, compose_jung, addons)
} else {
self.jong(jong, addons)
}
} else if self.jung.map_or(
true,
|j| self.compose_jung && j.try_add(jung, addons).is_some(),
) {
self.jung(jung, compose_jung, addons)
} else if self.cho.is_some() || !first {
self.jong(jong, addons)
} else {
self.jung(jung, compose_jung, addons)
self.jong(jong, addons)
}
}

Expand Down

0 comments on commit f1097d7

Please sign in to comment.