Skip to content

Commit

Permalink
[#631] Track column number in interactive eval
Browse files Browse the repository at this point in the history
A small present for the awesome @cemerick :-)
  • Loading branch information
Bozhidar Batsov committed Sep 4, 2014
1 parent d07b7a0 commit 14ac115
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cider-interaction.el
Original file line number Diff line number Diff line change
Expand Up @@ -1300,11 +1300,14 @@ When invoked with a prefix ARG the command doesn't prompt for confirmation."

(defun cider--dummy-file-contents (form start-pos)
(let ((current-ns (cider-current-ns))
(start-line (line-number-at-pos start-pos)))
(start-line (line-number-at-pos start-pos))
(start-column (save-excursion (goto-char start-pos) (current-column))))
(with-temp-buffer
(insert (format "(ns %s)" current-ns))
(dotimes (_ (1- start-line))
(insert "\n"))
(dotimes (_ start-column)
(insert " "))
(insert form)
(buffer-string))))

Expand Down

0 comments on commit 14ac115

Please sign in to comment.