1
0
mirror of https://github.com/m00natic/vlfi.git synced 2025-01-18 20:10:47 +00:00

Fix vlf-ediff at the borders of hexl buffers.

This commit is contained in:
Andrey Kotlarski 2014-10-07 13:20:04 +03:00
parent 673ae08848
commit ce13609f14
2 changed files with 24 additions and 24 deletions

View File

@ -92,10 +92,7 @@ If same as current chunk is requested, do nothing.
Return number of bytes moved back for proper decoding and number of Return number of bytes moved back for proper decoding and number of
bytes added to the end." bytes added to the end."
(vlf-verify-size) (vlf-verify-size)
(if (derived-mode-p 'hexl-mode) (if (or (<= end start) (<= end 0)
(setq start (- start (mod start hexl-bits))
end (+ end (- hexl-bits (mod end hexl-bits)))))
(cond ((or (<= end start) (<= end 0)
(<= vlf-file-size start)) (<= vlf-file-size start))
(when (or (not (buffer-modified-p)) (when (or (not (buffer-modified-p))
(y-or-n-p "Chunk modified, are you sure? ")) (y-or-n-p "Chunk modified, are you sure? "))
@ -107,8 +104,11 @@ bytes added to the end."
(setq vlf-start-pos place (setq vlf-start-pos place
vlf-end-pos place) vlf-end-pos place)
(or minimal (vlf-update-buffer-name)) (or minimal (vlf-update-buffer-name))
(cons (- start place) (- place end))))) (cons (- start place) (- place end))))
((or (/= start vlf-start-pos) (if (derived-mode-p 'hexl-mode)
(setq start (- start (mod start hexl-bits))
end (+ end (- hexl-bits (mod end hexl-bits)))))
(if (or (/= start vlf-start-pos)
(/= end vlf-end-pos)) (/= end vlf-end-pos))
(let ((shifts (vlf-move-to-chunk-1 start end))) (let ((shifts (vlf-move-to-chunk-1 start end)))
(and shifts (not minimal) (and shifts (not minimal)

View File

@ -217,9 +217,9 @@ logical chunks in case there is no difference at the current ones."
(vlf-move-to-chunk (- max-file-size (vlf-move-to-chunk (- max-file-size
vlf-batch-size) vlf-batch-size)
max-file-size)) max-file-size))
(vlf-beginning-of-file) (vlf-move-to-batch 0)
(set-buffer buffer-A) (set-buffer buffer-A)
(vlf-beginning-of-file)) (vlf-move-to-batch 0))
(set-buffer ediff-buffer) (set-buffer ediff-buffer)
(ediff-update-diffs) (ediff-update-diffs)
(or is-hexl (or is-hexl