mirror of
https://github.com/m00natic/vlfi.git
synced 2025-01-18 12:05:31 +00:00
Encode smaller region to detect cut point overall offset in vlf-occur
when moving to next batch and be more precise with hexl-mode active.
This commit is contained in:
parent
bc398d6053
commit
b300137941
@ -375,6 +375,14 @@ which deletion was performed."
|
||||
(delete-region cut-point (point-max))))
|
||||
(cons dist (1+ cut-point))))
|
||||
|
||||
(defun vlf-byte-position (point)
|
||||
"Determine global byte position of POINT."
|
||||
(let ((pmax (point-max)))
|
||||
(if (< (/ pmax 2) point)
|
||||
(- vlf-end-pos (vlf-tune-encode-length (min (1+ point) pmax)
|
||||
pmax))
|
||||
(+ vlf-start-pos (vlf-tune-encode-length (point-min) point)))))
|
||||
|
||||
(defun vlf-shift-undo-list (n)
|
||||
"Shift undo list element regions by N."
|
||||
(or (null buffer-undo-list) (eq buffer-undo-list t)
|
||||
|
16
vlf-occur.el
16
vlf-occur.el
@ -309,7 +309,8 @@ Prematurely ending indexing will still show what's found so far."
|
||||
match-end-point)))))
|
||||
(- vlf-end-pos (* (- 10 (forward-line 10))
|
||||
hexl-bits)))
|
||||
(let* ((batch-step (min 1024 (/ vlf-batch-size
|
||||
(let* ((pmax (point-max))
|
||||
(batch-step (min 1024 (/ vlf-batch-size
|
||||
10)))
|
||||
(batch-point
|
||||
(max match-end-point
|
||||
@ -317,7 +318,7 @@ Prematurely ending indexing will still show what's found so far."
|
||||
(byte-to-position
|
||||
(- vlf-batch-size batch-step))
|
||||
(progn
|
||||
(goto-char (point-max))
|
||||
(goto-char pmax)
|
||||
(let ((last (line-beginning-position)))
|
||||
(if (= last (point-min))
|
||||
(1- (point))
|
||||
@ -334,15 +335,12 @@ Prematurely ending indexing will still show what's found so far."
|
||||
(goto-char match-end-point)
|
||||
(forward-line)
|
||||
(setq first-line-incomplete
|
||||
(let ((pmax (point-max)))
|
||||
(if (= (point) pmax)
|
||||
(- pmax match-end-point))))
|
||||
(+ vlf-start-pos
|
||||
(vlf-tune-encode-length (point-min)
|
||||
batch-point))))))
|
||||
(if (= (point) pmax)
|
||||
(- pmax match-end-point)))
|
||||
(vlf-byte-position batch-point)))))
|
||||
(vlf-tune-batch tune-types)
|
||||
(setq vlf-end-pos start) ;not to adjust start
|
||||
(vlf-move-to-chunk-2 start (+ start vlf-batch-size)))
|
||||
(vlf-move-to-chunk start (+ start vlf-batch-size)))
|
||||
(setq match-start-point (point-min)
|
||||
match-end-point match-start-point)
|
||||
(goto-char match-end-point)
|
||||
|
Loading…
x
Reference in New Issue
Block a user