File tree Expand file tree Collapse file tree 2 files changed +42
-0
lines changed
modules/completion/vertico Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -177,3 +177,44 @@ If INITIAL is non-nil, use as initial input."
177177 :add-history (thing-at-point 'filename )
178178 :category '+vertico
179179 :history '(:input +vertico/find-file-in--history)))))
180+
181+ ;;;### autoload
182+ (defun +vertico/jump-list (jump)
183+ " Go to an entry in evil's (or better-jumper's) jumplist."
184+ (interactive
185+ (let (buffers)
186+ (unwind-protect
187+ (list
188+ (consult--read
189+ ; ; REVIEW Refactor me
190+ (nreverse
191+ (delete-dups
192+ (delq
193+ nil (mapcar (lambda (mark )
194+ (when mark
195+ (cl-destructuring-bind (path pt _id) mark
196+ (let ((buf (get-file-buffer path)))
197+ (unless buf
198+ (push (setq buf (find-file-noselect path t ))
199+ buffers))
200+ (with-current-buffer buf
201+ (goto-char pt)
202+ (font-lock-fontify-region (line-beginning-position ) (line-end-position ))
203+ (cons (format " %s :%d : %s "
204+ (buffer-name )
205+ (line-number-at-pos )
206+ (string-trim-right (or (thing-at-point 'line ) " " )))
207+ (point-marker )))))))
208+ (cddr (better-jumper-jump-list-struct-ring
209+ (better-jumper-get-jumps (better-jumper--get-current-context))))))))
210+ :prompt " jumplist: "
211+ :sort nil
212+ :require-match t
213+ :category 'jump-list ))
214+ (mapc #'kill-buffer buffers))))
215+ (let ((mark (cdr jump)))
216+ (delq! (marker-buffer mark) buffers)
217+ (mapc #'kill-buffer buffers)
218+ (setq buffers nil )
219+ (with-current-buffer (switch-to-buffer (marker-buffer mark))
220+ (goto-char (marker-position mark)))))
Original file line number Diff line number Diff line change @@ -67,6 +67,7 @@ overrides `completion-styles' during company completion sessions.")
6767 [remap apropos] #'consult-apropos
6868 [remap bookmark-jump] #'consult-bookmark
6969 [remap evil-show-marks] #'consult-mark
70+ [remap evil-show-jumps] #'+vertico/jump-list
7071 [remap goto-line] #'consult-goto-line
7172 [remap imenu] #'consult-imenu
7273 [remap locate] #'consult-locate
You can’t perform that action at this time.
0 commit comments