Skip to content

Commit

Permalink
Add consult--source-tab-buffer filter for current tab's buffer
Browse files Browse the repository at this point in the history
Signed-off-by: Burgess Chang <[email protected]>

Follow the review suggestions

Signed-off-by: Burgess Chang <[email protected]>

Use :buffer-list keyword instead of predicate

Signed-off-by: Burgess Chang <[email protected]>
  • Loading branch information
brsvh committed May 27, 2024
1 parent 8989c7a commit 188f9a7
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions consult.el
Original file line number Diff line number Diff line change
Expand Up @@ -4587,6 +4587,22 @@ If NORECORD is non-nil, do not record the buffer switch in the buffer list."
:as #'consult--buffer-pair)))
"Buffer candidate source for `consult-buffer'.")

(defvar consult--source-tab-buffer
`(:name "Tab buffer"
:narrow ?b
:category buffer
:face consult-buffer
:history buffer-name-history
:state ,#'consult--buffer-state
:enabled (lambda () tab-bar-mode)
:items
,(lambda ()
(consult--buffer-query
:sort 'visibility
:as #'consult--buffer-pair
:buffer-list (frame-parameter nil 'buffer-list))))
"Buffer candidate source in current tab for `consult-buffer'.")

(defun consult--file-register-p (reg)
"Return non-nil if REG is a file register."
(memq (car-safe (cdr reg)) '(file-query file)))
Expand Down

0 comments on commit 188f9a7

Please sign in to comment.