summaryrefslogtreecommitdiffstats
path: root/syntax/godefstack.vim
blob: 161296a2d6843ea472644ccf1dff7619921b2a1e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
let files = filter(globpath(&rtp, 'syntax/godefstack.vim', 1, 1), { _, v -> v !~ "vim-polyglot" && v !~ $VIMRUNTIME && v !~ "after" })
if len(files) > 0
  exec 'source ' . files[0]
  finish
endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'go') == -1

if exists("b:current_syntax")
  finish
endif

syn match godefStackComment             '^".*'
syn match godefLinePrefix               '^[>\s]\s' nextgroup=godefStackEntryNumber contains=godefStackCurrentPosition
syn match godefStackEntryNumber         '\d\+' nextgroup=godefStackFilename skipwhite
syn match godefStackCurrentPosition     '>' contained
syn match godefStackFilename            '[^|]\+' contained nextgroup=godefStackEntryLocation
syn region godefStackEntryLocation      oneline start='|' end='|' contained contains=godefStackEntryLocationNumber
syn match godefStackEntryLocationNumber '\d\+' contained display

let b:current_syntax = "godefstack"

hi def link godefStackComment           Comment
hi def link godefStackCurrentPosition   Special
hi def link godefStackFilename          Directory
hi def link godefStackEntryLocationNumber LineNr

" vim: sw=2 ts=2 et

endif