Skip to content

Commit

Permalink
Determine indent level from more modes
Browse files Browse the repository at this point in the history
Namely `graphql-mode`, `html-mode`, `ruby-mode`, `ruby-ts-mode`,
`svelte-mode`, and `yaml-mode`.
  • Loading branch information
scop committed Dec 3, 2023
1 parent 8f512db commit a79f027
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ The format is based on [Keep a Changelog].
* Use `perltidy` as default formatter for `cperl-mode` ([#260]).
* The `perltidy` formatter now supports Emacs indentation and line length
settings ([#261]).
* Indent level is now determined for `graphql-mode`, `html-mode`, `ruby-mode`,
`ruby-ts-mode`, `svelte-mode`, and `yaml-mode` ([#258]).

### Formatters
* [`js-beautify`](https://github.com/beautify-web/js-beautify) for
Expand All @@ -22,6 +24,7 @@ The format is based on [Keep a Changelog].
js, jsx, ts, tsx, json, jsonc, md files. ([#264])

[#229]: https://github.com/radian-software/apheleia/pull/229
[#258]: https://github.com/radian-software/apheleia/pull/258
[#260]: https://github.com/radian-software/apheleia/pull/260
[#261]: https://github.com/radian-software/apheleia/pull/261
[#263]: https://github.com/radian-software/apheleia/pull/263
Expand Down
8 changes: 7 additions & 1 deletion apheleia-utils.el
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ always returns nil to defer to the formatter."
(cperl-mode 'cperl-indent-level)
(css-mode 'css-indent-offset)
(css-ts-mode 'css-indent-offset)
(graphql-mode 'graphql-indent-level)
(html-mode 'sgml-basic-offset)
(js-jsx-mode 'js-indent-level)
(js-ts-mode 'js-indent-level)
(js-mode 'js-indent-level)
Expand All @@ -49,11 +51,15 @@ always returns nil to defer to the formatter."
(nxml-mode 'nxml-child-indent)
(robot-mode 'robot-mode-basic-offset)
(perl-mode 'perl-indent-level)
(ruby-mode 'ruby-indent-level)
(ruby-ts-mode 'ruby-indent-level)
(scss-mode 'css-indent-offset)
(svelte-mode 'svelte-basic-offset)
(web-mode 'web-mode-indent-style)
(tsx-ts-mode 'typescript-ts-mode-indent-offset)
(typescript-mode 'typescript-indent-level)
(typescript-ts-mode 'typescript-ts-mode-indent-offset))))
(typescript-ts-mode 'typescript-ts-mode-indent-offset)
(yaml-mode 'yaml-indent-offset))))

(when-let ((indent (and indent-var
(boundp indent-var)
Expand Down

0 comments on commit a79f027

Please sign in to comment.