From: Dmitry Gutov Date: Sat, 26 Jan 2013 20:43:33 +0000 (+0400) Subject: Fix an error that happened during vc-revert X-Git-Url: https://code.delx.au/gnu-emacs-elpa/commitdiff_plain/af0b8350779f1fd0f4d26f487034ae38b51dd06b Fix an error that happened during vc-revert --- diff --git a/diff-hl.el b/diff-hl.el index 82dcd5626..e9552d333 100644 --- a/diff-hl.el +++ b/diff-hl.el @@ -3,7 +3,7 @@ ;; Author: Dmitry Gutov ;; URL: https://github.com/dgutov/diff-hl ;; Keywords: vc, diff -;; Version: 1.3.4 +;; Version: 1.3.5 ;; This file is not part of GNU Emacs. @@ -198,10 +198,11 @@ (defun diff-hl-overlay-modified (ov after-p _beg _end &optional _length) "Delete the overlay and all our overlays inside it." (unless after-p - (save-restriction - (narrow-to-region (overlay-start ov) (overlay-end ov)) - (diff-hl-remove-overlays)) - (delete-overlay ov))) + (when (overlay-buffer ov) + (save-restriction + (narrow-to-region (overlay-start ov) (overlay-end ov)) + (diff-hl-remove-overlays)) + (delete-overlay ov)))) (defvar diff-hl-timer nil)