Elixir: move function to packages-funcs.el and prefix it
This commit is contained in:
parent
c476c03360
commit
86003bfc75
|
@ -102,23 +102,17 @@
|
|||
(spacemacs|add-company-hook elixir-mode)
|
||||
(spacemacs|add-company-hook alchemist-iex-mode))
|
||||
|
||||
(defun elixir-do-end-close-action (id action context)
|
||||
(when (eq action 'insert)
|
||||
(newline-and-indent)
|
||||
(forward-line -1)
|
||||
(indent-according-to-mode)))
|
||||
|
||||
(defun elixir/post-init-smartparens ()
|
||||
(sp-with-modes '(elixir-mode)
|
||||
(sp-local-pair "->" "end"
|
||||
:when '(("RET"))
|
||||
:post-handlers '(:add elixir-do-end-close-action)
|
||||
:post-handlers '(:add spacemacs//elixir-do-end-close-action)
|
||||
:actions '(insert)))
|
||||
|
||||
(sp-with-modes '(elixir-mode)
|
||||
(sp-local-pair "do" "end"
|
||||
:when '(("SPC" "RET"))
|
||||
:post-handlers '(:add elixir-do-end-close-action)
|
||||
:post-handlers '(:add spacemacs//elixir-do-end-close-action)
|
||||
:actions '(insert))))
|
||||
|
||||
(defun elixir/init-elixir-mode ()
|
||||
|
|
16
layers/+lang/elixir/packages-funcs.el
Normal file
16
layers/+lang/elixir/packages-funcs.el
Normal file
|
@ -0,0 +1,16 @@
|
|||
;;; packages-funcs.el --- Elixir Layer packages functions File for Spacemacs
|
||||
;;
|
||||
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
|
||||
;;
|
||||
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
|
||||
;; URL: https://github.com/syl20bnr/spacemacs
|
||||
;;
|
||||
;; This file is not part of GNU Emacs.
|
||||
;;
|
||||
;;; License: GPLv3
|
||||
|
||||
(defun spacemacs//elixir-do-end-close-action (id action context)
|
||||
(when (eq action 'insert)
|
||||
(newline-and-indent)
|
||||
(forward-line -1)
|
||||
(indent-according-to-mode)))
|
Loading…
Reference in a new issue