dotfiles

My personal shell configs and stuff
git clone git://git.alex.balgavy.eu/dotfiles.git
Log | Files | Refs | Submodules | README | LICENSE

textidote.vim (988B)


      1 " Author: Jordi Altayo <jordiag@kth.se>, Juan Pablo Stumpf
      2 " <juanolon@gmail.com>
      3 " Description: support for textidote grammar and syntax checker
      4 
      5 function! ale_linters#tex#textidote#GetExecutable(buffer) abort
      6     let l:exe = ale#Var(a:buffer, 'tex_textidote_executable')
      7     let l:exe .= ' ' . ale#Var(a:buffer, 'tex_textidote_options')
      8 
      9     let l:check_lang = ale#Var(a:buffer, 'tex_textidote_check_lang')
     10 
     11     if !empty(l:check_lang)
     12         let l:exe .= ' --check ' . l:check_lang
     13     endif
     14 
     15     return l:exe . ' ' . expand('#' . a:buffer . ':p')
     16 endfunction
     17 
     18 function! ale_linters#tex#textidote#Handle(buffer, lines) abort
     19     let l:pattern = '.*L\(\d\+\)C\(\d\+\)-L\d\+C\d\+): \(.*\)'
     20     let l:output = []
     21 
     22     for l:match in ale#util#GetMatches(a:lines, l:pattern)
     23         call add(l:output, {
     24         \   'lnum': l:match[1] + 0,
     25         \   'col' : l:match[2] + 0,
     26         \   'text': l:match[3],
     27         \   'type': 'E',
     28         \})
     29     endfor
     30 
     31     return l:output
     32 endfunction