Skip to content

Commit

Permalink
Fix for character literals
Browse files Browse the repository at this point in the history
When inside a vector or before white space, the escaped characters
weren't being formatted.
  • Loading branch information
rvlo committed Mar 22, 2021
1 parent 8dc1b1a commit 587f609
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions clojure-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -862,14 +862,13 @@ any number of matches of `clojure--sym-forbidden-rest-chars'."))
"\\>")
0 font-lock-constant-face)
;; Character literals - \1, \a, \newline, \u0000
(,(rx "\\" (or any
"newline" "space" "tab" "formfeed" "backspace"
"return"
(: "u" (= 4 (char "0-9a-fA-F")))
(: "o" (repeat 1 3 (char "0-7"))))
word-boundary)
0 'clojure-character-face)

(,(rx (group "\\" (or any
"newline" "space" "tab" "formfeed" "backspace"
"return"
(: "u" (= 4 (char "0-9a-fA-F")))
(: "o" (repeat 1 3 (char "0-7")))))
(or (not word) word-boundary))
1 'clojure-character-face)
;; namespace definitions: (ns foo.bar)
(,(concat "(\\<ns\\>[ \r\n\t]*"
;; Possibly metadata, shorthand and/or longhand
Expand Down

0 comments on commit 587f609

Please sign in to comment.