summaryrefslogtreecommitdiffstats
path: root/src/PunctEditor.cc
diff options
context:
space:
mode:
authorPeng Huang <shawn.p.huang@gmail.com>2010-05-19 13:21:00 +0800
committerPeng Huang <shawn.p.huang@gmail.com>2010-05-19 13:21:00 +0800
commit5293d9fa8c71471c8fa7e94b05e4ea7bfdff2538 (patch)
treef32f0bbd017c636579ffdc46f8e32fbeda596fc2 /src/PunctEditor.cc
parentca5db95f90da616c7a9db0a57a2e9ae0a77d7dc0 (diff)
downloadibus-libpinyin-5293d9fa8c71471c8fa7e94b05e4ea7bfdff2538.tar.gz
ibus-libpinyin-5293d9fa8c71471c8fa7e94b05e4ea7bfdff2538.tar.xz
ibus-libpinyin-5293d9fa8c71471c8fa7e94b05e4ea7bfdff2538.zip
Clear the lookup table when cursor == 0
Diffstat (limited to 'src/PunctEditor.cc')
-rw-r--r--src/PunctEditor.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/PunctEditor.cc b/src/PunctEditor.cc
index 63bb6ff..46bb232 100644
--- a/src/PunctEditor.cc
+++ b/src/PunctEditor.cc
@@ -314,6 +314,7 @@ PunctEditor::moveCursorToBegin (void)
g_assert (m_punct_mode == MODE_NORMAL);
m_cursor = 0;
m_punct_candidates.clear ();
+ fillLookupTable ();
update ();
return TRUE;
@@ -367,6 +368,7 @@ PunctEditor::removeCharBefore (void)
}
else {
m_punct_candidates.clear ();
+ fillLookupTable ();
}
}
@@ -529,11 +531,10 @@ PunctEditor::updatePunctCandidates (gchar ch)
G_N_ELEMENTS (punct_table),
sizeof(punct_table[0]),
punct_cmp);
- if (brs == NULL)
- return;
-
- for (res = (*brs) + 1; *res != NULL; ++res) {
- m_punct_candidates.push_back (*res);
+ if (brs != NULL) {
+ for (res = (*brs) + 1; *res != NULL; ++res) {
+ m_punct_candidates.push_back (*res);
+ }
}
fillLookupTable ();
}