mirror of
https://github.com/m00natic/vlfi.git
synced 2025-01-31 02:00:47 +00:00
Don't ask needles questions on changing helm batch and restore undo
information when possible.
This commit is contained in:
parent
557d751f78
commit
569e4b2523
20
vlf-base.el
20
vlf-base.el
@ -126,12 +126,14 @@ bytes added to the end."
|
|||||||
(start (max 0 start))
|
(start (max 0 start))
|
||||||
(end (min end vlf-file-size))
|
(end (min end vlf-file-size))
|
||||||
(hexl (derived-mode-p 'hexl-mode))
|
(hexl (derived-mode-p 'hexl-mode))
|
||||||
(restore-hexl nil)
|
restore-hexl hexl-undo-list
|
||||||
(edit-end (if modified
|
(edit-end (if modified
|
||||||
(progn
|
(progn
|
||||||
(when hexl
|
(when hexl
|
||||||
(hexl-mode-exit)
|
(setq restore-hexl t
|
||||||
(setq restore-hexl t))
|
hexl-undo-list buffer-undo-list
|
||||||
|
buffer-undo-list t)
|
||||||
|
(hexl-mode-exit))
|
||||||
(+ vlf-start-pos
|
(+ vlf-start-pos
|
||||||
(length (encode-coding-region
|
(length (encode-coding-region
|
||||||
(point-min) (point-max)
|
(point-min) (point-max)
|
||||||
@ -144,10 +146,14 @@ bytes added to the end."
|
|||||||
(when (or (not modified)
|
(when (or (not modified)
|
||||||
(y-or-n-p "Chunk modified, are you sure? ")) ;full chunk renewal
|
(y-or-n-p "Chunk modified, are you sure? ")) ;full chunk renewal
|
||||||
(set-buffer-modified-p nil)
|
(set-buffer-modified-p nil)
|
||||||
|
(if (consp hexl-undo-list)
|
||||||
|
(setq hexl-undo-list nil))
|
||||||
(vlf-move-to-chunk-2 start end)))
|
(vlf-move-to-chunk-2 start end)))
|
||||||
((and (= start vlf-start-pos) (= end edit-end))
|
((and (= start vlf-start-pos) (= end edit-end))
|
||||||
(or modified
|
(unless modified
|
||||||
(vlf-move-to-chunk-2 start end)))
|
(if (consp hexl-undo-list)
|
||||||
|
(setq hexl-undo-list nil))
|
||||||
|
(vlf-move-to-chunk-2 start end)))
|
||||||
((or (and (<= start vlf-start-pos) (<= edit-end end))
|
((or (and (<= start vlf-start-pos) (<= edit-end end))
|
||||||
(not modified)
|
(not modified)
|
||||||
(y-or-n-p "Chunk modified, are you sure? "))
|
(y-or-n-p "Chunk modified, are you sure? "))
|
||||||
@ -222,7 +228,9 @@ bytes added to the end."
|
|||||||
(setq restore-hexl nil))
|
(setq restore-hexl nil))
|
||||||
(run-hooks 'vlf-after-chunk-update)
|
(run-hooks 'vlf-after-chunk-update)
|
||||||
(cons shift-start shift-end))))))
|
(cons shift-start shift-end))))))
|
||||||
(if restore-hexl (hexl-mode))
|
(when restore-hexl
|
||||||
|
(hexl-mode)
|
||||||
|
(setq buffer-undo-list hexl-undo-list))
|
||||||
shifts))
|
shifts))
|
||||||
|
|
||||||
(defun vlf-move-to-chunk-2 (start end)
|
(defun vlf-move-to-chunk-2 (start end)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user