summaryrefslogtreecommitdiff
path: root/chess-ics1.el
diff options
context:
space:
mode:
authordickmao <dick.r.chiang@gmail.com>2018-08-27 17:00:35 -0400
committerdickmao <dick.r.chiang@gmail.com>2018-09-06 09:24:10 -0400
commit3222b53d942daa404852e5148ba9d3ebb8fe96d0 (patch)
tree37e2af6242423e57adbbc1238433f58c92ac9bd0 /chess-ics1.el
parent67339d896aa65d75272b80134a8128276c8c6a0f (diff)
Pre-moves
To activate, look for Chess Display Allow Pre Moves in: M-x customize-group chess-display Tested via: make test make test24 (requires evim)
Diffstat (limited to 'chess-ics1.el')
-rw-r--r--chess-ics1.el7
1 files changed, 6 insertions, 1 deletions
diff --git a/chess-ics1.el b/chess-ics1.el
index ec0c3ed..a5d572f 100644
--- a/chess-ics1.el
+++ b/chess-ics1.el
@@ -132,7 +132,8 @@ PERSPECTIVE is t for white or nil for black."
(goto-char pos)))
(defun chess-ics1-highlight (index &optional mode)
- (let ((pos (chess-display-index-pos nil index)))
+ (let ((pos (chess-display-index-pos nil index))
+ (piece (chess-pos-piece (chess-display-position nil) index)))
(put-text-property pos (save-excursion
(goto-char pos)
(skip-chars-forward "^|")
@@ -140,6 +141,10 @@ PERSPECTIVE is t for white or nil for black."
'face (cond
((eq mode :selected)
'chess-ics1-highlight-face)
+ ((eq mode :unselected)
+ (if (> piece ?a)
+ 'chess-ics1-black-face
+ 'chess-ics1-white-face))
(t
(chess-display-get-face mode))))))