Revision: 7329
Author: deton.kih
Date: Tue Oct 18 03:55:37 2011
Log: * scm/tutcode.scm
- (tutcode-proc-state-bushu):
Fix error when next page key is typed twice on bushu prediction.
http://code.google.com/p/uim/source/detail?r=7329
Modified:
/trunk/scm/tutcode.scm
=======================================
--- /trunk/scm/tutcode.scm Sat Oct 15 23:36:40 2011
+++ /trunk/scm/tutcode.scm Tue Oct 18 03:55:37 2011
@@ -3503,7 +3503,13 @@
(rkc (tutcode-context-rk-context pc))
(res #f)
(predicting?
- (eq? (tutcode-context-predicting pc) 'tutcode-predicting-bushu)))
+ (eq? (tutcode-context-predicting pc) 'tutcode-predicting-bushu))
+ (re-predict
+ (lambda ()
+ (if tutcode-use-bushu-prediction?
+ (let ((prevchar (car (tutcode-context-head pc))))
+ (if (not (string=? prevchar "¢¥"))
+ (tutcode-check-bushu-prediction pc prevchar)))))))
(tutcode-reset-candidate-window pc)
(cond
((tutcode-off-key? key key-state)
@@ -3540,7 +3546,9 @@
(tutcode-commit pc res))
(tutcode-flush pc)
(if res (tutcode-check-auto-help-window-begin pc (list res)
()))
- (set! res #f))))
+ (set! res #f))
+ (if (not res)
+ (re-predict))))
((tutcode-cancel-key? key key-state)
;; ºÆµ¢ÅªÉô¼ó¹çÀ®ÊÑ´¹¤ò(¥¥ã¥ó¥»¥ë¤·¤Æ)°ìÃÊÌ᤹
(set! res (car (tutcode-context-head pc)))
@@ -3550,7 +3558,8 @@
(tutcode-context-set-head! pc (cdr (tutcode-context-head pc))))
(set! res #f)
(if (= (length (tutcode-context-head pc)) 0)
- (tutcode-flush pc)))
+ (tutcode-flush pc)
+ (re-predict)))
((tutcode-stroke-help-toggle-key? key key-state)
(tutcode-toggle-stroke-help pc))
((and predicting? (tutcode-next-page-key? key key-state))
@@ -3584,13 +3593,7 @@
((symbol? res) ;XXX Éô¼ó¹çÀ®ÊÑ´¹Ãæ¤Ï¸ò¤¼½ñ¤ÊÑ´¹Åù¤Ï̵¸ú¤Ë¤¹¤ë
(set! res #f)))))
(if res
- (tutcode-begin-bushu-conversion pc res)
- (if (and tutcode-use-bushu-prediction?
- (pair? (tutcode-context-head pc))
- (= (length (rk-context-seq rkc)) 0))
- (let ((prevchar (car (tutcode-context-head pc))))
- (if (not (string=? prevchar "¢¥"))
- (tutcode-check-bushu-prediction pc prevchar)))))))
+ (tutcode-begin-bushu-conversion pc res))))
;;; Éô¼ó¹çÀ®ÊÑ´¹³«»Ï
;;; @param char ¿·¤¿¤ËÆþÎϤµ¤ì¤¿Ê¸»ú(2ÈÖÌܤÎÉô¼ó)