summaryrefslogtreecommitdiff
path: root/lisp/org/org-habit.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/org/org-habit.el')
-rw-r--r--lisp/org/org-habit.el10
1 files changed, 8 insertions, 2 deletions
diff --git a/lisp/org/org-habit.el b/lisp/org/org-habit.el
index a355d8e5faf..3ce806855c5 100644
--- a/lisp/org/org-habit.el
+++ b/lisp/org/org-habit.el
@@ -428,7 +428,8 @@ current time."
(save-excursion
(goto-char (if line (point-at-bol) (point-min)))
(while (not (eobp))
- (let ((habit (get-text-property (point) 'org-habit-p)))
+ (let ((habit (get-text-property (point) 'org-habit-p))
+ (invisible-prop (get-text-property (point) 'invisible)))
(when habit
(move-to-column org-habit-graph-column t)
(delete-char (min (+ 1 org-habit-preceding-days
@@ -439,7 +440,12 @@ current time."
habit
(time-subtract moment (days-to-time org-habit-preceding-days))
moment
- (time-add moment (days-to-time org-habit-following-days))))))
+ (time-add moment (days-to-time org-habit-following-days))))
+ ;; Inherit invisible state of hidden entries.
+ (when invisible-prop
+ (put-text-property
+ (- (point) org-habit-graph-column) (point)
+ 'invisible invisible-prop))))
(forward-line)))))
(defun org-habit-toggle-habits ()