Skip to content

Commit 29e37c2

Browse files
authored
[Fix #671] Font-lock properly multi-digit lambda args (#672)
1 parent 27915a0 commit 29e37c2

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

clojure-mode-font-lock-test.el

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -901,13 +901,24 @@ DESCRIPTION is the description of the spec."
901901
(2 3 font-lock-keyword-face)
902902
( 5 7 font-lock-function-name-face)))
903903

904-
(when-fontifying-it "should handle lambda-params"
904+
(when-fontifying-it "should handle lambda-params %, %1, %n..."
905905
("#(+ % %2 %3 %&)"
906906
(5 5 font-lock-variable-name-face)
907907
(7 8 font-lock-variable-name-face)
908908
(10 11 font-lock-variable-name-face)
909909
(13 14 font-lock-variable-name-face)))
910910

911+
(when-fontifying-it "should handle multi-digit lambda-params"
912+
;; % args with >1 digit are rare and unidiomatic but legal up to
913+
;; `MAX_POSITIONAL_ARITY` in Clojure's compiler, which as of today is 20
914+
("#(* %10 %15 %19 %20)"
915+
;; it would be better if this were just `font-lock-variable-name-face` but
916+
;; it seems to work as-is
917+
(5 7 various-faces)
918+
(9 11 font-lock-variable-name-face)
919+
(13 15 font-lock-variable-name-face)
920+
(17 19 various-faces)))
921+
911922
(when-fontifying-it "should handle nils"
912923
("(= nil x)"
913924
(4 6 font-lock-constant-face))

0 commit comments

Comments
 (0)