Skip to content

Commit

Permalink
[Fix #2286] Fix eldoc on repl image (#2293)
Browse files Browse the repository at this point in the history
Basically we were sending image binary data where a string was expected.

This commit also addresses one unused variable binding.
  • Loading branch information
stardiviner authored and bbatsov committed May 19, 2018
1 parent 45bd3bc commit dfa45ae
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cider-repl.el
Original file line number Diff line number Diff line change
Expand Up @@ -854,22 +854,22 @@ Returns an image instance with a margin per `cider-repl-image-margin'."
Part of the default `cider-repl-content-type-handler-alist'."
(cider-repl--display-image buffer
(cider-repl--image image 'jpeg t)
show-prefix bol image))
show-prefix bol " "))

(defun cider-repl-handle-png (_type buffer image &optional show-prefix bol)
"A handler for inserting a png IMAGE into a repl BUFFER.
Part of the default `cider-repl-content-type-handler-alist'."
(cider-repl--display-image buffer
(cider-repl--image image 'png t)
show-prefix bol image))
show-prefix bol " "))

(defun cider-repl-handle-external-body (type buffer _ &optional _show-prefix _bol)
"Handler for slurping external content into BUFFER.
Handles an external-body TYPE by issuing a slurp request to fetch the content."
(if-let* ((args (cadr type))
(access-type (nrepl-dict-get args "access-type")))
(nrepl-send-request
(list "op" "slurp" "url" (nrepl-dict-get args "URL"))
(list "op" "slurp" "url" (nrepl-dict-get args access-type))
(cider-repl-handler buffer)
(cider-current-connection)))
nil)
Expand Down

0 comments on commit dfa45ae

Please sign in to comment.