swiftcode
swiftcode copied to clipboard
In some sources '%' and '^' symbols are broken
Sometimes I can't input %
an ^
characters, they show up as incorrect input when I type them in. I noticed that as I was typing some Clojure source and then some Erlang source.
This is a piece of source from Ring (Clojure), in which I have this bug (in the 1st line, on ^
symbol):
(defn- ^SimpleDateFormat formatter [format]
(doto (SimpleDateFormat. ^String (http-date-formats format) Locale/US)
(.setTimeZone (TimeZone/getTimeZone "GMT"))))
(defn- attempt-parse [date format]
(try
(.parse (formatter format) date)
(catch ParseException _ nil)
;; Also catch RuntimeExceptions, needed for Clojure 1.3.0
;; See: https://groups.google.com/forum/#!topic/clojure/I5l1YHVMgkI
(catch RuntimeException _ nil)))
(defn- trim-quotes [s]
(str/replace s #"^'|'$" ""))
Another source pieces containing these characters work fine.
I use a Russian windows keyboard, but its' English layout seems to be the same as on normal US keyboards. Currently I'm using Google Chrome 31.0.1650.63 m on Windows 7.
Hi! Thanks for the bug report. I'll try to recreate this later today, and see if I can find a fix for it.
Seems like this is due to the ^
character being a "type hint". Unfortunately, highlight.js
classifies this as a comment currently, so it's being stripped out of the typeable code.
I'll try to see if this can be fixed in highlight.js
.