Skip to content

Commit d255b1d

Browse files
committed
buffer: Simplify buffer-source.
Delete buffer-initial-suggestions.
1 parent 3621943 commit d255b1d

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

source/buffer.lisp

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -927,19 +927,11 @@ If none exist, make a new inactive buffer."
927927
(echo "~a copied to clipboard."
928928
(copy-to-clipboard (title (current-buffer)))))
929929

930-
(defun buffer-initial-suggestions (&key current-is-last-p domain)
931-
(let* ((active-buffer (active-buffer (current-window)))
932-
(buffers (sera:filter (if domain (match-domain domain) #'identity)
933-
(sort-by-time
934-
(remove active-buffer (buffer-list)))))
935-
(buffers (push active-buffer buffers)))
936-
(when (and buffers current-is-last-p)
937-
(setf buffers (alex:rotate buffers -1)))
938-
buffers))
939-
940930
(define-class buffer-source (prompter:source)
941931
((prompter:name "Buffer list")
942-
(prompter:constructor (buffer-initial-suggestions :current-is-last-p nil))
932+
(prompter:constructor (append (list (active-buffer (current-window)))
933+
(remove (active-buffer (current-window))
934+
(buffer-list))))
943935
(prompter:filter-preprocessor #'prompter:filter-exact-matches)
944936
(prompter:enable-marks-p t)
945937
(prompter:actions-on-return (list (lambda-unmapped-command set-current-buffer)

0 commit comments

Comments
 (0)