update pinyin_choose_candidate
authorPeng Wu <alexepico@gmail.com>
Tue, 17 Apr 2012 04:46:57 +0000 (12:46 +0800)
committerPeng Wu <alexepico@gmail.com>
Tue, 17 Apr 2012 04:46:57 +0000 (12:46 +0800)
src/pinyin.cpp
src/pinyin.h

index 2b20589..2cdd8e9 100644 (file)
@@ -823,7 +823,7 @@ int pinyin_choose_candidate(pinyin_instance_t * instance,
     bool retval = context->m_pinyin_lookup->validate_constraint
         (instance->m_constraints, instance->m_pinyin_keys) && len;
 
-    return len;
+    return offset + len;
 }
 
 bool pinyin_clear_constraint(pinyin_instance_t * instance,
index d4f14ce..3ac3aa0 100644 (file)
@@ -318,7 +318,7 @@ bool pinyin_get_full_pinyin_candidates(pinyin_instance_t * instance,
  * @instance: the pinyin instance.
  * @offset: the offset in the pinyin keys.
  * @token: the selected candidate.
- * @returns: the characters of the chosen candidate.
+ * @returns: the cursor after the chosen candidate.
  *
  * Choose an candidate at the offset.
  *