Skip to content

Commit 2a1ac0a

Browse files
author
Bozhidar Batsov
committed
Remove the no file check in the error highlighting logic
1 parent da3e910 commit 2a1ac0a

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

cider-interaction.el

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1114,19 +1114,16 @@ If location could not be found, return nil."
11141114
(line (nth 1 info))
11151115
(col (nth 2 info)))
11161116
(save-excursion
1117-
;; when we don't have a filename or it's different from the one of
1118-
;; the current buffer, the line number is relative to form start
1119-
(if (and file (equal (file-truename file)
1120-
(file-truename (buffer-file-name))))
1121-
(goto-char (point-min)) ; start of file
1122-
(beginning-of-defun))
1123-
(forward-line (1- line))
1124-
(move-to-column (or col 0))
1125-
(let ((begin (progn (if col (cider--goto-expression-start) (back-to-indentation))
1126-
(point)))
1127-
(end (progn (if col (forward-list) (move-end-of-line nil))
1128-
(point))))
1129-
(cons begin end)))))))))
1117+
(save-restriction
1118+
(widen)
1119+
(goto-char (point-min))
1120+
(forward-line (1- line))
1121+
(move-to-column (or col 0))
1122+
(let ((begin (progn (if col (cider--goto-expression-start) (back-to-indentation))
1123+
(point)))
1124+
(end (progn (if col (forward-list) (move-end-of-line nil))
1125+
(point))))
1126+
(cons begin end))))))))))
11301127

11311128
(defun cider-highlight-compilation-errors (buffer message)
11321129
"Highlight compilation error line in BUFFER, using MESSAGE."

0 commit comments

Comments
 (0)