diff --git a/rc/filetype/vhdl.kak b/rc/filetype/vhdl.kak index 26efe0bb..bcf082d0 100644 --- a/rc/filetype/vhdl.kak +++ b/rc/filetype/vhdl.kak @@ -232,6 +232,13 @@ define-command -hidden vhdl-insert-on-new-line %[ execute-keys -draft oxendprotected ] ] + # Wisely add "end protected body;". + evaluate-commands %[ + try %[ + execute-keys -draft k ^(?i)(\h*type\h+\w+\h+is\h+protected\h+body$) }i ^x(?i)end\h+protected\h+body\b + execute-keys -draft oxendprotectedbody + ] + ] # Wisely add "end record;". evaluate-commands %[ try %[ @@ -271,10 +278,10 @@ define-command -hidden vhdl-insert-on-new-line %[ execute-keys -draft oxbeginxendprocedure ] try %[ - execute-keys -draft k ^(?i)\h*\)\h*\bis$ }i ^x(?i)\b(begin|end)\b - # Verify that line with opening parenthesis contains "procedure" keyword. - execute-keys -draft k s\) (?i)\bprocedure\b - execute-keys -draft oxbeginxendprocedure + execute-keys -draft k ^(?i)\h*\)\h*\bis$ }i ^x(?i)\b(begin|end)\b + # Verify that line with opening parenthesis contains "procedure" keyword. + execute-keys -draft k s\) (?i)\bprocedure\b + execute-keys -draft oxbeginxendprocedure ] ] # Wisely add "end package;". @@ -375,7 +382,7 @@ define-command -hidden vhdl-indent-on-new-line %{ # Increase indent after some keywords. try %[ - execute-keys -draft k (?i)\b(begin|block|else|for|generate|if|is|loop|process|protected|record|select|then)$ + execute-keys -draft k (?i)\b(begin|block|body|else|for|generate|if|is|loop|process|protected|record|select|then)$ # Does not indent if in comment line. execute-keys -draft k(?i)^\h*-- # Handle case line in a bit different way.