Skip to content

Commit

Permalink
Add support for curly code folding
Browse files Browse the repository at this point in the history
  • Loading branch information
jrudess committed Aug 2, 2018
1 parent 9626ac2 commit 4b036ca
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
7 changes: 7 additions & 0 deletions plugin/verilog_systemverilog.vim
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,13 @@ let g:verilog_syntax = {
\ 'highlight' : 'verilogStatement',
\ 'syn_argument': 'transparent keepend',
\ }],
\ 'curly' : [{
\ 'match_start' : '{',
\ 'match_skip' : '/[*/].*',
\ 'match_end' : '}',
\ 'highlight' : 'verilogOperator',
\ 'syn_argument': 'transparent',
\ }],
\ 'define' : [{
\ 'match_start' : '`ifn\?def\>',
\ 'match_mid' : '`els\(e\|if\)\>',
Expand Down
11 changes: 8 additions & 3 deletions syntax/verilog_systemverilog.vim
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,13 @@ function! s:SyntaxCreate(name, verilog_syntax)
let verilog_syn_region_cmd .= ' matchgroup='.entry["highlight"]
endif

let verilog_syn_region_cmd .=
\ ' start="'.region_start.'"'
\ .' end="'.region_end.'"'
let verilog_syn_region_cmd .= ' start="'.region_start.'"'

if exists('entry["match_skip"]')
let verilog_syn_region_cmd .= ' skip="'.entry["match_skip"].'"'
endif

let verilog_syn_region_cmd .= ' end="'.region_end.'"'

if exists('entry["syn_argument"]')
let verilog_syn_region_cmd .= ' '.entry["syn_argument"]
Expand Down Expand Up @@ -223,6 +227,7 @@ let s:verilog_syntax_order = [
\ 'sequence',
\ 'specify',
\ 'task',
\ 'curly',
\ ]

" Generate syntax definitions for supported types
Expand Down

0 comments on commit 4b036ca

Please sign in to comment.