Skip to content

Commit

Permalink
Use consult--buffer-query
Browse files Browse the repository at this point in the history
  • Loading branch information
localauthor committed Oct 6, 2024
1 parent 8e36157 commit d96990a
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions zk-consult.el
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,16 @@ Select TAG, with completion, from list of all tags in zk notes."
:history zk-history
:new ,#'zk-new-note
:state ,#'consult--buffer-state
:items ,(lambda ()
(remq nil
(mapcar
(lambda (x)
(when
(and (buffer-file-name x)
(zk-file-p (buffer-file-name x)))
(buffer-name x)))
(buffer-list))))))
:items
,(lambda ()
(consult--buffer-query :sort 'visibility
:as #'consult--buffer-pair
:predicate
(lambda (buf)
(and (buffer-file-name buf)
(zk-file-p
(buffer-file-name buf))))))))


(defun zk-consult-current-notes ()
"Select a currently open note using `consult-buffer'.
Expand Down

0 comments on commit d96990a

Please sign in to comment.