Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## master (unreleased)

### Bugs fixed

* Remove workaround for converting column numbers to 0-based indexing. ([Cider issue](https://github.com/clojure-emacs/cider/issues/2852))

## 0.25.1 (2020-06-04)

### Bugs fixed
Expand Down
21 changes: 10 additions & 11 deletions src/cider/nrepl/middleware/debug.clj
Original file line number Diff line number Diff line change
Expand Up @@ -473,17 +473,16 @@ this map (identified by a key), and will `dissoc` it afterwards."}
[& body]
;; NOTE: *msg* is the message that instrumented the function,
`(let [~'STATE__ {:msg ~(let [{:keys [code id file line column ns]} *msg*]
(-> {:code code
;; Passing clojure.lang.Namespace object
;; as :original-ns breaks nREPL in bewildering
;; ways.
:original-id id, :original-ns (str (or ns *ns*))
:file file, :line line, :column column}
;; There's an nrepl bug where the column starts counting
;; at 1 if it's after the first line. Since this is a
;; top-level sexp, a (= col 1) is much more likely to be
;; wrong than right.
(update :column #(if (= % 1) 0 %))))
{:code code
;; Passing clojure.lang.Namespace object
;; as :original-ns breaks nREPL in bewildering
;; ways.
;; NOTE: column numbers in the response map
;; start from 1 according to Clojure.
;; This is not a bug and should be converted to
;; 0-based indexing by the client if necessary.
:original-id id, :original-ns (str (or ns *ns*))
:file file, :line line, :column column})
;; the coor of first form is used as the debugger session id
:session-id (atom nil)
:skip (atom false)
Expand Down
2 changes: 1 addition & 1 deletion test/clj/cider/nrepl/middleware/debug_integration_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@

;; Note - if changing test/src/cider/nrepl/middleware/debug_integration_test/fn.clj, also change this:
(let [msg (<-- {:line 7
:column 0
:column 1
:debug-value "\"bar\""
:coor [3 1 1]
:locals [["x" "\"bar\""]]})
Expand Down