* diff-hl-dired-highlight-items: Make sure the overlay will disappear
if the file is deleted.
(goto-char (point-min))
(when (and type (dired-goto-file-1
file (expand-file-name file) nil))
- (forward-line 0)
- (let ((diff-hl-fringe-bmp-function 'diff-hl-fringe-bmp-from-type))
- (diff-hl-add-highlighting type 'single)))))))
+ (let* ((diff-hl-fringe-bmp-function 'diff-hl-fringe-bmp-from-type)
+ (o (diff-hl-add-highlighting type 'single)))
+ (overlay-put o 'modification-hooks '(diff-hl-overlay-modified))
+ ))))))
(defalias 'diff-hl-dired-clear 'diff-hl-remove-overlays)
(defun diff-hl-add-highlighting (type shape)\r
(let ((o (make-overlay (point) (point))))\r
(overlay-put o 'diff-hl t)\r
- (overlay-put o 'before-string (diff-hl-fringe-spec type shape))))\r
+ (overlay-put o 'before-string (diff-hl-fringe-spec type shape))\r
+ o))\r
\r
(defun diff-hl-remove-overlays ()\r
(dolist (o (overlays-in (point-min) (point-max)))\r