File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed
Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change 191191 (recur p (cons (start-element (n/tag (z/node p))) worklist))
192192 (apply str worklist)))))
193193
194- (defn- last-line-in-string [^String s]
194+ (defn- last-line-in-string ^String [^String s]
195195 (subs s (inc (.lastIndexOf s " \n " ))))
196196
197197(defn- margin [zloc]
198- (-> zloc prior-line-string last-line-in-string count))
198+ (let [last-line (-> zloc prior-line-string last-line-in-string)]
199+ (.codePointCount last-line 0 (.length last-line))))
199200
200201(defn- whitespace [width]
201202 (n/whitespace-node (apply str (repeat width " " ))))
Original file line number Diff line number Diff line change 20092009 [" (when 42 ;;;"
20102010 " :a)" ]
20112011 {:indent-line-comments? true })))))
2012+
2013+ (deftest test-multibyte-codepoints
2014+ (is (reformats-to?
2015+ [" (defn- x"
2016+ " [x style]"
2017+ " (case style"
2018+ " :normal x"
2019+ " :𝕨𝕚𝕝𝕕 (if (sequential? x)"
2020+ " :a"
2021+ " :b)))" ]
2022+ [" (defn- x"
2023+ " [x style]"
2024+ " (case style"
2025+ " :normal x"
2026+ " :𝕨𝕚𝕝𝕕 (if (sequential? x)"
2027+ " :a"
2028+ " :b)))" ])))
You can’t perform that action at this time.
0 commit comments