lang/ocaml: ensure * in block comments are padded

(*
 * <-- ensures there is at least one space here
 *)
This commit is contained in:
Henrik Lissner 2019-07-08 21:42:19 +02:00
parent c14a4c8818
commit 56393420e5
No known key found for this signature in database
GPG Key ID: 5F6C0EA160557395
2 changed files with 13 additions and 0 deletions

View File

@ -0,0 +1,9 @@
;;; lang/ocaml/autoload.el -*- lexical-binding: t; -*-
;;;###autoload
(defun +ocaml/comment-indent-new-line ()
"Break line at point and indent, continuing comment if within one."
(interactive)
(comment-indent-new-line)
(when (eq (char-before) ?*)
(just-one-space)))

View File

@ -21,6 +21,10 @@
(when (featurep! :tools flyspell)
(add-hook 'tuareg-mode-local-vars-hook #'flyspell-prog-mode))
;; Ensure asterixes in block comments have at least one space of indentation
(setq-hook! 'tuareg-mode-hook
comment-line-break-function #'+ocaml/comment-indent-new-line)
(def-package! merlin
:unless (featurep! +lsp)