Permalink
Browse files

Fix division by zero error when label key is typed just after enterin…

…g interactive bushu mode.

* scm/tutcode.scm
  - (tutcode-commit-by-label-key-for-prediction):
    Add check of zero before calling remainder.
  • Loading branch information...
KIHARA Hideto
KIHARA Hideto committed Jun 3, 2012
1 parent 9c1d59a commit db11e89e5b64a54baea6f86ed82fa4ff683c0b44
Showing with 1 addition and 1 deletion.
  1. +1 −1 scm/tutcode.scm
View
@@ -1546,7 +1546,7 @@
(nr (tutcode-lib-get-nr-predictions pc))
;; XXX:熟語ガイドのページ数の方が多い場合、
;; 補完候補はループして2順目以降の可能性あり(表形式candwinでない場合)
- (i (remainder idx nr)))
+ (i (if (zero? nr) -1 (remainder idx nr))))
(if (>= i 0)
(begin
(case mode

0 comments on commit db11e89

Please sign in to comment.