Skip to content

Commit 14ac115

Browse files
author
Bozhidar Batsov
committed
[#631] Track column number in interactive eval
A small present for the awesome @cemerick :-)
1 parent d07b7a0 commit 14ac115

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cider-interaction.el

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1300,11 +1300,14 @@ When invoked with a prefix ARG the command doesn't prompt for confirmation."
13001300

13011301
(defun cider--dummy-file-contents (form start-pos)
13021302
(let ((current-ns (cider-current-ns))
1303-
(start-line (line-number-at-pos start-pos)))
1303+
(start-line (line-number-at-pos start-pos))
1304+
(start-column (save-excursion (goto-char start-pos) (current-column))))
13041305
(with-temp-buffer
13051306
(insert (format "(ns %s)" current-ns))
13061307
(dotimes (_ (1- start-line))
13071308
(insert "\n"))
1309+
(dotimes (_ start-column)
1310+
(insert " "))
13081311
(insert form)
13091312
(buffer-string))))
13101313

0 commit comments

Comments
 (0)