robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

zeertzjqvim-patch:8f551a7: runtime: regenerate helptags, update last-change header in tombi compiler89030f3ac4

master
2.1 KiB69 linesraw
1" Vim compiler file
2" Language:    TOML
3" Maintainer:  Konfekt
4" Last Change: 2025 Oct 29
5
6if exists("current_compiler") | finish | endif
7let current_compiler = "tombi"
8
9let s:cpo_save = &cpo
10set cpo&vim
11
12if !executable('tombi')
13  echoerr "tombi compiler: 'tombi' executable not found in PATH"
14  let &cpo = s:cpo_save
15  unlet s:cpo_save
16  finish
17endif
18
19" NO_COLOR support requires tombi 0.6.40 or later
20if !exists('s:tombi_nocolor')
21  " Expect output like: 'tombi 0.6.40' or '0.6.40'
22  let s:out = trim(system('tombi --version'))
23  let s:tombi_ver = matchstr(s:out, '\v\s\d+\.\d+\.\d+$')
24
25  function s:VersionGE(ver, req) abort
26    " Compare semantic versions a.b.c ≥ x.y.z
27    let l:pa = map(split(a:ver, '\.'), 'str2nr(v:val)')
28    let l:pb = map(split(a:req, '\.'), 'str2nr(v:val)')
29    while len(l:pa) < 3 | call add(l:pa, 0) | endwhile
30    while len(l:pb) < 3 | call add(l:pb, 0) | endwhile
31    for i in range(0, 2)
32      if l:pa[i] > l:pb[i] | return 1
33      elseif l:pa[i] < l:pb[i] | return 0
34      endif
35    endfor
36    return 1
37  endfunction
38  let s:tombi_nocolor = s:VersionGE(s:tombi_ver, '0.6.40')
39  delfunction s:VersionGE
40endif
41
42if s:tombi_nocolor
43  if has('win32')
44    if &shell =~# '\v<%(cmd|cmd)>'
45      CompilerSet makeprg=set\ NO_COLOR=1\ &&\ tombi\ lint
46    elseif &shell =~# '\v<%(powershell|pwsh)>'
47      CompilerSet makeprg=$env:NO_COLOR=\"1\";\ tombi\ lint
48    else
49      echoerr "tombi compiler: Unsupported shell for Windows"
50    endif
51  else " if has('unix')
52    CompilerSet makeprg=env\ NO_COLOR=1\ tombi\ lint
53  endif
54else
55  " Older tombi: strip ANSI color codes with sed.
56  if executable('sed')
57    CompilerSet makeprg=tombi\ lint\ $*\ \|\ sed\ -E\ \"s/\\x1B(\\[[0-9;]*[JKmsu]\|\\(B)//g\"
58  else
59    echoerr "tombi compiler: tombi version < 0.6.40 requires 'sed' to strip ANSI color codes"
60  endif
61endif
62
63CompilerSet errorformat=%E%*\\sError:\ %m,%Z%*\\sat\ %f:%l:%c
64CompilerSet errorformat+=%W%*\\sWarning:\ %m,%Z%*\\sat\ %f:%l:%c
65CompilerSet errorformat+=%-G1\ file\ failed\ to\ be\ linted
66CompilerSet errorformat+=%-G1\ file\ linted\ successfully
67
68let &cpo = s:cpo_save
69unlet s:cpo_save