Skip to content

Commit b45c6f7

Browse files
committed
Improve highlighting of concealed elements
1 parent 373dbf9 commit b45c6f7

File tree

2 files changed

+25
-10
lines changed

2 files changed

+25
-10
lines changed

autoload/OmniSharp/testrunner.vim

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,12 @@ function! s:Paint() abort
118118
for stacktraceline in get(test, 'stacktrace', [])
119119
let line = trim(stacktraceline.text)
120120
if has_key(stacktraceline, 'filename')
121-
let line = '__ ' . line . ' __'
121+
let line = '__ ' . line . ' ___ ' . stacktraceline.filename . ' __ '
122122
else
123-
let line = '_._ ' . line . ' _._'
123+
let line = '_._ ' . line . ' _._ '
124124
endif
125125
if has_key(stacktraceline, 'lnum')
126-
let line .= ' line ' . stacktraceline.lnum
126+
let line .= 'line ' . stacktraceline.lnum
127127
endif
128128
call add(lines, '> ' . line)
129129
endfor
@@ -172,6 +172,7 @@ function! OmniSharp#testrunner#SetTests(bufferTests) abort
172172
call win_gotoid(winid)
173173
endfunction
174174

175+
175176
function! s:UpdateState(bufnr, state, ...) abort
176177
let opts = a:0 ? a:1 : {}
177178
let job = OmniSharp#GetHost(a:bufnr).job

syntax/omnisharptest.vim

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,15 @@ syn match ostRunningSuffix " -- .*" contained contains=ostRunningSpinner,ostRun
3636
syn match ostRunningSuffixDivider " \zs--" conceal contained
3737
syn match ostRunningSpinner " -- \zs.*" contained
3838

39-
syn region ostFailure start="^>" end="^[^>]"me=s-1 contains=ostFailurePrefix,ostStackFile,ostStackFileNoLoc fold
39+
syn region ostFailure start="^>" end="^[^>]"me=s-1 contains=ostFailurePrefix,ostStackLoc,ostStackNoLoc fold
4040
syn match ostFailurePrefix "^>" conceal contained
41-
syn region ostStackFile start=" __ "hs=e+1 end=" __" contains=ostStackFileDelimiter,ostStackFileNamespace contained keepend
42-
syn match ostStackFileDelimiter " __" conceal contained
43-
syn region ostStackFileNoLoc start=" _._ "hs=e+1 end=" _._" contains=ostStackFileNoLocDelimiter,ostStackFileNamespace contained keepend
44-
syn match ostStackFileNoLocDelimiter " _._" conceal contained
45-
syn match ostStackFileNamespace "\%(\w\+\.\)*\ze\w\+\.\w\+(" conceal contained
41+
syn region ostStackLoc start=" __ "hs=e+1 end=" __ "he=e-1 contains=ostStackFile,ostStackDelimiter,ostStackNamespace contained keepend
42+
syn region ostStackFile start=" ___ " end=" __ "he=e-1 contains=ostStackFileDelimiter,ostStackDelimiter conceal contained
43+
syn match ostStackDelimiter " __ "he=e-1 conceal contained
44+
syn match ostStackFileDelimiter " ___ " conceal contained
45+
syn region ostStackNoLoc start=" _._ "hs=e+1 end=" _._" contains=ostStackNoLocDelimiter,ostStackNamespace contained keepend
46+
syn match ostStackNoLocDelimiter " _._" conceal contained
47+
syn match ostStackNamespace "\%(\w\+\.\)*\ze\w\+\.\w\+(" conceal contained
4648
syn region ostOutput start="^//" end="^[^/]"me=s-1 contains=ostOutputPrefix fold
4749
syn match ostOutputPrefix "^//" conceal contained
4850

@@ -59,9 +61,21 @@ hi def link ostStateRunning Identifier
5961
hi def link ostRunningSpinner Normal
6062
hi def link ostStatePassed Title
6163
hi def link ostStateFailed WarningMsg
62-
hi def link ostStackFile Underlined
64+
hi def link ostStackLoc Identifier
6365
hi def link ostOutput Comment
6466

67+
" Highlights for normally concealed elements
68+
hi def link ostErrorPrefix NonText
69+
hi def link ostFileDivider NonText
70+
hi def link ostStatePrefix NonText
71+
hi def link ostFailurePrefix NonText
72+
hi def link ostRunningSuffixDivider NonText
73+
hi def link ostStackDelimiter NonText
74+
hi def link ostStackFileDelimiter NonText
75+
hi def link ostStackNoLocDelimiter NonText
76+
hi def link ostOutputPrefix NonText
77+
hi def link ostStackFile WarningMsg
78+
6579
let b:current_syntax = 'omnisharptest'
6680

6781
let &cpoptions = s:save_cpo

0 commit comments

Comments
 (0)