2018-05-13 14:15:47 +00:00
|
|
|
;;; funcs.el --- CoffeeScript Layer functions File for Spacemacs
|
|
|
|
;;
|
2020-09-16 21:34:40 +00:00
|
|
|
;; Copyright (c) 2012-2020 Sylvain Benner & Contributors
|
2018-05-13 14:15:47 +00:00
|
|
|
;;
|
|
|
|
;; Author: Muneeb Shaikh <muneeb@reversehack.in>
|
|
|
|
;; URL: https://github.com/syl20bnr/spacemacs
|
|
|
|
;;
|
|
|
|
;; This file is not part of GNU Emacs.
|
|
|
|
;;
|
|
|
|
;;; License: GPLv3
|
|
|
|
|
|
|
|
(defun spacemacs//coffeescript-indent-hook ()
|
|
|
|
(setq indent-line-function 'spacemacs//coffeescript-indent
|
|
|
|
evil-shift-width coffee-tab-width))
|
|
|
|
|
|
|
|
(defun spacemacs//coffeescript-indent ()
|
|
|
|
(if (coffee-line-wants-indent)
|
|
|
|
;; We need to insert an additional tab because
|
|
|
|
;; the last line was special.
|
|
|
|
(coffee-insert-spaces (+ (coffee-previous-indent) coffee-tab-width))
|
|
|
|
;; otherwise keep at the same indentation level
|
|
|
|
(coffee-insert-spaces (coffee-previous-indent))))
|