1
0
mirror of https://github.com/m00natic/vlfi.git synced 2024-10-05 18:30:51 +01:00

Fix whole file reload in read-only buffer on vlf-mode exit.

This commit is contained in:
Andrey Kotlarski 2014-12-13 18:37:31 +02:00
parent d1a6800b5b
commit 1c961f45b2

6
vlf.el
View File

@ -140,14 +140,16 @@ values are: `write', `ediff', `occur', `search', `goto-line'."
(if (consp buffer-undo-list)
(setq buffer-undo-list nil))
(vlf-with-undo-disabled
(let ((inhibit-read-only t))
(insert-file-contents-literally buffer-file-name
t nil nil t)
(hexlify-buffer))
(hexlify-buffer)))
(set-buffer-modified-p nil)
(goto-char (point-min))
(forward-line line)
(forward-char pos))
(let ((pos (+ vlf-start-pos (position-bytes (point)))))
(let ((pos (+ vlf-start-pos (position-bytes (point))))
(inhibit-read-only t))
(vlf-with-undo-disabled
(insert-file-contents buffer-file-name t nil nil t))
(goto-char (byte-to-position pos)))))