summaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authorHuang Peng <shawn.p.huang@gmail.com>2008-08-29 07:52:52 +0800
committerHuang Peng <shawn.p.huang@gmail.com>2008-08-29 07:52:52 +0800
commita21b77eac885051faddb3aeb7e75b9264188b820 (patch)
treeaac819d0c908338a8f8f1994c05c0a133a38677c /engine
parentfb021459af202b62bf899448c64bafcf12299b11 (diff)
downloadibus-anthy-a21b77eac885051faddb3aeb7e75b9264188b820.tar.gz
Change cursor position to avoid candidate window swing.
Diffstat (limited to 'engine')
-rw-r--r--engine/engine.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/engine/engine.py b/engine/engine.py
index c38e2c9..3be35fd 100644
--- a/engine/engine.py
+++ b/engine/engine.py
@@ -424,16 +424,14 @@ class Engine(ibus.EngineBase):
i = 0
for seg_index, text in self.__segments:
self.__convert_chars += text
- if i <= self.__cursor_pos:
+ if i < self.__cursor_pos:
pos += len(text)
i += 1
-
attrs = ibus.AttrList()
attrs.append(ibus.AttributeUnderline(
ibus.ATTR_UNDERLINE_SINGLE, 0, len(self.__convert_chars)))
attrs.append(ibus.AttributeBackground(ibus.RGB(200, 200, 240),
- pos - len(self.__segments[self.__cursor_pos][1]),
- pos))
+ pos, pos + len(self.__segments[self.__cursor_pos][1])))
self.update_preedit(self.__convert_chars, attrs, pos, True)
aux_string = u"( %d / %d )" % (self.__lookup_table.get_cursor_pos() + 1, self.__lookup_table.get_number_of_candidates())
self.update_aux_string(aux_string,