Merge pull request #2351 from nam3less/feature-haskell-evil-integration

Correct behaviour of normal mode 'o' and 'O' in haskell-mode
This commit is contained in:
Henrik Lissner 2020-02-20 20:30:00 -05:00 committed by GitHub
commit 61ed90c273
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 0 deletions

View file

@ -12,3 +12,20 @@
(haskell-session-interactive-buffer (haskell-session)))))) (haskell-session-interactive-buffer (haskell-session))))))
(window-buffer window) (window-buffer window)
(error "Failed to display Haskell REPL"))) (error "Failed to display Haskell REPL")))
;;;###autoload
(defun +haskell/evil-open-above ()
"Opens a line above the current mode"
(interactive)
(evil-digit-argument-or-evil-beginning-of-line)
(haskell-indentation-newline-and-indent)
(evil-previous-line)
(haskell-indentation-indent-line)
(evil-append-line nil))
;;;###autoload
(defun +haskell/evil-open-below ()
"Opens a line below the current mode"
(interactive)
(evil-append-line nil)
(haskell-indentation-newline-and-indent))

View file

@ -32,6 +32,10 @@
(add-to-list 'completion-ignored-extensions ".hi") (add-to-list 'completion-ignored-extensions ".hi")
(map! :map haskell-mode-map
:n "o" #'+haskell/evil-open-below
:n "O" #'+haskell/evil-open-above)
(map! :localleader (map! :localleader
:map haskell-mode-map :map haskell-mode-map
;; this is set to use cabal for dante users and stack for intero users: ;; this is set to use cabal for dante users and stack for intero users: