mirror of
				https://github.com/m00natic/vlfi.git
				synced 2025-10-30 22:53:37 +00:00 
			
		
		
		
	Enhance search to cover in between chunk boundaries.
This commit is contained in:
		
							
								
								
									
										18
									
								
								vlfi.el
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								vlfi.el
									
									
									
									
									
								
							| @@ -246,7 +246,9 @@ OP-TYPE specifies the file operation being performed over FILENAME." | |||||||
|                           (if backward |                           (if backward | ||||||
|                               (- vlfi-file-size vlfi-start-pos) |                               (- vlfi-file-size vlfi-start-pos) | ||||||
|                             vlfi-start-pos) |                             vlfi-start-pos) | ||||||
|                           vlfi-file-size))) |                           vlfi-file-size)) | ||||||
|  |         (initial-chunk t) | ||||||
|  |         (prev 0)) | ||||||
|     (unwind-protect |     (unwind-protect | ||||||
|         (catch 'end-of-file |         (catch 'end-of-file | ||||||
|           (if backward |           (if backward | ||||||
| @@ -255,7 +257,12 @@ OP-TYPE specifies the file operation being performed over FILENAME." | |||||||
|                        (setq to-find (1- to-find))) |                        (setq to-find (1- to-find))) | ||||||
|                       ((zerop vlfi-start-pos) |                       ((zerop vlfi-start-pos) | ||||||
|                        (throw 'end-of-file nil)) |                        (throw 'end-of-file nil)) | ||||||
|                       (t (vlfi-prev-batch 1) |                       (t (if initial-chunk | ||||||
|  |                              (setq initial-chunk nil) | ||||||
|  |                            (let ((inhibit-read-only t)) | ||||||
|  |                              (delete-region prev (point-max)))) | ||||||
|  |                          (setq prev (point-min)) | ||||||
|  |                          (vlfi-prev-batch -1) | ||||||
|                          (progress-reporter-update |                          (progress-reporter-update | ||||||
|                           search-reporter (- vlfi-file-size |                           search-reporter (- vlfi-file-size | ||||||
|                                              vlfi-end-pos))))) |                                              vlfi-end-pos))))) | ||||||
| @@ -264,7 +271,12 @@ OP-TYPE specifies the file operation being performed over FILENAME." | |||||||
|                      (setq to-find (1- to-find))) |                      (setq to-find (1- to-find))) | ||||||
|                     ((= vlfi-end-pos vlfi-file-size) |                     ((= vlfi-end-pos vlfi-file-size) | ||||||
|                      (throw 'end-of-file nil)) |                      (throw 'end-of-file nil)) | ||||||
|                     (t (vlfi-next-batch 1) |                     (t (if initial-chunk | ||||||
|  |                            (setq initial-chunk nil) | ||||||
|  |                          (let ((inhibit-read-only t)) | ||||||
|  |                            (delete-region (point-min) prev))) | ||||||
|  |                        (setq prev (point-max)) | ||||||
|  |                        (vlfi-next-batch -1) | ||||||
|                        (progress-reporter-update search-reporter |                        (progress-reporter-update search-reporter | ||||||
|                                                  vlfi-end-pos)))))) |                                                  vlfi-end-pos)))))) | ||||||
|       (progress-reporter-done search-reporter) |       (progress-reporter-done search-reporter) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user