[haskell] fix REPL bring function

So now, instead of switching to it - `SPC m s s` shows REPL buffer
without switching to it.
This commit is contained in:
d12frosted 2015-10-24 10:58:12 +03:00 committed by Eivind Fonn
parent 68fa0330e4
commit 59342f7cdb
2 changed files with 10 additions and 2 deletions

View File

@ -277,7 +277,7 @@ REPL commands are prefixed by ~SPC m s~:
|-------------+-------------------------------------------------|
| ~SPC m s b~ | load or reload the current buffer into the REPL |
| ~SPC m s c~ | clear the REPL |
| ~SPC m s s~ | show the REPL |
| ~SPC m s s~ | show the REPL without switching to it |
| ~SPC m s S~ | show and switch to the REPL |
** Cabal commands

View File

@ -64,6 +64,14 @@
;; in structured-haskell-mode line highlighting creates noise
(setq-local global-hl-line-mode nil)))
(defun spacemacs/haskell-interactive-bring ()
"Bring up the interactive mode for this session without
switching to it."
(interactive)
(let* ((session (haskell-session))
(buffer (haskell-session-interactive-buffer session)))
(display-buffer buffer)))
;; hooks
(add-hook 'haskell-mode-hook 'spacemacs/init-haskell-mode)
(add-hook 'haskell-cabal-mode-hook 'haskell-cabal-hook)
@ -104,7 +112,7 @@
"msb" 'haskell-process-load-or-reload
"msc" 'haskell-interactive-mode-clear
"mss" 'haskell-interactive-bring
"mss" 'spacemacs/haskell-interactive-bring
"msS" 'haskell-interactive-switch
"mca" 'haskell-process-cabal