Fix :leader/:localleader and :prefix

Due to issues with preset prefixes in general definers and nested
:prefix's supplied from a map! call not cooperating, many localleader
keybinds were broken and causing errors. For :leader/:localleader keys,
we now use :infix for sub-prefixes.

However, with this change, the :alt-prefix property has been removed, as
there is no simple way to support this without some major state
gymnastics in map!.

Fixes #1059
This commit is contained in:
Henrik Lissner 2018-12-25 02:29:29 -05:00
parent 70a4db49d1
commit d337e255d3
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 16 additions and 35 deletions

View file

@ -251,25 +251,6 @@
(general-define-key :prefix (general--concat nil "a" "b")
"x" #'x)))))
(describe ":alt-prefix"
(it "specifies a prefix for all keys"
(expect '(map! :alt-prefix "a" "x" #'x "y" #'y "z" #'z)
:to-expand-into
'(general-define-key :non-normal-prefix "a" "x" #'x "y" #'y "z" #'z)))
(it "overwrites previous inline :alt-prefix properties"
(expect '(map! :alt-prefix "a" "x" #'x "y" #'y :alt-prefix "b" "z" #'z)
:to-expand-into
'(progn (general-define-key :non-normal-prefix "a" "x" #'x "y" #'y)
(general-define-key :non-normal-prefix "b" "z" #'z))))
(it "accumulates keys when nested"
(expect '(map! (:alt-prefix "a" "x" #'x (:alt-prefix "b" "x" #'x)))
:to-expand-into
`(progn (general-define-key :non-normal-prefix "a" "x" #'x)
(general-define-key :non-normal-prefix (general--concat nil "a" "b")
"x" #'x)))))
(describe ":textobj"
(it "defines keys in evil-{inner,outer}-text-objects-map"
(expect '(map! :textobj "a" #'inner #'outer)