mirror of
https://github.com/m00natic/vlfi.git
synced 2025-01-18 12:05:31 +00:00
Add check if VLFI buffer has been modified before occur jumping to new
chunk.
This commit is contained in:
parent
b8cc34422e
commit
e4d886a3e3
20
vlfi.el
20
vlfi.el
@ -585,13 +585,21 @@ EVENT may hold details of the invocation."
|
||||
(match-pos (or (get-char-property pos 'match-pos)
|
||||
(+ (get-char-property pos 'line-pos)
|
||||
pos-relative))))
|
||||
(unless (buffer-live-p buffer)
|
||||
(let ((occur-buffer (current-buffer)))
|
||||
(setq buffer (vlfi file))
|
||||
(switch-to-buffer occur-buffer)))
|
||||
(or (buffer-live-p buffer)
|
||||
(let ((occur-buffer (current-buffer)))
|
||||
(setq buffer (vlfi file))
|
||||
(switch-to-buffer occur-buffer)))
|
||||
(pop-to-buffer buffer)
|
||||
(vlfi-move-to-chunk chunk-start chunk-end)
|
||||
(goto-char match-pos)))))
|
||||
(if (buffer-modified-p)
|
||||
(cond ((and (= vlfi-start-pos chunk-start)
|
||||
(= vlfi-end-pos chunk-end))
|
||||
(goto-char match-pos))
|
||||
((y-or-n-p "VLFI buffer has been modified. \
|
||||
Really jump to new chunk? ")
|
||||
(vlfi-move-to-chunk chunk-start chunk-end)
|
||||
(goto-char match-pos)))
|
||||
(vlfi-move-to-chunk chunk-start chunk-end)
|
||||
(goto-char match-pos))))))
|
||||
|
||||
(defun vlfi-occur (regexp)
|
||||
"Make whole file occur style index for REGEXP.
|
||||
|
Loading…
x
Reference in New Issue
Block a user