From 370a5c613ef4b1b48dbd1bd2133c575990fd3093 Mon Sep 17 00:00:00 2001 From: Oleh Krehel Date: Tue, 3 Mar 2020 20:02:19 +0100 Subject: [PATCH] hydra.el (hydra-key-regex): Include "[]" in the char group To include "]", it must be the first char in the group. To include "-", it must be the last char in the group. Fixes #365 --- hydra.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hydra.el b/hydra.el index 2eb79d3..29b790e 100644 --- a/hydra.el +++ b/hydra.el @@ -695,7 +695,7 @@ HEAD's binding is returned as a string wrapped with [] or {}." (defconst hydra-width-spec-regex " ?-?[0-9]*?" "Regex for the width spec in keys and %` quoted sexps.") -(defvar hydra-key-regex "\\[\\|]\\|[-\\[:alnum:] ~.,;:/|?<>={}*+#%@!&^↑↓←→⌫⌦⏎'`()\"$]+?" +(defvar hydra-key-regex "[][\\[:alnum:] ~.,;:/|?<>={}*+#%@!&^↑↓←→⌫⌦⏎'`()\"$-]+?" "Regex for the key quoted in the docstring.") (defun hydra--format (_name body docstring heads)