Added extra keywords to the indentation block start regex
Keywords added: - `folder` - `frame` - `cloud` Fixes #78
This commit is contained in:
parent
0374482cf7
commit
56d668c54e
|
@ -341,7 +341,7 @@ Uses prefix (as PREFIX) to choose where to display it:
|
||||||
(defvar plantuml-keywords-regexp (concat "^\\s *" (regexp-opt plantuml-keywords 'words) "\\|\\(<\\|<|\\|\\*\\|o\\)\\(\\.+\\|-+\\)\\|\\(\\.+\\|-+\\)\\(>\\||>\\|\\*\\|o\\)\\|\\.\\{2,\\}\\|-\\{2,\\}"))
|
(defvar plantuml-keywords-regexp (concat "^\\s *" (regexp-opt plantuml-keywords 'words) "\\|\\(<\\|<|\\|\\*\\|o\\)\\(\\.+\\|-+\\)\\|\\(\\.+\\|-+\\)\\(>\\||>\\|\\*\\|o\\)\\|\\.\\{2,\\}\\|-\\{2,\\}"))
|
||||||
(defvar plantuml-builtins-regexp (regexp-opt plantuml-builtins 'words))
|
(defvar plantuml-builtins-regexp (regexp-opt plantuml-builtins 'words))
|
||||||
(defvar plantuml-preprocessors-regexp (concat "^\\s *" (regexp-opt plantuml-preprocessors 'words)))
|
(defvar plantuml-preprocessors-regexp (concat "^\\s *" (regexp-opt plantuml-preprocessors 'words)))
|
||||||
(defvar plantuml-indent-regexp-start "^[ \t]*\\(\\(?:.*\\)?\s*\\(?:[<>.*a-z-|]+\\)?\s*\\(?:\\[[a-zA-Z]+\\]\\)?\s+if\s+.*\\|loop\s+.*\\|group\s+.*\\|par\s*$\\|opt\s+.*\\|alt\s+.*\\|else\\|note\s+over\\|note\sas\s.*\\|note\s+\\(\\(?:\\(?:buttom\\|left\\|right\\|top\\)\\)\\)\\(?:\s+of\\)?\\|\\(?:class\\|enum\\|package\\|database\\)\s+.*{\\|activate\s+.+\\)")
|
(defvar plantuml-indent-regexp-start "^[ \t]*\\(\\(?:.*\\)?\s*\\(?:[<>.*a-z-|]+\\)?\s*\\(?:\\[[a-zA-Z]+\\]\\)?\s+if\s+.*\\|loop\s+.*\\|group\s+.*\\|par\s*$\\|opt\s+.*\\|alt\s+.*\\|else\\|note\s+over\\|note\sas\s.*\\|note\s+\\(\\(?:\\(?:button\\|left\\|right\\|top\\)\\)\\)\\(?:\s+of\\)?\\|\\(?:class\\|enum\\|package\\|database\\|frame\\|cloud\\|folder\\)\s+.*{\\|activate\s+.+\\)")
|
||||||
(defvar plantuml-indent-regexp-end "^[ \t]*\\(endif\\|else\\|end\\|end\s+note\\|.*}\\|deactivate\s+.+\\)")
|
(defvar plantuml-indent-regexp-end "^[ \t]*\\(endif\\|else\\|end\\|end\s+note\\|.*}\\|deactivate\s+.+\\)")
|
||||||
|
|
||||||
(setq plantuml-font-lock-keywords
|
(setq plantuml-font-lock-keywords
|
||||||
|
|
|
@ -306,6 +306,42 @@ package APackage {
|
||||||
}
|
}
|
||||||
"))
|
"))
|
||||||
|
|
||||||
|
(ert-deftest plantuml-test-block-indentation/various-keywords ()
|
||||||
|
"Test correct indentation of a package block."
|
||||||
|
(plantuml-test-indent-block
|
||||||
|
"
|
||||||
|
cloud \"mycloud\" {
|
||||||
|
[Cloud]
|
||||||
|
}
|
||||||
|
"
|
||||||
|
"
|
||||||
|
cloud \"mycloud\" {
|
||||||
|
[Cloud]
|
||||||
|
}
|
||||||
|
")
|
||||||
|
(plantuml-test-indent-block
|
||||||
|
"
|
||||||
|
folder \"myfolder\" {
|
||||||
|
[Folder]
|
||||||
|
}
|
||||||
|
"
|
||||||
|
"
|
||||||
|
folder \"myfolder\" {
|
||||||
|
[Folder]
|
||||||
|
}
|
||||||
|
")
|
||||||
|
(plantuml-test-indent-block
|
||||||
|
"
|
||||||
|
frame \"myframe\" {
|
||||||
|
[Frame]
|
||||||
|
}
|
||||||
|
"
|
||||||
|
"
|
||||||
|
frame \"myframe\" {
|
||||||
|
[Frame]
|
||||||
|
}
|
||||||
|
"))
|
||||||
|
|
||||||
(ert-deftest plantuml-test-block-indentation/package-database-nested ()
|
(ert-deftest plantuml-test-block-indentation/package-database-nested ()
|
||||||
"Test correct indentation of two nested blocks, a package and a database.
|
"Test correct indentation of two nested blocks, a package and a database.
|
||||||
Note: currently the inner database is not indented."
|
Note: currently the inner database is not indented."
|
||||||
|
|
Loading…
Reference in New Issue