fix(ocaml): Prevent clobbering +format-with globally
Previously, loading the `ocaml` module and opening a file in Tuareg mode would result in every buffer having its formatter set to `ocp-indent`. This now restricts the formatter override to the current buffer.
This commit is contained in:
parent
aab5215951
commit
34f583d396
1 changed files with 2 additions and 2 deletions
|
@ -109,7 +109,7 @@
|
|||
:config
|
||||
;; TODO Fix region-based formatting support
|
||||
(defun +ocaml-init-ocamlformat-h ()
|
||||
(setq +format-with 'ocp-indent)
|
||||
(setq-local +format-with 'ocp-indent)
|
||||
(when (and (executable-find "ocamlformat")
|
||||
(locate-dominating-file default-directory ".ocamlformat"))
|
||||
(when buffer-file-name
|
||||
|
@ -118,7 +118,7 @@
|
|||
(setq-local ocamlformat-file-kind 'implementation))
|
||||
((equal ext ".eliomi")
|
||||
(setq-local ocamlformat-file-kind 'interface)))))
|
||||
(setq +format-with 'ocamlformat))))
|
||||
(setq-local +format-with 'ocamlformat))))
|
||||
|
||||
;; Tree sitter
|
||||
(eval-when! (modulep! +tree-sitter)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue