Adjust overlay range
This commit is contained in:
parent
f15c83d0da
commit
2f2069041a
16
origami.el
16
origami.el
@ -176,12 +176,13 @@ contains point, or null."
|
|||||||
;;; overlay manipulation
|
;;; overlay manipulation
|
||||||
|
|
||||||
(defun origami-create-overlay (beg end buffer text)
|
(defun origami-create-overlay (beg end buffer text)
|
||||||
(let ((ov (make-overlay beg end buffer)))
|
(when (> (- end beg) 0)
|
||||||
(overlay-put ov 'invisible 'origami)
|
(let ((ov (make-overlay (+ beg 1) end buffer)))
|
||||||
;; TODO: make this customizable
|
(overlay-put ov 'invisible 'origami)
|
||||||
(overlay-put ov 'display text)
|
;; TODO: make this customizable
|
||||||
(overlay-put ov 'face 'font-lock-comment-delimiter-face)
|
(overlay-put ov 'display text)
|
||||||
ov))
|
(overlay-put ov 'face 'font-lock-comment-delimiter-face)
|
||||||
|
ov)))
|
||||||
|
|
||||||
(defun origami-create-overlay-for-node (node buffer)
|
(defun origami-create-overlay-for-node (node buffer)
|
||||||
(let ((overlay (origami-create-overlay (origami-fold-beg node)
|
(let ((overlay (origami-create-overlay (origami-fold-beg node)
|
||||||
@ -417,7 +418,8 @@ otherwise fetch cached tree."
|
|||||||
|
|
||||||
(defun origami-reset (buffer)
|
(defun origami-reset (buffer)
|
||||||
;; TODO: provide this to the user in case we get screwed up, maybe
|
;; TODO: provide this to the user in case we get screwed up, maybe
|
||||||
;; use this when disabling the minor mode?
|
;; use this when disabling the minor mode? Could possibly diff
|
||||||
|
;; against null?
|
||||||
(interactive)
|
(interactive)
|
||||||
(origami-remove-all-overlays buffer)
|
(origami-remove-all-overlays buffer)
|
||||||
;; TODO: remove fold ds
|
;; TODO: remove fold ds
|
||||||
|
Loading…
Reference in New Issue
Block a user