summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeon Rische <leon.rische@me.com>2020-04-14 14:37:13 +0200
committerLeon Rische <leon.rische@me.com>2020-04-14 14:37:13 +0200
commitec452d4c5ee08f831e235dcd1c55872580998667 (patch)
treeea290ceb032e59cd500e0c8054c626bd11002cb4
parent264be5885359913f55c7e6f8faccff371bf2f893 (diff)
Fix reviewing of correct text-input cards
-rw-r--r--org-fc.el21
1 files changed, 11 insertions, 10 deletions
diff --git a/org-fc.el b/org-fc.el
index 7a2c342..cf3161a 100644
--- a/org-fc.el
+++ b/org-fc.el
@@ -397,7 +397,7 @@ If it is shorter than EXPECTED-LENGTH, it is filled using
(defun org-fc-diff (got expected)
"Generate a colored diff of the strings GOT and EXPECTED."
(if (string= got expected)
- (propertize got 'face 'org-fc-diff-correct)
+ (cons (propertize got 'face 'org-fc-diff-correct) nil)
(let ((blocks (org-fc-diff-matching-blocks
got expected
0 0
@@ -638,15 +638,16 @@ function is expected to be called with point on a heading."
(setq end (1- end)))
(org-fc-hide-region start end (car diff))
;; Overlay for expected answer, using the newline after the answer
- (org-fc-hide-region
- end (1+ end)
- (concat
- " (expected: "
- (if (null (car deemph))
- (cdr diff)
- (org-fc-emphasize
- (concat (car deemph) (cdr diff) (car deemph))))
- ")\n")))
+ (if (cdr diff)
+ (org-fc-hide-region
+ end (1+ end)
+ (concat
+ " (expected: "
+ (if (null (car deemph))
+ (cdr diff)
+ (org-fc-emphasize
+ (concat (car deemph) (cdr diff) (car deemph))))
+ ")\n"))))
;; Reveal answer & diff
(save-excursion
(org-show-subtree)