Permalink
Browse files

Fix haskell-interactive-jump-to-error-line, which I broke :-(

  • Loading branch information...
1 parent b257273 commit ed31b18a132ce9df708ffb727a9e88feb4cc4a31 @gregorycollins gregorycollins committed Jan 18, 2013
Showing with 21 additions and 21 deletions.
  1. +21 −21 haskell-interactive-mode.el
View
42 haskell-interactive-mode.el
@@ -193,27 +193,27 @@ Key bindings:
(let ((orig-line (buffer-substring-no-properties (line-beginning-position)
(line-end-position))))
(and (string-match "^\\([^:]+\\):\\([0-9]+\\):\\([0-9]+\\):" orig-line)
- (let ((file (match-string 1 orig-line))
- (line (match-string 2 orig-line))
- (col (match-string 3 orig-line)))
- (let* ((session (haskell-session))
- (cabal-path (haskell-session-cabal-dir session))
- (src-path (haskell-session-current-dir session))
- (cabal-relative-file (expand-file-name file cabal-path))
- (src-relative-file (expand-file-name file src-path))))
- (let ((file (cond ((file-exists-p cabal-relative-file)
- cabal-relative-file)
- ((file-exists-p src-relative-file)
- src-relative-file))))
- (when file
- (other-window 1)
- (find-file file)
- (haskell-interactive-bring)
- (goto-char (point-min))
- (forward-line (1- (string-to-number line)))
- (goto-char (+ (point) (string-to-number col)))
- (haskell-mode-message-line orig-line)
- t)))))))
+ (let* ((file (match-string 1 orig-line))
+ (line (match-string 2 orig-line))
+ (col (match-string 3 orig-line))
+ (session (haskell-session))
+ (cabal-path (haskell-session-cabal-dir session))
+ (src-path (haskell-session-current-dir session))
+ (cabal-relative-file (expand-file-name file cabal-path))
+ (src-relative-file (expand-file-name file src-path)))
+ (let ((file (cond ((file-exists-p cabal-relative-file)
+ cabal-relative-file)
+ ((file-exists-p src-relative-file)
+ src-relative-file))))
+ (when file
+ (other-window 1)
+ (find-file file)
+ (haskell-interactive-bring)
+ (goto-char (point-min))
+ (forward-line (1- (string-to-number line)))
+ (goto-char (+ (point) (string-to-number col)))
+ (haskell-mode-message-line orig-line)
+ t))))))
(defun haskell-interactive-mode-beginning ()
"Go to the start of the line."

0 comments on commit ed31b18

Please sign in to comment.