Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1dba82f] On error don't auto-jump to tooling files #962

Merged
merged 1 commit into from
Feb 1, 2015
Merged
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
30 changes: 16 additions & 14 deletions cider-interaction.el
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,8 @@ create a valid path."
"Return t if FILE-NAME is not a 'real' source file.
Currently, only check if the relative file name starts with 'form-init'
which nREPL uses for temporary evaluation file names."
(string-match-p "\\bform-init" (file-name-nondirectory file-name)))
(let ((fname (file-name-nondirectory file-name)))
(string-match-p "^form-init" fname)))

(defun cider-find-file (url)
"Return a buffer visiting the file URL if it exists, or nil otherwise.
Expand Down Expand Up @@ -1111,19 +1112,20 @@ If location could not be found, return nil."
(let ((file (nth 0 info))
(line (nth 1 info))
(col (nth 2 info)))
(-when-let (buffer (cider-find-file file))
(with-current-buffer buffer
(save-excursion
(save-restriction
(widen)
(goto-char (point-min))
(forward-line (1- line))
(move-to-column (or col 0))
(let ((begin (progn (if col (cider--goto-expression-start) (back-to-indentation))
(point)))
(end (progn (if col (forward-list) (move-end-of-line nil))
(point))))
(list begin end buffer)))))))))))
(unless (cider--tooling-file-p file)
(-when-let (buffer (cider-find-file file))
(with-current-buffer buffer
(save-excursion
(save-restriction
(widen)
(goto-char (point-min))
(forward-line (1- line))
(move-to-column (or col 0))
(let ((begin (progn (if col (cider--goto-expression-start) (back-to-indentation))
(point)))
(end (progn (if col (forward-list) (move-end-of-line nil))
(point))))
(list begin end buffer))))))))))))

(defun cider-handle-compilation-errors (message eval-buffer)
"Highlight and jump to compilation error extracted from MESSAGE.
Expand Down