Skip to content
This repository was archived by the owner on Jan 7, 2023. It is now read-only.

Commit 7aeb7bd

Browse files
committed
Fix "ấn" + "]" should return "ấn]", not "aans]" in non-VN mode
Since "]" is a proper IM key, the check will pass and the fallback sequence will be returned.
1 parent f2fc054 commit 7aeb7bd

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

bogo/bogo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def default_return():
155155
# The prefix "_" means undo.
156156
for trans in map(lambda x: "_" + x, trans_list):
157157
new_comps = transform(new_comps, trans)
158-
158+
159159
# TODO refactor
160160
if config["input-method"] == "telex" and \
161161
len(fallback_sequence) >= 1 and \
@@ -173,7 +173,7 @@ def default_return():
173173

174174
logging.debug("%s, %s", utils.join(new_comps), fallback_sequence)
175175

176-
if config['skip-non-vietnamese'] == True and (key.isalpha() or key in im) and \
176+
if config['skip-non-vietnamese'] == True and key.isalpha() and \
177177
not is_valid_combination(new_comps, final_form=False):
178178
return fallback_sequence, fallback_sequence
179179
else:

test/test_engine.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def test_undo(self):
144144
def test_non_vn(self):
145145
def atomic(word):
146146
eq_(process_seq(word, config=c_non_vn), word)
147-
147+
148148
tests = [
149149
"system",
150150
"Virtualbox",
@@ -162,6 +162,7 @@ def atomic(word):
162162
yield atomic, test
163163

164164
eq_(process_seq_non_vn("aans."), "ấn.")
165+
eq_(process_seq_non_vn("aans]"), "ấn]")
165166
# eq_(process_seq_non_vn("aans.tuongwj"), "ấn.tượng")
166167
eq_(process_seq_non_vn("gi[f"), "giờ")
167168
eq_(process_seq_non_vn("taojc"), "taojc")

0 commit comments

Comments
 (0)