mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
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:
committed by
Henrik Lissner
parent
aab5215951
commit
34f583d396
@ -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)
|
||||
|
Reference in New Issue
Block a user