mirror of
https://github.com/m00natic/vlfi.git
synced 2025-01-31 02:00:47 +00:00
Temporarily disable font-lock during multiple batch operations.
This commit is contained in:
parent
1a1ce27d37
commit
f83a212c52
10
vlf-ediff.el
10
vlf-ediff.el
@ -158,19 +158,23 @@ logical chunks in case there is no difference at the current ones."
|
|||||||
(let ((end-A (= vlf-start-pos vlf-end-pos))
|
(let ((end-A (= vlf-start-pos vlf-end-pos))
|
||||||
(chunk-A (cons vlf-start-pos vlf-end-pos))
|
(chunk-A (cons vlf-start-pos vlf-end-pos))
|
||||||
(point-max-A (point-max))
|
(point-max-A (point-max))
|
||||||
|
(font-lock-A font-lock-mode)
|
||||||
(min-file-size vlf-file-size)
|
(min-file-size vlf-file-size)
|
||||||
(forward-p (eq next-func 'vlf-next-chunk)))
|
(forward-p (eq next-func 'vlf-next-chunk)))
|
||||||
|
(font-lock-mode 0)
|
||||||
(set-buffer buffer-B)
|
(set-buffer buffer-B)
|
||||||
(setq buffer-B (current-buffer)
|
(setq buffer-B (current-buffer)
|
||||||
min-file-size (min min-file-size vlf-file-size))
|
min-file-size (min min-file-size vlf-file-size))
|
||||||
(let ((end-B (= vlf-start-pos vlf-end-pos))
|
(let ((end-B (= vlf-start-pos vlf-end-pos))
|
||||||
(chunk-B (cons vlf-start-pos vlf-end-pos))
|
(chunk-B (cons vlf-start-pos vlf-end-pos))
|
||||||
|
(font-lock-B font-lock-mode)
|
||||||
(done nil)
|
(done nil)
|
||||||
(reporter (make-progress-reporter
|
(reporter (make-progress-reporter
|
||||||
"Searching for difference..."
|
"Searching for difference..."
|
||||||
(if forward-p vlf-start-pos
|
(if forward-p vlf-start-pos
|
||||||
(- min-file-size vlf-end-pos))
|
(- min-file-size vlf-end-pos))
|
||||||
min-file-size)))
|
min-file-size)))
|
||||||
|
(font-lock-mode 0)
|
||||||
(unwind-protect
|
(unwind-protect
|
||||||
(progn
|
(progn
|
||||||
(while (and (or (not end-A) (not end-B))
|
(while (and (or (not end-A) (not end-B))
|
||||||
@ -217,6 +221,12 @@ logical chunks in case there is no difference at the current ones."
|
|||||||
(and (not end-A) (not end-B)))
|
(and (not end-A) (not end-B)))
|
||||||
(vlf-ediff-refine buffer-A buffer-B)))
|
(vlf-ediff-refine buffer-A buffer-B)))
|
||||||
(setq done t))
|
(setq done t))
|
||||||
|
(when font-lock-A
|
||||||
|
(set-buffer buffer-A)
|
||||||
|
(font-lock-mode 1))
|
||||||
|
(when font-lock-B
|
||||||
|
(set-buffer buffer-B)
|
||||||
|
(font-lock-mode 1))
|
||||||
(unless done
|
(unless done
|
||||||
(set-buffer buffer-A)
|
(set-buffer buffer-A)
|
||||||
(set-buffer-modified-p nil)
|
(set-buffer-modified-p nil)
|
||||||
|
@ -40,12 +40,14 @@ BATCH-STEP is amount of overlap between successive chunks."
|
|||||||
(match-start-pos (+ vlf-start-pos (position-bytes (point))))
|
(match-start-pos (+ vlf-start-pos (position-bytes (point))))
|
||||||
(match-end-pos match-start-pos)
|
(match-end-pos match-start-pos)
|
||||||
(to-find count)
|
(to-find count)
|
||||||
|
(font-lock font-lock-mode)
|
||||||
(reporter (make-progress-reporter
|
(reporter (make-progress-reporter
|
||||||
(concat "Searching for " regexp "...")
|
(concat "Searching for " regexp "...")
|
||||||
(if backward
|
(if backward
|
||||||
(- vlf-file-size vlf-end-pos)
|
(- vlf-file-size vlf-end-pos)
|
||||||
vlf-start-pos)
|
vlf-start-pos)
|
||||||
vlf-file-size)))
|
vlf-file-size)))
|
||||||
|
(font-lock-mode 0)
|
||||||
(vlf-with-undo-disabled
|
(vlf-with-undo-disabled
|
||||||
(unwind-protect
|
(unwind-protect
|
||||||
(catch 'end-of-file
|
(catch 'end-of-file
|
||||||
@ -108,6 +110,7 @@ BATCH-STEP is amount of overlap between successive chunks."
|
|||||||
vlf-end-pos)))))
|
vlf-end-pos)))))
|
||||||
(progress-reporter-done reporter))
|
(progress-reporter-done reporter))
|
||||||
(set-buffer-modified-p nil)
|
(set-buffer-modified-p nil)
|
||||||
|
(if font-lock (font-lock-mode 1))
|
||||||
(if backward
|
(if backward
|
||||||
(vlf-goto-match match-chunk-start match-chunk-end
|
(vlf-goto-match match-chunk-start match-chunk-end
|
||||||
match-end-pos match-start-pos
|
match-end-pos match-start-pos
|
||||||
@ -179,11 +182,17 @@ Search is performed chunk by chunk in `vlf-batch-size' memory."
|
|||||||
(let ((start-pos vlf-start-pos)
|
(let ((start-pos vlf-start-pos)
|
||||||
(end-pos vlf-end-pos)
|
(end-pos vlf-end-pos)
|
||||||
(pos (point))
|
(pos (point))
|
||||||
|
(font-lock font-lock-mode)
|
||||||
(success nil))
|
(success nil))
|
||||||
|
(font-lock-mode 0)
|
||||||
(unwind-protect
|
(unwind-protect
|
||||||
(if (< 0 n)
|
(if (< 0 n)
|
||||||
(let ((start 0)
|
(let ((start 0)
|
||||||
(end (min vlf-batch-size vlf-file-size))
|
(end (min vlf-batch-size vlf-file-size))
|
||||||
|
(reporter (make-progress-reporter
|
||||||
|
(concat "Searching for line "
|
||||||
|
(number-to-string n) "...")
|
||||||
|
0 vlf-file-size))
|
||||||
(inhibit-read-only t))
|
(inhibit-read-only t))
|
||||||
(setq n (1- n))
|
(setq n (1- n))
|
||||||
(vlf-with-undo-disabled
|
(vlf-with-undo-disabled
|
||||||
@ -230,9 +239,11 @@ Search is performed chunk by chunk in `vlf-batch-size' memory."
|
|||||||
(vlf-move-to-chunk-2 start end)
|
(vlf-move-to-chunk-2 start end)
|
||||||
(goto-char (point-max))
|
(goto-char (point-max))
|
||||||
(setq success (vlf-re-search "[\n\C-m]" n t 0))))))
|
(setq success (vlf-re-search "[\n\C-m]" n t 0))))))
|
||||||
|
(if font-lock (font-lock-mode 1))
|
||||||
(unless success
|
(unless success
|
||||||
(vlf-move-to-chunk-2 start-pos end-pos)
|
(vlf-move-to-chunk-2 start-pos end-pos)
|
||||||
(goto-char pos)))))
|
(goto-char pos)
|
||||||
|
(message "Unable to find line")))))
|
||||||
|
|
||||||
(provide 'vlf-search)
|
(provide 'vlf-search)
|
||||||
|
|
||||||
|
@ -52,10 +52,13 @@ Save anyway? "))
|
|||||||
region-length)))
|
region-length)))
|
||||||
(if (zerop size-change)
|
(if (zerop size-change)
|
||||||
(write-region nil nil buffer-file-name vlf-start-pos t)
|
(write-region nil nil buffer-file-name vlf-start-pos t)
|
||||||
(let ((pos (point)))
|
(let ((pos (point))
|
||||||
|
(font-lock font-lock-mode))
|
||||||
|
(font-lock-mode 0)
|
||||||
(if (< 0 size-change)
|
(if (< 0 size-change)
|
||||||
(vlf-file-shift-back size-change)
|
(vlf-file-shift-back size-change)
|
||||||
(vlf-file-shift-forward (- size-change)))
|
(vlf-file-shift-forward (- size-change)))
|
||||||
|
(if font-lock (font-lock-mode 1))
|
||||||
(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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user