Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add compatibility with emacs ocaml tree-sitter modes #2600

Merged
merged 3 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ profile. This started with version 0.26.0.

### Added

- Allow a custom command to be used to run ocamlformat in the emacs plugin (#2577, @gridbugs)
- Improve the emacs plugin (#2577, #2600, @gridbugs, @thibautbenjamin)
Allow a custom command to be used to run ocamlformat and add compatibility
with emacs ocaml tree-sitter modes.

- Added option `let-binding-deindent-fun` (#2521, @henrytill)
to control the indentation of the `fun` in:
Expand Down
4 changes: 3 additions & 1 deletion emacs/ocamlformat.el
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ nil (default)."

\(add-hook \\='before-save-hook \\='ocamlformat-before-save)."
(interactive)
(when (memq major-mode '(tuareg-mode caml-mode)) (ocamlformat)))
(when
(memq major-mode '(tuareg-mode caml-mode ocaml-ts-mode ocamli-ts-mode))
(ocamlformat)))

(defun ocamlformat--goto-line (line)
"Move point to the line numbered LINE."
Expand Down