mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-11-25 07:28:20 +00:00
Add M-x align
support to conf-toml-mode
* lisp/align.el (align-rules-list): Add rule for conf-toml-mode. * test/lisp/align-resources/conf-toml-mode.erts: New file. * test/lisp/align-tests.el (align-toml): New test.
This commit is contained in:
parent
3e505d36ac
commit
a3979a6643
@ -568,7 +568,14 @@ The possible settings for `align-region-separate' are:
|
||||
(css-declaration
|
||||
(regexp . "^\\s-*\\(?:\\w-?\\)+:\\(\\s-*\\).*;")
|
||||
(group . (1))
|
||||
(modes . '(css-mode html-mode))))
|
||||
(modes . '(css-mode html-mode)))
|
||||
|
||||
(toml-assignment
|
||||
(regexp . ,(rx (group (zero-or-more (syntax whitespace)))
|
||||
"="
|
||||
(group (zero-or-more (syntax whitespace)))))
|
||||
(group . (1 2))
|
||||
(modes . '(conf-toml-mode))))
|
||||
"A list describing all of the available alignment rules.
|
||||
The format is:
|
||||
|
||||
|
45
test/lisp/align-resources/conf-toml-mode.erts
Normal file
45
test/lisp/align-resources/conf-toml-mode.erts
Normal file
@ -0,0 +1,45 @@
|
||||
Name: align key-value pairs
|
||||
|
||||
=-=
|
||||
[foo]
|
||||
foo1=10
|
||||
foo22=20
|
||||
|
||||
[bar]
|
||||
bar333="example.org"
|
||||
bar4444 = "zzz"
|
||||
=-=
|
||||
[foo]
|
||||
foo1 = 10
|
||||
foo22 = 20
|
||||
|
||||
[bar]
|
||||
bar333 = "example.org"
|
||||
bar4444 = "zzz"
|
||||
=-=-=
|
||||
|
||||
Name: align list values
|
||||
|
||||
=-=
|
||||
[foo]
|
||||
a = 1
|
||||
some_list = [
|
||||
true,
|
||||
false,
|
||||
]
|
||||
some_other_list = [
|
||||
1,
|
||||
2,
|
||||
]
|
||||
=-=
|
||||
[foo]
|
||||
a = 1
|
||||
some_list = [
|
||||
true,
|
||||
false,
|
||||
]
|
||||
some_other_list = [
|
||||
1,
|
||||
2,
|
||||
]
|
||||
=-=-=
|
@ -38,6 +38,11 @@
|
||||
(ert-test-erts-file (ert-resource-file "java-mode.erts")
|
||||
(test-align-transform-fun #'java-mode)))
|
||||
|
||||
(ert-deftest align-toml ()
|
||||
(let ((indent-tabs-mode nil))
|
||||
(ert-test-erts-file (ert-resource-file "conf-toml-mode.erts")
|
||||
(test-align-transform-fun #'conf-toml-mode))))
|
||||
|
||||
(provide 'align-tests)
|
||||
|
||||
;;; align-tests.el ends here
|
||||
|
Loading…
Reference in New Issue
Block a user