From 72932b804b8c17676d7d465173d1acef4810529f Mon Sep 17 00:00:00 2001 From: JAremko Date: Thu, 8 Oct 2020 09:23:00 +0300 Subject: [PATCH] fix spacebind prefixing bug --- core/core-spacebind.el | 2 +- tests/core/core-spacebind-utest.el | 40 +++++++++++++++--------------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/core/core-spacebind.el b/core/core-spacebind.el index 6bcf94be9..cb1bf9b5a 100644 --- a/core/core-spacebind.el +++ b/core/core-spacebind.el @@ -73,7 +73,7 @@ Otherwise binding happens at the next event loop.") (let ((mode (car args)) (prefix (string-join (cadr args) " ")) (label (caddr args))) - (spacemacs/declare-prefix prefix label))) + (spacemacs/declare-prefix-for-mode mode prefix label))) ;; `spacemacs/set-leader-keys' (dolist (args spacebind--bs-set-leader-keys) diff --git a/tests/core/core-spacebind-utest.el b/tests/core/core-spacebind-utest.el index 4dea9c8e3..c54d9868b 100644 --- a/tests/core/core-spacebind-utest.el +++ b/tests/core/core-spacebind-utest.el @@ -615,26 +615,26 @@ NOTE: `spacebind--eager-bind' set to true. " py-mode "s R" python-shell-send-region nil) (spacemacs/set-leader-keys "C-v b" bar-fn nil) - (spacemacs/declare-prefix - "C-p" "compile/execute" nil) - (spacemacs/declare-prefix - "d" "debug" nil) - (spacemacs/declare-prefix - "r" "refactor" nil) - (spacemacs/declare-prefix - "s" "REPL" nil) - (spacemacs/declare-prefix - "a" "section under a key" nil) - (spacemacs/declare-prefix - "a c" "sub section under c key" nil) - (spacemacs/declare-prefix - "a c d" "sub sub section under d key" nil) - (spacemacs/declare-prefix - "a" "section under a key" nil) - (spacemacs/declare-prefix - "a b" "sub section under b key" nil) - (spacemacs/declare-prefix - "a b c" "sub sub section under c key" nil) + (spacemacs/declare-prefix-for-mode + py-mode "C-p" "compile/execute" nil) + (spacemacs/declare-prefix-for-mode + py-mode "d" "debug" nil) + (spacemacs/declare-prefix-for-mode + py-mode "r" "refactor" nil) + (spacemacs/declare-prefix-for-mode + py-mode "s" "REPL" nil) + (spacemacs/declare-prefix-for-mode + some-minor-mode "a" "section under a key" nil) + (spacemacs/declare-prefix-for-mode + some-minor-mode "a c" "sub section under c key" nil) + (spacemacs/declare-prefix-for-mode + some-minor-mode "a c d" "sub sub section under d key" nil) + (spacemacs/declare-prefix-for-mode + some-another-minor-mode "a" "section under a key" nil) + (spacemacs/declare-prefix-for-mode + some-another-minor-mode "a b" "sub section under b key" nil) + (spacemacs/declare-prefix-for-mode + some-another-minor-mode "a b c" "sub sub section under c key" nil) (spacemacs/declare-prefix "C-v" "section under a key" nil) (which-key-add-major-mode-key-based-replacements