mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
lang/ocaml: make asterix in continued comments optional
This commit is contained in:
@ -5,5 +5,5 @@
|
||||
"Break line at point and indent, continuing comment if within one."
|
||||
(interactive)
|
||||
(comment-indent-new-line)
|
||||
(when (eq (char-before) ?*)
|
||||
(when (and +ocaml-prefix-comments-with-asterisk (eq (char-before) ?*))
|
||||
(just-one-space)))
|
||||
|
@ -1,5 +1,12 @@
|
||||
;;; lang/ocaml/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(defvar +ocaml-prefix-comments-with-asterisk t
|
||||
"If non-nil, continue block comments with a leading asterisk.")
|
||||
|
||||
|
||||
;;
|
||||
;;; Packages
|
||||
|
||||
(when (featurep! +lsp)
|
||||
(add-hook! '(tuareg-mode-local-vars-hook reason-mode-local-vars-hook)
|
||||
#'lsp!))
|
||||
@ -21,7 +28,8 @@
|
||||
(when (featurep! :checkers spell)
|
||||
(add-hook 'tuareg-mode-local-vars-hook #'flyspell-prog-mode))
|
||||
|
||||
;; Ensure asterixes in block comments have at least one space of indentation
|
||||
;; Indent new lines in a comment block, and optionally prefix new comment
|
||||
;; lines with an asterix. See `+ocaml-prefix-comments-with-asterisk'.
|
||||
(setq-hook! 'tuareg-mode-hook
|
||||
comment-line-break-function #'+ocaml/comment-indent-new-line)
|
||||
|
||||
|
Reference in New Issue
Block a user