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