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

Restore batch size after save with adjustment.

This commit is contained in:
Andrey Kotlarski 2014-09-07 00:07:21 +03:00
parent ee7409bfa5
commit 35ede9403c

View File

@ -64,19 +64,21 @@ If changing size of chunk, shift remaining file content."
(pos (point)) (pos (point))
(font-lock font-lock-mode)) (font-lock font-lock-mode))
(font-lock-mode 0) (font-lock-mode 0)
(let ((time (float-time))) (let ((batch-size vlf-batch-size)
(time (float-time)))
(if (< 0 size-change) (if (< 0 size-change)
(vlf-file-shift-back size-change region-length) (vlf-file-shift-back size-change region-length)
(vlf-file-shift-forward (- size-change) region-length)) (vlf-file-shift-forward (- size-change) region-length))
(message "Save took %f seconds" (- (float-time) time))) (if font-lock (font-lock-mode 1))
(if font-lock (font-lock-mode 1)) (setq vlf-batch-size batch-size)
(vlf-move-to-chunk-2 vlf-start-pos (vlf-move-to-chunk-2 vlf-start-pos
(if (< (- vlf-end-pos vlf-start-pos) (if (< (- vlf-end-pos vlf-start-pos)
vlf-batch-size) vlf-batch-size)
(+ vlf-start-pos vlf-batch-size) (+ vlf-start-pos vlf-batch-size)
vlf-end-pos)) vlf-end-pos))
(vlf-update-buffer-name) (vlf-update-buffer-name)
(goto-char pos))))) (goto-char pos)
(message "Save took %f seconds" (- (float-time) time)))))))
(if hexl (vlf-tune-hexlify))) (if hexl (vlf-tune-hexlify)))
(run-hook-with-args 'vlf-after-batch-functions 'write)) (run-hook-with-args 'vlf-after-batch-functions 'write))
t) t)