Skip to content

Commit 9d46191

Browse files
committed
Add g:OmniSharp_fold_kinds variable
1 parent a53690c commit 9d46191

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

autoload/OmniSharp/actions/fold.vim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ function! s:FindBlocks(codeElements) abort
2222
if type(a:codeElements) != type([]) | return [] | endif
2323
let ranges = []
2424
for element in a:codeElements
25-
if get(element, 'Kind', '') !=# 'namespace'
25+
if len(g:OmniSharp_fold_kinds) == 0 ||
26+
\ index(g:OmniSharp_fold_kinds, get(element, 'Kind', '')) >= 0
2627
if has_key(element, 'Ranges') && has_key(element.Ranges, 'full')
2728
let full = element.Ranges.full
2829
let start = get(get(full, 'Start', {}), 'Line', 0)

plugin/OmniSharp.vim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ let g:OmniSharp_start_server = get(g:, 'OmniSharp_start_server', 1)
1414
let g:OmniSharp_start_without_solution = get(g:, 'OmniSharp_start_without_solution', 1)
1515

1616
let g:OmniSharp_complete_documentation = get(g:, 'OmniSharp_complete_documentation', get(g:, 'omnicomplete_fetch_full_documentation', 1))
17+
let g:OmniSharp_fold_kinds = get(g:, 'OmniSharp_fold_kinds', [])
1718
let g:OmniSharp_loglevel = get(g:, 'OmniSharp_loglevel', g:OmniSharp_server_stdio ? 'info' : 'warning')
1819
let g:OmniSharp_lookup_metadata = get(g:, 'OmniSharp_lookup_metadata', 1)
1920
let g:OmniSharp_open_quickfix = get(g:, 'OmniSharp_open_quickfix', 1)

0 commit comments

Comments
 (0)