Skip to content

Commit

Permalink
compleseus: use the correct predicate for minibuffer hjkl bindings
Browse files Browse the repository at this point in the history
syl20bnr#15710 confused
hybrid-style-enable-evilified-state and hybrid-style-enable-hjkl-bindings
  • Loading branch information
Atemu authored and smile13241324 committed Aug 29, 2022
1 parent 1ed0859 commit 201d22b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
8 changes: 7 additions & 1 deletion core/core-dotspacemacs.el
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,17 @@ in `dotspacemacs-themes'.")
'spacemacs-dotspacemacs-init)

(defun spacemacs//support-evilified-buffer-p ()
"Return non-nil if evil navigation should be enabled."
"Returns non-nil if buffers should use evilified states."
(or (eq dotspacemacs-editing-style 'vim)
(and (eq dotspacemacs-editing-style 'hybrid)
hybrid-style-enable-evilified-state)))

(defun spacemacs//support-hjkl-navigation-p ()
"Returns non-nil if navigation keys should be evilified."
(or (eq dotspacemacs-editing-style 'vim)
(and (eq dotspacemacs-editing-style 'hybrid)
hybrid-style-enable-hjkl-bindings)))

(spacemacs|defc dotspacemacs-startup-banner 'official
"Specify the startup banner. Default value is `official', it displays
the official spacemacs logo. An integer value is the index of text
Expand Down
6 changes: 3 additions & 3 deletions layers/+completion/compleseus/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@
"sl" 'selectrum-repeat)

:config
(when (spacemacs//support-evilified-buffer-p)
(when (spacemacs//support-hjkl-navigation-p)
(define-key selectrum-minibuffer-map (kbd "C-j") 'selectrum-next-candidate)
(define-key selectrum-minibuffer-map (kbd "C-r") 'consult-history)
(define-key selectrum-minibuffer-map (kbd "C-k") 'selectrum-previous-candidate)
Expand Down Expand Up @@ -362,7 +362,7 @@
(vertico-mode)

:config
(when (spacemacs//support-evilified-buffer-p)
(when (spacemacs//support-hjkl-navigation-p)
(define-key vertico-map (kbd "M-RET") #'vertico-exit-input)
(define-key vertico-map (kbd "C-SPC") #'spacemacs/embark-preview)
(define-key vertico-map (kbd "C-j") #'vertico-next)
Expand Down Expand Up @@ -394,7 +394,7 @@
(defun compleseus/init-vertico-directory ()
(use-package vertico-directory
;; More convenient directory navigation commands
:init (bind-key "C-h" 'vertico-directory-delete-char vertico-map (spacemacs//support-evilified-buffer-p))
:init (bind-key "C-h" 'vertico-directory-delete-char vertico-map (spacemacs//support-hjkl-navigation-p))
;; Tidy shadowed file names
:hook (rfn-eshadow-update-overlay . vertico-directory-tidy)))

Expand Down

0 comments on commit 201d22b

Please sign in to comment.