Skip to content

Commit 028fe6c

Browse files
BokayTrevoke
authored andcommitted
Locate closest .formatter.exs from the file format on save (#418)
1 parent a00233c commit 028fe6c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,9 @@ or you set `elixir-format-arguments` in a hook like this:
209209
``` elisp
210210
(add-hook 'elixir-format-hook (lambda ()
211211
(if (projectile-project-p)
212-
(setq elixir-format-arguments (list "--dot-formatter" (concat (projectile-project-root) "/.formatter.exs")))
212+
(setq elixir-format-arguments
213+
(list "--dot-formatter"
214+
(concat (locate-dominating-file buffer-file-name ".formatter.exs") ".formatter.exs")))
213215
(setq elixir-format-arguments nil))))
214216
```
215217

0 commit comments

Comments
 (0)