Skip to content

Instantly share code, notes, and snippets.

@leoliu
Created May 6, 2012 04:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leoliu/2614567 to your computer and use it in GitHub Desktop.
Save leoliu/2614567 to your computer and use it in GitHub Desktop.
fix-cursor-marker
--- a/src/swank/core/protocol.clj
+++ b/src/swank/core/protocol.clj
@@ -12,6 +12,10 @@
no pkg exists, then nothing is done."
([text] (.replaceAll (re-matcher namespace-re text) "$1/")))
+(defn- fix-cursor-marker
+ "Changes the cursor marker."
+ ([text] (.replace text "swank::%cursor-marker%" ":cursor-marker")))
+
(defn write-swank-message
"Given a `writer' (java.io.Writer) and a `message' (typically an
sexp), encode the message according to the swank protocol and
@@ -43,7 +47,7 @@
len (Integer/parseInt len-str 16)
msg (read-chars reader len read-fail-exception)
form (try
- (read-string (fix-namespace msg))
+ (read-string (fix-cursor-marker (fix-namespace msg)))
(catch Exception ex
(.println System/err (format "unreadable message: %s" msg))
(throw ex)))]
--
1.7.10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment