selectrum: make workspace source number consistent
The off-by-one of the keybinding and the function input now match functions like `+workspace/switch-to-$n`
This commit is contained in:
parent
14d6613192
commit
ed283c6363
1 changed files with 5 additions and 5 deletions
|
@ -5,12 +5,12 @@
|
||||||
(defun +selectrum--workspace-nth-source (n)
|
(defun +selectrum--workspace-nth-source (n)
|
||||||
"Generate a consult buffer source for buffers in the NTH workspace"
|
"Generate a consult buffer source for buffers in the NTH workspace"
|
||||||
(cond ((numberp n)
|
(cond ((numberp n)
|
||||||
`(:name ,(nth (1- n) (+workspace-list-names))
|
`(:name ,(nth n (+workspace-list-names))
|
||||||
:hidden ,(not (string= (+workspace-current-name) (nth (1- n) (+workspace-list-names))))
|
:hidden ,(not (string= (+workspace-current-name) (nth n (+workspace-list-names))))
|
||||||
:narrow ,(string-to-char (number-to-string n))
|
:narrow ,(string-to-char (number-to-string (1+ n)))
|
||||||
:category buffer
|
:category buffer
|
||||||
:state ,#'consult--buffer-state
|
:state ,#'consult--buffer-state
|
||||||
:items ,(lambda () (mapcar #'buffer-name (+workspace-buffer-list (nth (1- n) (+workspace-list)))))))
|
:items ,(lambda () (mapcar #'buffer-name (+workspace-buffer-list (nth n (+workspace-list)))))))
|
||||||
((eq n 'final)
|
((eq n 'final)
|
||||||
`(:name ,(car (last (+workspace-list-names)))
|
`(:name ,(car (last (+workspace-list-names)))
|
||||||
:hidden t
|
:hidden t
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +selectrum--workspace-generate-sources ()
|
(defun +selectrum--workspace-generate-sources ()
|
||||||
"Generate list of consult buffer sources for all workspaces"
|
"Generate list of consult buffer sources for all workspaces"
|
||||||
(mapcar #'+selectrum--workspace-nth-source '(1 2 3 4 5 6 7 8 9 final)))
|
(mapcar #'+selectrum--workspace-nth-source '(0 1 2 3 4 5 6 7 8 final)))
|
||||||
|
|
||||||
(autoload 'consult--multi "consult")
|
(autoload 'consult--multi "consult")
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue