2010-12-07 11:25:27 -05:00
|
|
|
"============================================================================
|
|
|
|
"File: less.vim
|
2017-09-15 14:04:16 -04:00
|
|
|
"Description: Syntax checking plugin for syntastic
|
2010-12-07 11:38:36 -05:00
|
|
|
"Maintainer: Julien Blanchard <julien at sideburns dot eu>
|
2010-12-07 11:25:27 -05:00
|
|
|
"License: This program is free software. It comes without any warranty,
|
|
|
|
" to the extent permitted by applicable law. You can redistribute
|
|
|
|
" it and/or modify it under the terms of the Do What The Fuck You
|
|
|
|
" Want To Public License, Version 2, as published by Sam Hocevar.
|
|
|
|
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
|
|
|
"
|
|
|
|
"============================================================================
|
2012-08-31 11:48:17 -04:00
|
|
|
|
2015-03-25 12:44:34 -04:00
|
|
|
if exists('g:loaded_syntastic_less_lessc_checker')
|
2013-02-21 10:50:41 -05:00
|
|
|
finish
|
|
|
|
endif
|
2014-01-03 04:29:08 -05:00
|
|
|
let g:loaded_syntastic_less_lessc_checker = 1
|
2013-02-21 10:50:41 -05:00
|
|
|
|
2015-03-25 12:44:34 -04:00
|
|
|
if !exists('g:syntastic_less_use_less_lint')
|
2012-09-23 10:26:59 -04:00
|
|
|
let g:syntastic_less_use_less_lint = 0
|
|
|
|
endif
|
|
|
|
|
2014-01-05 01:31:29 -05:00
|
|
|
let s:save_cpo = &cpo
|
|
|
|
set cpo&vim
|
|
|
|
|
2015-01-04 02:01:55 -05:00
|
|
|
let s:node_file = 'node ' . syntastic#util#shescape(expand('<sfile>:p:h', 1) . syntastic#util#Slash() . 'less-lint.js')
|
2012-08-31 11:48:17 -04:00
|
|
|
|
2013-10-28 11:30:25 -04:00
|
|
|
function! SyntaxCheckers_less_lessc_IsAvailable() dict
|
2014-10-06 15:15:44 -04:00
|
|
|
call self.log('g:syntastic_less_use_less_lint =', g:syntastic_less_use_less_lint)
|
2014-02-13 10:38:47 -05:00
|
|
|
return g:syntastic_less_use_less_lint ? executable('node') : executable(self.getExec())
|
2013-01-27 15:08:30 -05:00
|
|
|
endfunction
|
|
|
|
|
2013-10-28 07:53:33 -04:00
|
|
|
function! SyntaxCheckers_less_lessc_GetLocList() dict
|
2016-04-14 01:21:21 -04:00
|
|
|
call syntastic#log#deprecationWarn('less_options', 'less_lessc_args')
|
2014-02-13 10:38:47 -05:00
|
|
|
|
2013-11-01 05:51:47 -04:00
|
|
|
let makeprg = self.makeprgBuild({
|
2016-04-14 01:21:21 -04:00
|
|
|
\ 'exe': (g:syntastic_less_use_less_lint ? s:node_file : self.getExecEscaped()),
|
2014-01-28 14:44:44 -05:00
|
|
|
\ 'args_after': '--no-color',
|
2014-01-26 15:38:35 -05:00
|
|
|
\ 'tail': '> ' . syntastic#util#DevNull() })
|
2013-05-31 14:05:45 -04:00
|
|
|
|
2013-11-06 07:57:00 -05:00
|
|
|
let errorformat =
|
|
|
|
\ '%m in %f on line %l\, column %c:,' .
|
|
|
|
\ '%m in %f:%l:%c,' .
|
|
|
|
\ '%-G%.%#'
|
2012-01-19 07:59:40 -05:00
|
|
|
|
2013-05-31 14:05:45 -04:00
|
|
|
return SyntasticMake({
|
|
|
|
\ 'makeprg': makeprg,
|
|
|
|
\ 'errorformat': errorformat,
|
2014-09-04 05:56:09 -04:00
|
|
|
\ 'postprocess': ['guards'],
|
2015-03-25 12:44:34 -04:00
|
|
|
\ 'defaults': {'bufnr': bufnr(''), 'text': 'Syntax error'} })
|
2011-02-12 00:51:03 -05:00
|
|
|
endfunction
|
2011-03-16 06:45:55 -04:00
|
|
|
|
2013-01-27 15:08:30 -05:00
|
|
|
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
|
|
|
\ 'filetype': 'less',
|
|
|
|
\ 'name': 'lessc'})
|
2014-01-03 04:29:08 -05:00
|
|
|
|
|
|
|
let &cpo = s:save_cpo
|
|
|
|
unlet s:save_cpo
|
|
|
|
|
2015-01-04 05:46:54 -05:00
|
|
|
" vim: set sw=4 sts=4 et fdm=marker:
|