Skip to content

Commit 75a6607

Browse files
author
jrudess
committed
Add curly-brace code folding
1 parent 9626ac2 commit 75a6607

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

doc/verilog_systemverilog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,7 @@ Default: undefined
445445
- `block_nested` (like "block", but allows nesting)
446446
- `block_named` (like "block", but allows nesting and only folds if `begin` is labelled)
447447
- `comment` (`/*..*/`)
448+
- `curly` (`{ .. }`)
448449
- `define` (preprocessor conditional statement)
449450
- `instance`
450451
- `all` (enables all above options)

syntax/verilog_systemverilog.vim

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,17 @@ else
286286
syn keyword verilogStatement begin end
287287
endif
288288

289+
if index(s:verilog_syntax_fold, "curly") >= 0 || index(s:verilog_syntax_fold, "all") >= 0
290+
syn region verilogCurlyBlock
291+
\ matchgroup=verilogOperator
292+
\ start="{"
293+
\ skip="/[*/].*"
294+
\ end="}"
295+
\ fold
296+
\ transparent
297+
\ contains=TOP
298+
endif
299+
289300
if index(s:verilog_syntax_fold, "define") >= 0 || index(s:verilog_syntax_fold, "all") >= 0
290301
syn region verilogIfdef
291302
\ start="`ifn\?def\>"

0 commit comments

Comments
 (0)