mirror of
https://github.com/m00natic/vlfi.git
synced 2025-01-18 12:05:31 +00:00
Restore batch size after save with adjustment.
This commit is contained in:
parent
ee7409bfa5
commit
35ede9403c
22
vlf-write.el
22
vlf-write.el
@ -64,19 +64,21 @@ If changing size of chunk, shift remaining file content."
|
||||
(pos (point))
|
||||
(font-lock font-lock-mode))
|
||||
(font-lock-mode 0)
|
||||
(let ((time (float-time)))
|
||||
(let ((batch-size vlf-batch-size)
|
||||
(time (float-time)))
|
||||
(if (< 0 size-change)
|
||||
(vlf-file-shift-back 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))
|
||||
(vlf-move-to-chunk-2 vlf-start-pos
|
||||
(if (< (- vlf-end-pos vlf-start-pos)
|
||||
vlf-batch-size)
|
||||
(+ vlf-start-pos vlf-batch-size)
|
||||
vlf-end-pos))
|
||||
(vlf-update-buffer-name)
|
||||
(goto-char pos)))))
|
||||
(if font-lock (font-lock-mode 1))
|
||||
(setq vlf-batch-size batch-size)
|
||||
(vlf-move-to-chunk-2 vlf-start-pos
|
||||
(if (< (- vlf-end-pos vlf-start-pos)
|
||||
vlf-batch-size)
|
||||
(+ vlf-start-pos vlf-batch-size)
|
||||
vlf-end-pos))
|
||||
(vlf-update-buffer-name)
|
||||
(goto-char pos)
|
||||
(message "Save took %f seconds" (- (float-time) time)))))))
|
||||
(if hexl (vlf-tune-hexlify)))
|
||||
(run-hook-with-args 'vlf-after-batch-functions 'write))
|
||||
t)
|
||||
|
Loading…
x
Reference in New Issue
Block a user