add support and test for box/end box blocks
This commit is contained in:
parent
fb427db400
commit
1e761fbd04
|
@ -357,13 +357,15 @@ might follow).")
|
|||
Two variants for groups: keyword is either followed by whitespace and some text
|
||||
or it is followed by line end.")
|
||||
(defvar plantuml-indent-regexp-activate-start "^\s*activate\s+.+$")
|
||||
(defvar plantuml-indent-regexp-box-start "^\s*box\s+.+$")
|
||||
(defvar plantuml-indent-regexp-if-start "^\s*\\(\\(?:.*\\)?\s*\\(?:[<>.*a-z-|]+\\)?\s*\\(?:\\[[a-zA-Z]+\\]\\)?\s+if\s+.*\\)")
|
||||
(defvar plantuml-indent-regexp-start (list plantuml-indent-regexp-block-start
|
||||
plantuml-indent-regexp-note-start
|
||||
plantuml-indent-regexp-group-start
|
||||
plantuml-indent-regexp-activate-start
|
||||
plantuml-indent-regexp-box-start
|
||||
plantuml-indent-regexp-if-start))
|
||||
(defvar plantuml-indent-regexp-end "^\s*\\(endif\\|else\\|end\\|end\s+note\\|.*}\\|deactivate\s+.+\\)")
|
||||
(defvar plantuml-indent-regexp-end "^\s*\\(endif\\|else\\|end\\|end\s+note\\|end\s+box\\|.*}\\|deactivate\s+.+\\)")
|
||||
|
||||
(setq plantuml-font-lock-keywords
|
||||
`(
|
||||
|
|
|
@ -331,6 +331,22 @@ abstract class Foo {
|
|||
}
|
||||
"))
|
||||
|
||||
(ert-deftest platuml-test-block-indentation/box ()
|
||||
"Test correct indentation of a box block"
|
||||
(plantuml-test-indent-block
|
||||
"
|
||||
box \"Device with USB connector\"
|
||||
actor Human
|
||||
participant UsbDetector
|
||||
end box
|
||||
"
|
||||
"
|
||||
box \"Device with USB connector\"
|
||||
actor Human
|
||||
participant UsbDetector
|
||||
end box
|
||||
" ))
|
||||
|
||||
(ert-deftest plantuml-test-block-indentation/various-keywords ()
|
||||
"Test correct indentation of block keywords."
|
||||
(plantuml-test-indent-block
|
||||
|
|
Loading…
Reference in New Issue