From f426623e4b8e33ea3baa720e22c471e157059e0c Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 25 Feb 2020 22:25:39 -0500 Subject: [PATCH] Revert 3bb384f95 & improve ocaml comment continuation Back to the default behavior because this implementation was too buggy. Solution needs a rework. --- modules/config/default/config.el | 2 +- modules/lang/ocaml/autoload.el | 6 ++++-- modules/lang/ocaml/config.el | 4 ---- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/modules/config/default/config.el b/modules/config/default/config.el index 3ab8601cc..6abf44aa1 100644 --- a/modules/config/default/config.el +++ b/modules/config/default/config.el @@ -178,7 +178,7 @@ (sp-local-pair "(*" "*)" :actions nil) (sp-local-pair "(*" "*" :actions '(insert) - :post-handlers '(("| " "SPC") ("|\n[i]*)[d-2]" "RET"))))) + :post-handlers '(("| " "SPC") ("|[i]*)[d-2]" "RET"))))) (after! smartparens-markdown (sp-with-modes '(markdown-mode gfm-mode) diff --git a/modules/lang/ocaml/autoload.el b/modules/lang/ocaml/autoload.el index 45a942d07..58de22d9c 100644 --- a/modules/lang/ocaml/autoload.el +++ b/modules/lang/ocaml/autoload.el @@ -5,5 +5,7 @@ "Break line at point and indent, continuing comment if within one." (interactive) (comment-indent-new-line) - (when (and +ocaml-prefix-comments-with-asterisk (eq (char-before) ?*)) - (just-one-space))) + (when (eq (char-before) ?*) + (just-one-space)) + (unless (eq (char-after) 32) + (save-excursion (insert " ")))) diff --git a/modules/lang/ocaml/config.el b/modules/lang/ocaml/config.el index 1ae00fcc5..a1d04715e 100644 --- a/modules/lang/ocaml/config.el +++ b/modules/lang/ocaml/config.el @@ -1,9 +1,5 @@ ;;; 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