diff options
author | Leon Rische <leon.rische@me.com> | 2020-09-07 12:12:05 +0200 |
---|---|---|
committer | Leon Rische <leon.rische@me.com> | 2020-09-07 12:12:05 +0200 |
commit | ca9c4272b73dfaaa3863124e96a8d761568d72d1 (patch) | |
tree | 2cd30abf8f2779223dbb2c1325b5f2127e2dca9a | |
parent | f276b13ad837c4b866be4798ee7392158dd4adaf (diff) |
Rework setup & flipping of text input cards
-rw-r--r-- | org-fc.el | 22 |
1 files changed, 10 insertions, 12 deletions
@@ -699,18 +699,14 @@ function is expected to be called with point on a heading." (org-fc--init-card "text-input") (org-fc-review-data-update '("front"))) -(defvar org-fc-type-text-input--hidden '()) - (defun org-fc-type-text-input-setup (_position) "Prepare a text-input card for review." (interactive) ;; Hide answer - (if (org-fc-has-back-heading-p) - (progn - (org-show-subtree) - (setq org-fc-type-text-input--hidden (org-fc-hide-subheading "Back"))) - (setq org-fc-type-text-input--hidden nil) - (org-flag-subtree t)) + (outline-hide-subtree) + (when (org-fc-has-back-heading-p) + (org-show-entry) + (org-fc-with-point-at-back-heading (org-show-set-visibility 'minimal))) ;; Prompt user, create diff overlay (let* ((pos-content (org-fc-text-input-content)) (content (cdr pos-content)) @@ -736,10 +732,12 @@ function is expected to be called with point on a heading." ")\n")))) ;; Reveal answer & diff (save-excursion - (org-show-subtree) - (dolist (pos org-fc-type-text-input--hidden) - (goto-char pos) - (org-show-subtree)))) + (org-show-entry) + (org-show-children) + (org-fc-with-point-at-back-heading + (org-show-entry) + (org-show-children) + (org-fc-show-latex)))) (org-fc-register-type 'text-input |