Updated plugins
This commit is contained in:
parent
fe46dfbbe6
commit
ccb7854aa2
103 changed files with 1729 additions and 445 deletions
|
@ -0,0 +1,37 @@
|
|||
" =============================================================================
|
||||
" Filename: autoload/lightline/colorscheme/darcula.vim
|
||||
" Author: kkopec
|
||||
" License: MIT License
|
||||
" Last Change: 2017/02/11 21:18:54.
|
||||
" =============================================================================
|
||||
|
||||
let s:black = [ '#2b2b2b', 235 ]
|
||||
let s:gray = [ '#323232', 236 ]
|
||||
let s:white = [ '#a9b7c6', 250 ]
|
||||
let s:blue = [ '#6897bb' , 67 ]
|
||||
let s:green = [ '#629755', 71 ]
|
||||
let s:purple = [ '#9876aa', 104 ]
|
||||
let s:red = [ '#ff6b68', 204 ]
|
||||
let s:yellow = [ '#ffc66d', 222 ]
|
||||
|
||||
let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
|
||||
let s:p.normal.left = [ [ s:black, s:purple ], [ s:purple, s:gray ] ]
|
||||
let s:p.normal.right = [ [ s:black, s:purple ], [ s:purple, s:gray ] ]
|
||||
let s:p.inactive.left = [ [ s:black, s:blue ], [ s:blue, s:gray ] ]
|
||||
let s:p.inactive.right = [ [ s:black, s:blue ], [ s:blue, s:gray ] ]
|
||||
let s:p.insert.left = [ [ s:black, s:green ], [ s:green, s:gray ] ]
|
||||
let s:p.insert.right = [ [ s:black, s:green ], [ s:green, s:gray ] ]
|
||||
let s:p.replace.left = [ [ s:black, s:red ], [ s:red, s:gray ] ]
|
||||
let s:p.replace.right = [ [ s:black, s:red ], [ s:red, s:gray ] ]
|
||||
let s:p.visual.left = [ [ s:black, s:yellow ], [ s:yellow, s:gray ] ]
|
||||
let s:p.visual.right = [ [ s:black, s:yellow ], [ s:yellow, s:gray ] ]
|
||||
let s:p.normal.middle = [ [ s:white, s:gray ] ]
|
||||
let s:p.inactive.middle = [ [ s:white, s:gray ] ]
|
||||
let s:p.tabline.left = [ [ s:blue, s:gray ] ]
|
||||
let s:p.tabline.tabsel = [ [ s:black, s:blue ] ]
|
||||
let s:p.tabline.middle = [ [ s:blue, s:gray ] ]
|
||||
let s:p.tabline.right = [ [ s:black, s:blue ] ]
|
||||
let s:p.normal.error = [ [ s:red, s:black ] ]
|
||||
let s:p.normal.warning = [ [ s:yellow, s:black ] ]
|
||||
|
||||
let g:lightline#colorscheme#darcula#palette = lightline#colorscheme#flatten(s:p)
|
|
@ -223,7 +223,8 @@ OPTIONS *lightline-option*
|
|||
The colorscheme for lightline.vim.
|
||||
Currently, wombat, solarized, powerline, jellybeans, Tomorrow,
|
||||
Tomorrow_Night, Tomorrow_Night_Blue, Tomorrow_Night_Eighties,
|
||||
PaperColor, seoul256, landscape, one, Dracula, Molokai and 16color are available.
|
||||
PaperColor, seoul256, landscape, one, Dracula, darcula,
|
||||
Molokai and 16color are available.
|
||||
The default value is:
|
||||
>
|
||||
let g:lightline.colorscheme = 'default'
|
||||
|
|
|
@ -20,108 +20,105 @@ endfunction
|
|||
"FUNCTION: s:UI._dumpHelp {{{1
|
||||
"prints out the quick help
|
||||
function! s:UI._dumpHelp()
|
||||
let old_h = @h
|
||||
if self.getShowHelp()
|
||||
let @h= "\" NERD tree (" . nerdtree#version() . ") quickhelp~\n"
|
||||
let @h=@h."\" ============================\n"
|
||||
let @h=@h."\" File node mappings~\n"
|
||||
let @h=@h."\" ". (g:NERDTreeMouseMode ==# 3 ? "single" : "double") ."-click,\n"
|
||||
let @h=@h."\" <CR>,\n"
|
||||
let help = "\" NERD tree (" . nerdtree#version() . ") quickhelp~\n"
|
||||
let help .= "\" ============================\n"
|
||||
let help .= "\" File node mappings~\n"
|
||||
let help .= "\" ". (g:NERDTreeMouseMode ==# 3 ? "single" : "double") ."-click,\n"
|
||||
let help .= "\" <CR>,\n"
|
||||
if self.nerdtree.isTabTree()
|
||||
let @h=@h."\" ". g:NERDTreeMapActivateNode .": open in prev window\n"
|
||||
let help .= "\" ". g:NERDTreeMapActivateNode .": open in prev window\n"
|
||||
else
|
||||
let @h=@h."\" ". g:NERDTreeMapActivateNode .": open in current window\n"
|
||||
let help .= "\" ". g:NERDTreeMapActivateNode .": open in current window\n"
|
||||
endif
|
||||
if self.nerdtree.isTabTree()
|
||||
let @h=@h."\" ". g:NERDTreeMapPreview .": preview\n"
|
||||
let help .= "\" ". g:NERDTreeMapPreview .": preview\n"
|
||||
endif
|
||||
let @h=@h."\" ". g:NERDTreeMapOpenInTab.": open in new tab\n"
|
||||
let @h=@h."\" ". g:NERDTreeMapOpenInTabSilent .": open in new tab silently\n"
|
||||
let @h=@h."\" middle-click,\n"
|
||||
let @h=@h."\" ". g:NERDTreeMapOpenSplit .": open split\n"
|
||||
let @h=@h."\" ". g:NERDTreeMapPreviewSplit .": preview split\n"
|
||||
let @h=@h."\" ". g:NERDTreeMapOpenVSplit .": open vsplit\n"
|
||||
let @h=@h."\" ". g:NERDTreeMapPreviewVSplit .": preview vsplit\n"
|
||||
let help .= "\" ". g:NERDTreeMapOpenInTab.": open in new tab\n"
|
||||
let help .= "\" ". g:NERDTreeMapOpenInTabSilent .": open in new tab silently\n"
|
||||
let help .= "\" middle-click,\n"
|
||||
let help .= "\" ". g:NERDTreeMapOpenSplit .": open split\n"
|
||||
let help .= "\" ". g:NERDTreeMapPreviewSplit .": preview split\n"
|
||||
let help .= "\" ". g:NERDTreeMapOpenVSplit .": open vsplit\n"
|
||||
let help .= "\" ". g:NERDTreeMapPreviewVSplit .": preview vsplit\n"
|
||||
|
||||
let @h=@h."\"\n\" ----------------------------\n"
|
||||
let @h=@h."\" Directory node mappings~\n"
|
||||
let @h=@h."\" ". (g:NERDTreeMouseMode ==# 1 ? "double" : "single") ."-click,\n"
|
||||
let @h=@h."\" ". g:NERDTreeMapActivateNode .": open & close node\n"
|
||||
let @h=@h."\" ". g:NERDTreeMapOpenRecursively .": recursively open node\n"
|
||||
let @h=@h."\" ". g:NERDTreeMapCloseDir .": close parent of node\n"
|
||||
let @h=@h."\" ". g:NERDTreeMapCloseChildren .": close all child nodes of\n"
|
||||
let @h=@h."\" current node recursively\n"
|
||||
let @h=@h."\" middle-click,\n"
|
||||
let @h=@h."\" ". g:NERDTreeMapOpenExpl.": explore selected dir\n"
|
||||
let help .= "\"\n\" ----------------------------\n"
|
||||
let help .= "\" Directory node mappings~\n"
|
||||
let help .= "\" ". (g:NERDTreeMouseMode ==# 1 ? "double" : "single") ."-click,\n"
|
||||
let help .= "\" ". g:NERDTreeMapActivateNode .": open & close node\n"
|
||||
let help .= "\" ". g:NERDTreeMapOpenRecursively .": recursively open node\n"
|
||||
let help .= "\" ". g:NERDTreeMapCloseDir .": close parent of node\n"
|
||||
let help .= "\" ". g:NERDTreeMapCloseChildren .": close all child nodes of\n"
|
||||
let help .= "\" current node recursively\n"
|
||||
let help .= "\" middle-click,\n"
|
||||
let help .= "\" ". g:NERDTreeMapOpenExpl.": explore selected dir\n"
|
||||
|
||||
let @h=@h."\"\n\" ----------------------------\n"
|
||||
let @h=@h."\" Bookmark table mappings~\n"
|
||||
let @h=@h."\" double-click,\n"
|
||||
let @h=@h."\" ". g:NERDTreeMapActivateNode .": open bookmark\n"
|
||||
let @h=@h."\" ". g:NERDTreeMapOpenInTab.": open in new tab\n"
|
||||
let @h=@h."\" ". g:NERDTreeMapOpenInTabSilent .": open in new tab silently\n"
|
||||
let @h=@h."\" ". g:NERDTreeMapDeleteBookmark .": delete bookmark\n"
|
||||
let help .= "\"\n\" ----------------------------\n"
|
||||
let help .= "\" Bookmark table mappings~\n"
|
||||
let help .= "\" double-click,\n"
|
||||
let help .= "\" ". g:NERDTreeMapActivateNode .": open bookmark\n"
|
||||
let help .= "\" ". g:NERDTreeMapOpenInTab.": open in new tab\n"
|
||||
let help .= "\" ". g:NERDTreeMapOpenInTabSilent .": open in new tab silently\n"
|
||||
let help .= "\" ". g:NERDTreeMapDeleteBookmark .": delete bookmark\n"
|
||||
|
||||
let @h=@h."\"\n\" ----------------------------\n"
|
||||
let @h=@h."\" Tree navigation mappings~\n"
|
||||
let @h=@h."\" ". g:NERDTreeMapJumpRoot .": go to root\n"
|
||||
let @h=@h."\" ". g:NERDTreeMapJumpParent .": go to parent\n"
|
||||
let @h=@h."\" ". g:NERDTreeMapJumpFirstChild .": go to first child\n"
|
||||
let @h=@h."\" ". g:NERDTreeMapJumpLastChild .": go to last child\n"
|
||||
let @h=@h."\" ". g:NERDTreeMapJumpNextSibling .": go to next sibling\n"
|
||||
let @h=@h."\" ". g:NERDTreeMapJumpPrevSibling .": go to prev sibling\n"
|
||||
let help .= "\"\n\" ----------------------------\n"
|
||||
let help .= "\" Tree navigation mappings~\n"
|
||||
let help .= "\" ". g:NERDTreeMapJumpRoot .": go to root\n"
|
||||
let help .= "\" ". g:NERDTreeMapJumpParent .": go to parent\n"
|
||||
let help .= "\" ". g:NERDTreeMapJumpFirstChild .": go to first child\n"
|
||||
let help .= "\" ". g:NERDTreeMapJumpLastChild .": go to last child\n"
|
||||
let help .= "\" ". g:NERDTreeMapJumpNextSibling .": go to next sibling\n"
|
||||
let help .= "\" ". g:NERDTreeMapJumpPrevSibling .": go to prev sibling\n"
|
||||
|
||||
let @h=@h."\"\n\" ----------------------------\n"
|
||||
let @h=@h."\" Filesystem mappings~\n"
|
||||
let @h=@h."\" ". g:NERDTreeMapChangeRoot .": change tree root to the\n"
|
||||
let @h=@h."\" selected dir\n"
|
||||
let @h=@h."\" ". g:NERDTreeMapUpdir .": move tree root up a dir\n"
|
||||
let @h=@h."\" ". g:NERDTreeMapUpdirKeepOpen .": move tree root up a dir\n"
|
||||
let @h=@h."\" but leave old root open\n"
|
||||
let @h=@h."\" ". g:NERDTreeMapRefresh .": refresh cursor dir\n"
|
||||
let @h=@h."\" ". g:NERDTreeMapRefreshRoot .": refresh current root\n"
|
||||
let @h=@h."\" ". g:NERDTreeMapMenu .": Show menu\n"
|
||||
let @h=@h."\" ". g:NERDTreeMapChdir .":change the CWD to the\n"
|
||||
let @h=@h."\" selected dir\n"
|
||||
let @h=@h."\" ". g:NERDTreeMapCWD .":change tree root to CWD\n"
|
||||
let help .= "\"\n\" ----------------------------\n"
|
||||
let help .= "\" Filesystem mappings~\n"
|
||||
let help .= "\" ". g:NERDTreeMapChangeRoot .": change tree root to the\n"
|
||||
let help .= "\" selected dir\n"
|
||||
let help .= "\" ". g:NERDTreeMapUpdir .": move tree root up a dir\n"
|
||||
let help .= "\" ". g:NERDTreeMapUpdirKeepOpen .": move tree root up a dir\n"
|
||||
let help .= "\" but leave old root open\n"
|
||||
let help .= "\" ". g:NERDTreeMapRefresh .": refresh cursor dir\n"
|
||||
let help .= "\" ". g:NERDTreeMapRefreshRoot .": refresh current root\n"
|
||||
let help .= "\" ". g:NERDTreeMapMenu .": Show menu\n"
|
||||
let help .= "\" ". g:NERDTreeMapChdir .":change the CWD to the\n"
|
||||
let help .= "\" selected dir\n"
|
||||
let help .= "\" ". g:NERDTreeMapCWD .":change tree root to CWD\n"
|
||||
|
||||
let @h=@h."\"\n\" ----------------------------\n"
|
||||
let @h=@h."\" Tree filtering mappings~\n"
|
||||
let @h=@h."\" ". g:NERDTreeMapToggleHidden .": hidden files (" . (self.getShowHidden() ? "on" : "off") . ")\n"
|
||||
let @h=@h."\" ". g:NERDTreeMapToggleFilters .": file filters (" . (self.isIgnoreFilterEnabled() ? "on" : "off") . ")\n"
|
||||
let @h=@h."\" ". g:NERDTreeMapToggleFiles .": files (" . (self.getShowFiles() ? "on" : "off") . ")\n"
|
||||
let @h=@h."\" ". g:NERDTreeMapToggleBookmarks .": bookmarks (" . (self.getShowBookmarks() ? "on" : "off") . ")\n"
|
||||
let help .= "\"\n\" ----------------------------\n"
|
||||
let help .= "\" Tree filtering mappings~\n"
|
||||
let help .= "\" ". g:NERDTreeMapToggleHidden .": hidden files (" . (self.getShowHidden() ? "on" : "off") . ")\n"
|
||||
let help .= "\" ". g:NERDTreeMapToggleFilters .": file filters (" . (self.isIgnoreFilterEnabled() ? "on" : "off") . ")\n"
|
||||
let help .= "\" ". g:NERDTreeMapToggleFiles .": files (" . (self.getShowFiles() ? "on" : "off") . ")\n"
|
||||
let help .= "\" ". g:NERDTreeMapToggleBookmarks .": bookmarks (" . (self.getShowBookmarks() ? "on" : "off") . ")\n"
|
||||
|
||||
"add quickhelp entries for each custom key map
|
||||
let @h=@h."\"\n\" ----------------------------\n"
|
||||
let @h=@h."\" Custom mappings~\n"
|
||||
let help .= "\"\n\" ----------------------------\n"
|
||||
let help .= "\" Custom mappings~\n"
|
||||
for i in g:NERDTreeKeyMap.All()
|
||||
if !empty(i.quickhelpText)
|
||||
let @h=@h."\" ". i.key .": ". i.quickhelpText ."\n"
|
||||
let help .= "\" ". i.key .": ". i.quickhelpText ."\n"
|
||||
endif
|
||||
endfor
|
||||
|
||||
let @h=@h."\"\n\" ----------------------------\n"
|
||||
let @h=@h."\" Other mappings~\n"
|
||||
let @h=@h."\" ". g:NERDTreeMapQuit .": Close the NERDTree window\n"
|
||||
let @h=@h."\" ". g:NERDTreeMapToggleZoom .": Zoom (maximize-minimize)\n"
|
||||
let @h=@h."\" the NERDTree window\n"
|
||||
let @h=@h."\" ". g:NERDTreeMapHelp .": toggle help\n"
|
||||
let @h=@h."\"\n\" ----------------------------\n"
|
||||
let @h=@h."\" Bookmark commands~\n"
|
||||
let @h=@h."\" :Bookmark [<name>]\n"
|
||||
let @h=@h."\" :BookmarkToRoot <name>\n"
|
||||
let @h=@h."\" :RevealBookmark <name>\n"
|
||||
let @h=@h."\" :OpenBookmark <name>\n"
|
||||
let @h=@h."\" :ClearBookmarks [<names>]\n"
|
||||
let @h=@h."\" :ClearAllBookmarks\n"
|
||||
silent! put h
|
||||
let help .= "\"\n\" ----------------------------\n"
|
||||
let help .= "\" Other mappings~\n"
|
||||
let help .= "\" ". g:NERDTreeMapQuit .": Close the NERDTree window\n"
|
||||
let help .= "\" ". g:NERDTreeMapToggleZoom .": Zoom (maximize-minimize)\n"
|
||||
let help .= "\" the NERDTree window\n"
|
||||
let help .= "\" ". g:NERDTreeMapHelp .": toggle help\n"
|
||||
let help .= "\"\n\" ----------------------------\n"
|
||||
let help .= "\" Bookmark commands~\n"
|
||||
let help .= "\" :Bookmark [<name>]\n"
|
||||
let help .= "\" :BookmarkToRoot <name>\n"
|
||||
let help .= "\" :RevealBookmark <name>\n"
|
||||
let help .= "\" :OpenBookmark <name>\n"
|
||||
let help .= "\" :ClearBookmarks [<names>]\n"
|
||||
let help .= "\" :ClearAllBookmarks\n"
|
||||
silent! put =help
|
||||
elseif !self.isMinimal()
|
||||
let @h="\" Press ". g:NERDTreeMapHelp ." for help\n"
|
||||
silent! put h
|
||||
let help ="\" Press ". g:NERDTreeMapHelp ." for help\n"
|
||||
silent! put =help
|
||||
endif
|
||||
|
||||
let @h = old_h
|
||||
endfunction
|
||||
|
||||
|
||||
|
@ -440,10 +437,7 @@ function! s:UI.render()
|
|||
call cursor(line(".")+1, col("."))
|
||||
|
||||
"draw the tree
|
||||
let old_o = @o
|
||||
let @o = self.nerdtree.root.renderToString()
|
||||
silent put o
|
||||
let @o = old_o
|
||||
silent put =self.nerdtree.root.renderToString()
|
||||
|
||||
"delete the blank line at the top of the buffer
|
||||
silent 1,1delete _
|
||||
|
|
|
@ -101,10 +101,10 @@ enabled.
|
|||
Syntastic itself has rather relaxed requirements: it doesn't have any external
|
||||
dependencies, and it needs a version of [Vim][vim] compiled with a few common
|
||||
features: `autocmd`, `eval`, `file_in_path`, `modify_fname`, `quickfix`,
|
||||
`reltime`, and `user_commands`. Not all possible combinations of features that
|
||||
include the ones above make equal sense on all operating systems, but Vim
|
||||
version 7 or later with the "normal", "big", or "huge" feature sets should be
|
||||
fine.
|
||||
`reltime`, `statusline`, and `user_commands`. Not all possible combinations of
|
||||
features that include the ones above make equal sense on all operating systems,
|
||||
but Vim version 7 or later with the "normal", "big", or "huge" feature sets
|
||||
should be fine.
|
||||
|
||||
Syntastic should work with any modern plugin managers for Vim, such as
|
||||
[NeoBundle][neobundle], [Pathogen][pathogen], [Vim-Addon-Manager][vam],
|
||||
|
|
|
@ -132,9 +132,9 @@ endfunction " }}}2
|
|||
" returns
|
||||
"
|
||||
" {'exe': '/usr/bin/perl', 'args': ['-f', '-bar']}
|
||||
function! syntastic#util#parseShebang() abort " {{{2
|
||||
function! syntastic#util#parseShebang(buf) abort " {{{2
|
||||
for lnum in range(1, 5)
|
||||
let line = getline(lnum)
|
||||
let line = get(getbufline(a:buf, lnum), 0, '')
|
||||
if line =~# '^#!'
|
||||
let line = substitute(line, '\v^#!\s*(\S+/env(\s+-\S+)*\s+)?', '', '')
|
||||
let exe = matchstr(line, '\m^\S*\ze')
|
||||
|
|
|
@ -164,7 +164,7 @@ When syntax errors are detected a flag will be shown. The content of the flag
|
|||
is derived from the |'syntastic_stl_format'| option.
|
||||
|
||||
Please note that these settings might conflict with other Vim plugins that
|
||||
change the way statusline works. Refer to the |syntastic-compatibility| notes
|
||||
change the way 'statusline' works. Refer to the |syntastic-compatibility| notes
|
||||
below and to the respective plugins' documentation for possible solutions.
|
||||
|
||||
In particular see |syntastic-airline| below if you're using the "airline" Vim
|
||||
|
|
|
@ -19,7 +19,7 @@ if has('reltime')
|
|||
lockvar! g:_SYNTASTIC_START
|
||||
endif
|
||||
|
||||
let g:_SYNTASTIC_VERSION = '3.8.0-21'
|
||||
let g:_SYNTASTIC_VERSION = '3.8.0-26'
|
||||
lockvar g:_SYNTASTIC_VERSION
|
||||
|
||||
" Sanity checks {{{1
|
||||
|
@ -36,7 +36,8 @@ for s:feature in [
|
|||
\ 'modify_fname',
|
||||
\ 'quickfix',
|
||||
\ 'reltime',
|
||||
\ 'user_commands'
|
||||
\ 'statusline',
|
||||
\ 'user_commands',
|
||||
\ ]
|
||||
if !has(s:feature)
|
||||
call syntastic#log#error('need Vim compiled with feature ' . s:feature)
|
||||
|
|
|
@ -34,19 +34,20 @@ function! SyntaxCheckers_asm_gcc_IsAvailable() dict " {{{1
|
|||
endfunction " }}}1
|
||||
|
||||
function! SyntaxCheckers_asm_gcc_GetLocList() dict " {{{1
|
||||
let buf = bufnr('')
|
||||
return syntastic#c#GetLocList('asm', 'gcc', {
|
||||
\ 'errorformat':
|
||||
\ '%-G%f:%s:,' .
|
||||
\ '%f:%l:%c: %trror: %m,' .
|
||||
\ '%f:%l:%c: %tarning: %m,' .
|
||||
\ '%f:%l: %m',
|
||||
\ 'main_flags': '-x assembler -fsyntax-only' . (g:syntastic_asm_generic ? '' : ' -masm=' . s:GetDialect()) })
|
||||
\ 'main_flags': '-x assembler -fsyntax-only' . (g:syntastic_asm_generic ? '' : ' -masm=' . s:GetDialect(buf)) })
|
||||
endfunction " }}}1
|
||||
|
||||
" Utilities {{{1
|
||||
|
||||
function! s:GetDialect() " {{{2
|
||||
return syntastic#util#var('asm_dialect', expand('%:e', 1) ==? 'asm' ? 'intel' : 'att')
|
||||
function! s:GetDialect(buf) " {{{2
|
||||
return syntastic#util#bufVar(a:buf, 'asm_dialect', fnamemodify(bufname(a:buf), ':e') ==? 'asm' ? 'intel' : 'att')
|
||||
endfunction " }}}2
|
||||
|
||||
" }}}1
|
||||
|
|
|
@ -23,7 +23,8 @@ if !exists('g:syntastic_pc_lint_config_file')
|
|||
endif
|
||||
|
||||
function! SyntaxCheckers_c_pc_lint_GetLocList() dict
|
||||
let config = syntastic#util#findFileInParent(g:syntastic_pc_lint_config_file, expand('%:p:h', 1))
|
||||
let buf = bufnr('')
|
||||
let config = syntastic#util#findFileInParent(g:syntastic_pc_lint_config_file, fnamemodify(bufname(buf), ':p:h'))
|
||||
call self.log('config =', config)
|
||||
|
||||
" -hFs1 - show filename, add space after messages, try to make message 1 line
|
||||
|
|
|
@ -31,6 +31,7 @@ function! SyntaxCheckers_cabal_cabal_GetHighlightRegex(item)
|
|||
endfunction
|
||||
|
||||
function! SyntaxCheckers_cabal_cabal_GetLocList() dict
|
||||
let buf = bufnr('')
|
||||
let makeprg = self.getExecEscaped() . ' check'
|
||||
|
||||
let errorformat =
|
||||
|
@ -40,9 +41,9 @@ function! SyntaxCheckers_cabal_cabal_GetLocList() dict
|
|||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'cwd': expand('%:p:h', 1),
|
||||
\ 'cwd': fnamemodify(bufname(buf), ':p:h'),
|
||||
\ 'preprocess': 'cabal',
|
||||
\ 'defaults': {'bufnr': bufnr('')} })
|
||||
\ 'defaults': {'bufnr': buf} })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
|
|
|
@ -18,7 +18,8 @@ let s:save_cpo = &cpo
|
|||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_cuda_nvcc_GetLocList() dict
|
||||
let arch_flag = syntastic#util#var('cuda_arch')
|
||||
let buf = bufnr('')
|
||||
let arch_flag = syntastic#util#bufVar(buf, 'cuda_arch')
|
||||
if arch_flag !=# ''
|
||||
let arch_flag = '-arch=' . arch_flag
|
||||
call syntastic#log#oneTimeWarn('variable g:syntastic_cuda_arch is deprecated, ' .
|
||||
|
@ -27,9 +28,9 @@ function! SyntaxCheckers_cuda_nvcc_GetLocList() dict
|
|||
|
||||
let build_opts = {}
|
||||
let dummy = ''
|
||||
if index(['h', 'hpp', 'cuh'], expand('%:e', 1), 0, 1) >= 0
|
||||
if syntastic#util#var('cuda_check_header', 0)
|
||||
let dummy = expand('%:p:h', 1) . syntastic#util#Slash() . '.syntastic_dummy.cu'
|
||||
if index(['h', 'hpp', 'cuh'], fnamemodify(bufname(buf), ':e'), 0, 1) >= 0
|
||||
if syntastic#util#bufVar(buf, 'cuda_check_header', 0)
|
||||
let dummy = fnamemodify(bufname(buf), ':p:h') . syntastic#util#Slash() . '.syntastic_dummy.cu'
|
||||
let build_opts = {
|
||||
\ 'exe_before': 'echo > ' . syntastic#util#shescape(dummy) . ' ;',
|
||||
\ 'fname_before': '.syntastic_dummy.cu -include' }
|
||||
|
@ -62,7 +63,18 @@ function! SyntaxCheckers_cuda_nvcc_GetLocList() dict
|
|||
\ '%DMaking %*\a in %f,'.
|
||||
\ '%f|%l| %m'
|
||||
|
||||
let loclist = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
|
||||
let loclist = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'defaults': {'type': 'E'} })
|
||||
|
||||
for e in loclist
|
||||
let pat = matchstr(e['text'], '\m\c^\s*warning:\s*\zs.*')
|
||||
if pat !=# ''
|
||||
let e['text'] = pat
|
||||
let e['type'] = 'W'
|
||||
endif
|
||||
endfor
|
||||
|
||||
if dummy !=# ''
|
||||
call delete(dummy)
|
||||
|
|
|
@ -44,8 +44,9 @@ function! SyntaxCheckers_d_dmd_IsAvailable() dict " {{{1
|
|||
endfunction " }}}1
|
||||
|
||||
function! SyntaxCheckers_d_dmd_GetLocList() dict " {{{1
|
||||
let buf = bufnr('')
|
||||
if !exists('g:syntastic_d_include_dirs')
|
||||
let g:syntastic_d_include_dirs = s:GetIncludes(self, expand('%:p:h'))
|
||||
let g:syntastic_d_include_dirs = s:GetIncludes(self, fnamemodify(bufname(buf), ':p:h'))
|
||||
endif
|
||||
|
||||
return syntastic#c#GetLocList('d', 'dmd', {
|
||||
|
|
|
@ -27,9 +27,10 @@ function! SyntaxCheckers_elixir_elixir_IsAvailable() dict
|
|||
endfunction
|
||||
|
||||
function! SyntaxCheckers_elixir_elixir_GetLocList() dict
|
||||
let buf = bufnr('')
|
||||
let make_options = {}
|
||||
let compile_command = 'elixir'
|
||||
let mix_file = syntastic#util#findFileInParent('mix.exs', expand('%:p:h', 1))
|
||||
let mix_file = syntastic#util#findFileInParent('mix.exs', fnamemodify(bufname(buf), ':p:h'))
|
||||
|
||||
if filereadable(mix_file)
|
||||
let compile_command = 'mix compile'
|
||||
|
|
|
@ -25,11 +25,13 @@ let s:save_cpo = &cpo
|
|||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_erlang_escript_GetLocList() dict
|
||||
if expand('%:e', 1) ==# 'hrl'
|
||||
let buf = bufnr('')
|
||||
|
||||
if fnamemodify(bufname(buf), ':e') ==# 'hrl'
|
||||
return []
|
||||
endif
|
||||
|
||||
let shebang = syntastic#util#parseShebang()
|
||||
let shebang = syntastic#util#parseShebang(buf)
|
||||
if shebang['exe'] ==# 'escript'
|
||||
let args = '-s'
|
||||
let post_args = ''
|
||||
|
@ -39,7 +41,7 @@ function! SyntaxCheckers_erlang_escript_GetLocList() dict
|
|||
endif
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'args_after': args,
|
||||
\ 'fname': syntastic#util#shexpand('%:p'),
|
||||
\ 'fname': syntastic#util#shexpand(fnamemodify(bufname(buf), ':p')),
|
||||
\ 'post_args_after': post_args })
|
||||
|
||||
let errorformat =
|
||||
|
|
|
@ -31,7 +31,8 @@ function! SyntaxCheckers_eruby_ruby_GetLocList() dict
|
|||
let s:ruby_new = syntastic#util#versionIsAtLeast(self.getVersion(), [1, 9])
|
||||
endif
|
||||
|
||||
let fname = "'" . escape(expand('%', 1), "\\'") . "'"
|
||||
let buf = bufnr('')
|
||||
let fname = "'" . escape(bufname(buf), "\\'") . "'"
|
||||
|
||||
" TODO: encodings became useful in ruby 1.9 :)
|
||||
if s:ruby_new
|
||||
|
@ -69,7 +70,7 @@ function! SyntaxCheckers_eruby_ruby_GetLocList() dict
|
|||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'env': env,
|
||||
\ 'defaults': { 'bufnr': bufnr(''), 'vcol': 1 } })
|
||||
\ 'defaults': { 'bufnr': buf, 'vcol': 1 } })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
|
|
|
@ -28,8 +28,9 @@ let s:save_cpo = &cpo
|
|||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_glsl_cgc_GetLocList() dict " {{{1
|
||||
let buf = bufnr('')
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'args_before': '-oglsl -profile ' . s:GetProfile(),
|
||||
\ 'args_before': '-oglsl -profile ' . s:GetProfile(buf),
|
||||
\ 'args': (exists('g:syntastic_glsl_options') ? ' ' . g:syntastic_glsl_options : '') })
|
||||
|
||||
let errorformat =
|
||||
|
@ -43,27 +44,11 @@ endfunction " }}}1
|
|||
|
||||
" Utilities {{{1
|
||||
|
||||
function! s:GetProfile() " {{{2
|
||||
let save_view = winsaveview()
|
||||
let old_foldenable = &foldenable
|
||||
let old_lazyredraw = &lazyredraw
|
||||
|
||||
let &lazyredraw = 1
|
||||
let &foldenable = 0
|
||||
call cursor(1, 1)
|
||||
|
||||
let magic = '\m\C^// profile:\s*'
|
||||
let line = search(magic, 'c')
|
||||
|
||||
call winrestview(save_view)
|
||||
let &foldenable = old_foldenable
|
||||
let &lazyredraw = old_lazyredraw
|
||||
|
||||
if line
|
||||
let profile = matchstr(getline(line), magic . '\zs.*')
|
||||
else
|
||||
let extensions = exists('g:syntastic_glsl_extensions') ? g:syntastic_glsl_extensions : s:glsl_extensions
|
||||
let profile = get(extensions, tolower(expand('%:e', 1)), 'gpu_vert')
|
||||
function! s:GetProfile(buf) " {{{2
|
||||
let profile = matchstr(get(filter(getbufline(a:buf, 1, 100), 'v:val =~# "\\m\\C^//\\s*profile:"'), 0, ''), '\m\C^//\s*profile:\s*\zs.*')
|
||||
if profile ==# ''
|
||||
let extensions = syntastic#util#bufVar(a:buf, 'glsl_extensions', s:glsl_extensions)
|
||||
let profile = get(extensions, tolower(fnamemodify(bufname(a:buf), ':e')), 'gpu_vert')
|
||||
endif
|
||||
|
||||
return profile
|
||||
|
|
|
@ -30,6 +30,7 @@ function! SyntaxCheckers_go_go_GetLocList() dict
|
|||
if !exists('s:go_new')
|
||||
let s:go_new = syntastic#util#versionIsAtLeast(self.getVersion(self.getExecEscaped() . ' version'), [1, 5])
|
||||
endif
|
||||
let buf = bufnr('')
|
||||
|
||||
" Check with gofmt first, since `go build` and `go test` might not report
|
||||
" syntax errors in the current file if another file with syntax error is
|
||||
|
@ -53,14 +54,14 @@ function! SyntaxCheckers_go_go_GetLocList() dict
|
|||
|
||||
" Test files, i.e. files with a name ending in `_test.go`, are not
|
||||
" compiled by `go build`, therefore `go test` must be called for those.
|
||||
if match(expand('%', 1), '\m_test\.go$') == -1
|
||||
let cmd = 'build'
|
||||
let opts = syntastic#util#var('go_go_build_args', s:go_new ? '-buildmode=archive' : '')
|
||||
let cleanup = 0
|
||||
else
|
||||
if bufname(buf) =~# '\m_test\.go$'
|
||||
let cmd = 'test -c'
|
||||
let opts = syntastic#util#var('go_go_test_args', s:go_new ? '-buildmode=archive' : '')
|
||||
let opts = syntastic#util#bufVar(buf, 'go_go_test_args', s:go_new ? '-buildmode=archive' : '')
|
||||
let cleanup = 1
|
||||
else
|
||||
let cmd = 'build'
|
||||
let opts = syntastic#util#bufVar(buf, 'go_go_build_args', s:go_new ? '-buildmode=archive' : '')
|
||||
let cleanup = 0
|
||||
endif
|
||||
let opt_str = (type(opts) != type('') || opts !=# '') ? join(syntastic#util#argsescape(opts)) : opts
|
||||
let makeprg = self.getExecEscaped() . ' ' . cmd . ' ' . opt_str
|
||||
|
@ -82,12 +83,12 @@ function! SyntaxCheckers_go_go_GetLocList() dict
|
|||
let errors = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'cwd': expand('%:p:h', 1),
|
||||
\ 'cwd': fnamemodify(bufname(buf), ':p:h'),
|
||||
\ 'env': {'GOGC': 'off'},
|
||||
\ 'defaults': {'type': 'e'} })
|
||||
|
||||
if cleanup
|
||||
call delete(expand('%:p:h', 1) . syntastic#util#Slash() . expand('%:p:h:t', 1) . '.test')
|
||||
call delete(fnamemodify(bufname(buf), ':p:h') . syntastic#util#Slash() . fnamemodify(bufname(buf), ':p:h') . '.test')
|
||||
endif
|
||||
|
||||
return errors
|
||||
|
|
|
@ -19,9 +19,10 @@ let s:save_cpo = &cpo
|
|||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_go_gometalinter_GetLocList() dict
|
||||
let buf = bufnr('')
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'args': '-t',
|
||||
\ 'fname': syntastic#util#shexpand('%:p:h') })
|
||||
\ 'fname': syntastic#util#shescape(fnamemodify(bufname(buf), ':p:h')) })
|
||||
|
||||
let errorformat =
|
||||
\ '%f:%l:%c:%trror: %m,' .
|
||||
|
|
|
@ -19,8 +19,9 @@ let s:save_cpo = &cpo
|
|||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_go_gotype_GetLocList() dict
|
||||
let buf = bufnr('')
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'args': (expand('%', 1) =~# '\m_test\.go$' ? '-a' : ''),
|
||||
\ 'args': (bufname(buf) =~# '\m_test\.go$' ? '-a' : ''),
|
||||
\ 'fname': '.' })
|
||||
|
||||
let errorformat =
|
||||
|
@ -34,7 +35,7 @@ function! SyntaxCheckers_go_gotype_GetLocList() dict
|
|||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'cwd': expand('%:p:h', 1),
|
||||
\ 'cwd': fnamemodify(bufname(buf), ':p:h'),
|
||||
\ 'defaults': {'type': 'e'} })
|
||||
endfunction
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@ let s:save_cpo = &cpo
|
|||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_go_govet_GetLocList() dict
|
||||
let buf = bufnr('')
|
||||
let makeprg = self.getExecEscaped() . ' vet'
|
||||
|
||||
let errorformat =
|
||||
|
@ -33,7 +34,7 @@ function! SyntaxCheckers_go_govet_GetLocList() dict
|
|||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'cwd': expand('%:p:h', 1),
|
||||
\ 'cwd': fnamemodify(bufname(buf), ':p:h'),
|
||||
\ 'defaults': {'type': 'w'} })
|
||||
endfunction
|
||||
|
||||
|
|
|
@ -25,9 +25,10 @@ function! SyntaxCheckers_haskell_hdevtools_GetLocList() dict
|
|||
let g:syntastic_haskell_hdevtools_args = g:hdevtools_options
|
||||
endif
|
||||
|
||||
let buf = bufnr('')
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'exe_after': 'check',
|
||||
\ 'fname': syntastic#util#shexpand('%:p') })
|
||||
\ 'fname': syntastic#util#shescape(fnamemodify(bufname(buf), ':p')) })
|
||||
|
||||
let errorformat =
|
||||
\ '%-Z %#,'.
|
||||
|
|
|
@ -14,8 +14,9 @@ let s:save_cpo = &cpo
|
|||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_haskell_hlint_GetLocList() dict
|
||||
let buf = bufnr('')
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'fname': syntastic#util#shexpand('%:p')})
|
||||
\ 'fname': syntastic#util#shescape(fnamemodify(bufname(buf), ':p')) })
|
||||
|
||||
let errorformat =
|
||||
\ '%E%f:%l:%v: Error while reading hint file\, %m,' .
|
||||
|
|
|
@ -19,12 +19,10 @@ let s:save_cpo = &cpo
|
|||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_haxe_haxe_GetLocList() dict
|
||||
if exists('b:vaxe_hxml')
|
||||
let hxml = b:vaxe_hxml
|
||||
elseif exists('g:vaxe_hxml')
|
||||
let hxml = g:vaxe_hxml
|
||||
else
|
||||
let hxml = syntastic#util#findGlobInParent('*.hxml', expand('%:p:h', 1))
|
||||
let buf = bufnr('')
|
||||
let hxml = syntastic#util#bufRawVar(buf, 'vaxe_hxml')
|
||||
if hxml ==# ''
|
||||
let hxml = syntastic#util#findGlobInParent('*.hxml', fnamemodify(bufname(buf), ':p:h'))
|
||||
endif
|
||||
let hxml = fnamemodify(hxml, ':p')
|
||||
|
||||
|
|
|
@ -31,7 +31,8 @@ let s:save_cpo = &cpo
|
|||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_html_validator_GetLocList() dict
|
||||
let fname = syntastic#util#shexpand('%')
|
||||
let buf = bufnr('')
|
||||
let fname = syntastic#util#shescape(fnamemodify(bufname(buf), ':p'))
|
||||
let makeprg = self.getExecEscaped() . ' -q -L -s --compressed -F out=gnu -F asciiquotes=yes' .
|
||||
\ (g:syntastic_html_validator_parser !=# '' ? ' -F parser=' . g:syntastic_html_validator_parser : '') .
|
||||
\ (g:syntastic_html_validator_nsfilter !=# '' ? ' -F nsfilter=' . g:syntastic_html_validator_nsfilter : '') .
|
||||
|
|
|
@ -23,8 +23,9 @@ let s:save_cpo = &cpo
|
|||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_html_w3_GetLocList() dict
|
||||
let buf = bufnr('')
|
||||
let makeprg = self.getExecEscaped() . ' -q -L -s -F output=json ' .
|
||||
\ '-F uploaded_file=@' . syntastic#util#shexpand('%:p') . '\;type=text/html ' .
|
||||
\ '-F uploaded_file=@' . syntastic#util#shescape(fnamemodify(bufname(buf), ':p')) . '\;type=text/html ' .
|
||||
\ g:syntastic_html_w3_api
|
||||
|
||||
let errorformat =
|
||||
|
|
|
@ -40,6 +40,8 @@ endfunction
|
|||
|
||||
function! SyntaxCheckers_java_checkstyle_GetLocList() dict
|
||||
|
||||
let buf = bufnr('')
|
||||
|
||||
" classpath
|
||||
if !exists('s:sep')
|
||||
let s:sep = syntastic#util#isRunningWindows() || has('win32unix') ? ';' : ':'
|
||||
|
@ -58,7 +60,7 @@ function! SyntaxCheckers_java_checkstyle_GetLocList() dict
|
|||
\ '-f', 'xml' ])
|
||||
|
||||
" filename
|
||||
let fname = syntastic#util#shescape( expand('%:p:h', 1) . syntastic#util#Slash() . expand('%:t', 1) )
|
||||
let fname = syntastic#util#shescape( fnamemodify(bufname(buf), ':p:h') . syntastic#util#Slash() . fnamemodify(bufname(buf), ':t') )
|
||||
if has('win32unix')
|
||||
let fname = substitute(syntastic#util#system('cygpath -m ' . fname), '\m\%x00', '', 'g')
|
||||
endif
|
||||
|
|
|
@ -223,7 +223,7 @@ endfunction " }}}2
|
|||
function! s:SaveClasspath() " {{{2
|
||||
" build classpath from lines
|
||||
let path = ''
|
||||
let lines = getline(1, line('$'))
|
||||
let lines = getline(1, '$')
|
||||
for l in lines
|
||||
let path = s:AddToClasspath(path, l)
|
||||
endfor
|
||||
|
@ -281,7 +281,7 @@ endfunction " }}}2
|
|||
|
||||
function! s:SaveConfig() " {{{2
|
||||
" get lines
|
||||
let lines = getline(1, line('$'))
|
||||
let lines = getline(1, '$')
|
||||
if g:syntastic_java_javac_config_file_enabled
|
||||
" save config file lines
|
||||
call writefile(lines, expand(g:syntastic_java_javac_config_file, 1))
|
||||
|
|
|
@ -42,11 +42,12 @@ function! SyntaxCheckers_javascript_closurecompiler_GetLocList() dict
|
|||
call syntastic#log#deprecationWarn('javascript_closure_compiler_options', 'javascript_closurecompiler_args')
|
||||
call syntastic#log#deprecationWarn('javascript_closure_compiler_file_list', 'javascript_closurecompiler_file_list')
|
||||
|
||||
let flist = expand(get(g:, 'syntastic_javascript_closurecompiler_file_list', ''), 1)
|
||||
let buf = bufnr('')
|
||||
let flist = expand(syntastic#util#bufVar(buf, 'javascript_closurecompiler_file_list'), 1)
|
||||
if filereadable(flist)
|
||||
let file_list = map( readfile(flist), 'expand(v:var, 1)' )
|
||||
else
|
||||
let file_list = [expand('%', 1)]
|
||||
let file_list = [bufname(buf)]
|
||||
endif
|
||||
|
||||
let makeprg = self.makeprgBuild({
|
||||
|
|
|
@ -29,7 +29,8 @@ function! SyntaxCheckers_javascript_flow_IsAvailable() dict
|
|||
endfunction
|
||||
|
||||
function! SyntaxCheckers_javascript_flow_GetLocList() dict
|
||||
if syntastic#util#findFileInParent('.flowconfig', expand('%:p:h', 1)) ==# ''
|
||||
let buf = bufnr('')
|
||||
if syntastic#util#findFileInParent('.flowconfig', fnamemodify(bufname(buf), ':p:h')) ==# ''
|
||||
return []
|
||||
endif
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@ let s:save_cpo = &cpo
|
|||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_limbo_limbo_GetLocList() dict
|
||||
let buf = bufnr('')
|
||||
let include = $INFERNO_HOME !=# '' ? '-I$INFERNO_HOME ' : ''
|
||||
" don't generate .dis in current dir while checking syntax,
|
||||
" .dis should be generated by `mk`
|
||||
|
@ -27,7 +28,7 @@ function! SyntaxCheckers_limbo_limbo_GetLocList() dict
|
|||
let makeprg = self.makeprgBuild({ 'args_before': include . '-w' . output })
|
||||
|
||||
let errorformat = '%E%f:%l:%m'
|
||||
if expand('%', 1) =~# '\m\.m$'
|
||||
if bufname(buf) =~# '\m\.m$'
|
||||
let errorformat = '%-G%f:%l: near ` EOF ` : no implementation module,' . errorformat
|
||||
endif
|
||||
|
||||
|
|
|
@ -19,9 +19,10 @@ let s:save_cpo = &cpo
|
|||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_nasm_nasm_GetLocList() dict
|
||||
let buf = bufnr('')
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'args_after': '-X gnu' .
|
||||
\ ' -I ' . syntastic#util#shescape(expand('%:p:h', 1) . syntastic#util#Slash()) .
|
||||
\ ' -I ' . syntastic#util#shescape(fnamemodify(bufname(buf), ':p:h') . syntastic#util#Slash()) .
|
||||
\ ' ' . syntastic#c#NullOutput() })
|
||||
|
||||
let errorformat = '%f:%l: %t%*[^:]: %m'
|
||||
|
|
|
@ -44,7 +44,8 @@ function! SyntaxCheckers_ocaml_camlp4o_IsAvailable() dict " {{{1
|
|||
endfunction " }}}1
|
||||
|
||||
function! SyntaxCheckers_ocaml_camlp4o_GetLocList() dict " {{{1
|
||||
let makeprg = s:GetMakeprg()
|
||||
let buf = bufnr('')
|
||||
let makeprg = s:GetMakeprg(buf)
|
||||
if makeprg ==# ''
|
||||
return []
|
||||
endif
|
||||
|
@ -65,7 +66,7 @@ function! SyntaxCheckers_ocaml_camlp4o_GetLocList() dict " {{{1
|
|||
let loclist = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'defaults': {'bufnr': bufnr('')} })
|
||||
\ 'defaults': {'bufnr': buf} })
|
||||
|
||||
for e in loclist
|
||||
if get(e, 'col', 0) && get(e, 'nr', 0)
|
||||
|
@ -79,40 +80,41 @@ endfunction " }}}1
|
|||
|
||||
" Utilities {{{1
|
||||
|
||||
function! s:GetMakeprg() " {{{2
|
||||
function! s:GetMakeprg(buf) " {{{2
|
||||
return
|
||||
\ g:syntastic_ocaml_use_ocamlc ? g:syntastic_ocaml_use_ocamlc :
|
||||
\ (g:syntastic_ocaml_use_ocamlbuild && isdirectory('_build')) ? s:GetOcamlcMakeprg() :
|
||||
\ s:GetOtherMakeprg()
|
||||
\ (g:syntastic_ocaml_use_ocamlbuild && isdirectory('_build')) ? s:GetOcamlcMakeprg(a:buf) :
|
||||
\ s:GetOtherMakeprg(a:buf)
|
||||
endfunction " }}}2
|
||||
|
||||
function! s:GetOcamlcMakeprg() " {{{2
|
||||
function! s:GetOcamlcMakeprg(buf) " {{{2
|
||||
let build_cmd = g:syntastic_ocaml_use_janestreet_core ?
|
||||
\ 'ocamlc -I ' . syntastic#util#shexpand(g:syntastic_ocaml_janestreet_core_dir) : 'ocamlc'
|
||||
let build_cmd .= ' -c ' . syntastic#util#shexpand('%')
|
||||
let build_cmd .= ' -c ' . syntastic#util#shescape(bufname(a:buf))
|
||||
return build_cmd
|
||||
endfunction " }}}2
|
||||
|
||||
function! s:GetOcamlBuildMakeprg() " {{{2
|
||||
function! s:GetOcamlBuildMakeprg(buf) " {{{2
|
||||
return 'ocamlbuild -quiet -no-log -tag annot,' . s:ocamlpp . ' -no-links -no-hygiene -no-sanitize ' .
|
||||
\ syntastic#util#shexpand('%:r') . '.cmi'
|
||||
\ syntastic#util#shexpand(fnamemodify(bufname(a:buf), ':r')) . '.cmi'
|
||||
endfunction " }}}2
|
||||
|
||||
function! s:GetOtherMakeprg() " {{{2
|
||||
function! s:GetOtherMakeprg(buf) " {{{2
|
||||
"TODO: give this function a better name?
|
||||
"
|
||||
"TODO: should use throw/catch instead of returning an empty makeprg
|
||||
|
||||
let extension = expand('%:e', 1)
|
||||
let fname = bufname(a:buf)
|
||||
let extension = fnamemodify(fname, ':e')
|
||||
let makeprg = ''
|
||||
|
||||
if stridx(extension, 'mly') >= 0 && executable('menhir')
|
||||
" ocamlyacc output can't be redirected, so use menhir
|
||||
let makeprg = 'menhir --only-preprocess ' . syntastic#util#shexpand('%') . ' >' . syntastic#util#DevNull()
|
||||
let makeprg = 'menhir --only-preprocess ' . syntastic#util#shescape(fname) . ' >' . syntastic#util#DevNull()
|
||||
elseif stridx(extension,'mll') >= 0 && executable('ocamllex')
|
||||
let makeprg = 'ocamllex -q ' . syntastic#c#NullOutput() . ' ' . syntastic#util#shexpand('%')
|
||||
let makeprg = 'ocamllex -q ' . syntastic#c#NullOutput() . ' ' . syntastic#util#shescape(fname)
|
||||
else
|
||||
let makeprg = 'camlp4o ' . syntastic#c#NullOutput() . ' ' . syntastic#util#shexpand('%')
|
||||
let makeprg = 'camlp4o ' . syntastic#c#NullOutput() . ' ' . syntastic#util#shescape(fname)
|
||||
endif
|
||||
|
||||
return makeprg
|
||||
|
|
|
@ -51,13 +51,14 @@ function! SyntaxCheckers_perl_perl_IsAvailable() dict " {{{1
|
|||
endfunction " }}}1
|
||||
|
||||
function! SyntaxCheckers_perl_perl_GetLocList() dict " {{{1
|
||||
let buf = bufnr('')
|
||||
if type(g:syntastic_perl_lib_path) == type('')
|
||||
call syntastic#log#oneTimeWarn('variable g:syntastic_perl_lib_path should be a list')
|
||||
let includes = split(g:syntastic_perl_lib_path, ',')
|
||||
else
|
||||
let includes = copy(syntastic#util#var('perl_lib_path', []))
|
||||
let includes = copy(syntastic#util#bufVar(buf, 'perl_lib_path', []))
|
||||
endif
|
||||
let shebang = syntastic#util#parseShebang()
|
||||
let shebang = syntastic#util#parseShebang(buf)
|
||||
let extra = map(includes, '"-I" . v:val') +
|
||||
\ (index(shebang['args'], '-T') >= 0 ? ['-T'] : []) +
|
||||
\ (index(shebang['args'], '-t') >= 0 ? ['-t'] : [])
|
||||
|
|
|
@ -43,11 +43,13 @@ function! SyntaxCheckers_r_lint_IsAvailable() dict
|
|||
endfunction
|
||||
|
||||
function! SyntaxCheckers_r_lint_GetLocList() dict
|
||||
let buf = bufnr('')
|
||||
|
||||
let setwd = syntastic#util#isRunningWindows() ? 'setwd("' . escape(getcwd(), '"\') . '"); ' : ''
|
||||
let makeprg = self.getExecEscaped() . ' --slave --restore --no-save' .
|
||||
\ ' -e ' . syntastic#util#shescape(setwd . 'library(lint); ' .
|
||||
\ 'try(lint(commandArgs(TRUE), ' . g:syntastic_r_lint_styles . '))') .
|
||||
\ ' --args ' . syntastic#util#shexpand('%')
|
||||
\ ' --args ' . syntastic#util#shescape(bufname(buf))
|
||||
|
||||
let errorformat =
|
||||
\ '%t:%f:%l:%v: %m,' .
|
||||
|
|
|
@ -38,7 +38,7 @@ set cpo&vim
|
|||
|
||||
function! SyntaxCheckers_r_lintr_GetHighlightRegex(item)
|
||||
let term = matchstr(a:item['text'], "\\m'\\zs[^']\\+\\ze'")
|
||||
return term != '' ? '\V' . escape(term, '\') : ''
|
||||
return term !=# '' ? '\V' . escape(term, '\') : ''
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_r_lintr_IsAvailable() dict
|
||||
|
@ -50,11 +50,13 @@ function! SyntaxCheckers_r_lintr_IsAvailable() dict
|
|||
endfunction
|
||||
|
||||
function! SyntaxCheckers_r_lintr_GetLocList() dict
|
||||
let buf = bufnr('')
|
||||
|
||||
let setwd = syntastic#util#isRunningWindows() ? 'setwd("' . escape(getcwd(), '"\') . '"); ' : ''
|
||||
let makeprg = self.getExecEscaped() . ' --slave --no-restore --no-save' .
|
||||
\ ' -e ' . syntastic#util#shescape(setwd . 'suppressPackageStartupMessages(library(lintr)); ' .
|
||||
\ 'lint(cache = ' . g:syntastic_r_lintr_cache . ', commandArgs(TRUE), ' . g:syntastic_r_lintr_linters . ')') .
|
||||
\ ' --args ' . syntastic#util#shexpand('%')
|
||||
\ ' --args ' . syntastic#util#shescape(bufname(buf))
|
||||
|
||||
let errorformat =
|
||||
\ '%W%f:%l:%c: style: %m,' .
|
||||
|
|
|
@ -46,11 +46,13 @@ function! SyntaxCheckers_r_svtools_IsAvailable() dict
|
|||
endfunction
|
||||
|
||||
function! SyntaxCheckers_r_svtools_GetLocList() dict
|
||||
let buf = bufnr('')
|
||||
|
||||
let setwd = syntastic#util#isRunningWindows() ? 'setwd("' . escape(getcwd(), '"\') . '"); ' : ''
|
||||
let makeprg = self.getExecEscaped() . ' --slave --restore --no-save' .
|
||||
\ ' -e ' . syntastic#util#shescape(setwd . 'library(svTools); ' .
|
||||
\ 'try(lint(commandArgs(TRUE), filename = commandArgs(TRUE), type = "flat", sep = ":"))') .
|
||||
\ ' --args ' . syntastic#util#shexpand('%')
|
||||
\ ' --args ' . syntastic#util#shescape(bufname(buf))
|
||||
|
||||
let errorformat =
|
||||
\ '%trror:%f:%\s%#%l:%\s%#%v:%m,' .
|
||||
|
|
|
@ -26,11 +26,12 @@ augroup syntastic
|
|||
augroup END
|
||||
|
||||
function! SyntaxCheckers_rst_sphinx_GetLocList() dict
|
||||
let buf = bufnr('')
|
||||
|
||||
let srcdir = syntastic#util#var('rst_sphinx_source_dir')
|
||||
call self.log('g:syntastic_rst_sphinx_source_dir =', srcdir)
|
||||
let srcdir = syntastic#util#bufVar(buf, 'rst_sphinx_source_dir')
|
||||
call self.log('syntastic_rst_sphinx_source_dir =', srcdir)
|
||||
if srcdir ==# ''
|
||||
let config = syntastic#util#findFileInParent('conf.py', expand('%:p:h', 1))
|
||||
let config = syntastic#util#findFileInParent('conf.py', fnamemodify(bufname(buf), ':p:h'))
|
||||
if config ==# '' || !filereadable(config)
|
||||
call self.log('conf.py file not found')
|
||||
return []
|
||||
|
@ -38,10 +39,10 @@ function! SyntaxCheckers_rst_sphinx_GetLocList() dict
|
|||
let srcdir = fnamemodify(config, ':p:h')
|
||||
endif
|
||||
|
||||
let confdir = syntastic#util#var('rst_sphinx_config_dir')
|
||||
call self.log('g:syntastic_rst_sphinx_config_dir =', confdir)
|
||||
let confdir = syntastic#util#bufVar(buf, 'rst_sphinx_config_dir')
|
||||
call self.log('syntastic_rst_sphinx_config_dir =', confdir)
|
||||
if confdir ==# ''
|
||||
let config = syntastic#util#findFileInParent('conf.py', expand('%:p:h', 1))
|
||||
let config = syntastic#util#findFileInParent('conf.py', fnamemodify(bufname(buf), ':p:h'))
|
||||
let confdir = (config !=# '' && filereadable(config)) ? fnamemodify(config, ':p:h') : srcdir
|
||||
endif
|
||||
|
||||
|
|
|
@ -15,8 +15,8 @@ if exists('g:loaded_syntastic_sass_sass_checker')
|
|||
endif
|
||||
let g:loaded_syntastic_sass_sass_checker = 1
|
||||
|
||||
"sass caching for large files drastically speeds up the checking, but store it
|
||||
"in a temp location otherwise sass puts .sass_cache dirs in the users project
|
||||
" sass caching for large files drastically speeds up the checking, but store it
|
||||
" in a temp location otherwise sass puts .sass_cache dirs in the users project
|
||||
let s:sass_cache_location = syntastic#util#tmpdir()
|
||||
lockvar s:sass_cache_location
|
||||
|
||||
|
@ -24,12 +24,12 @@ augroup syntastic
|
|||
autocmd VimLeave * call syntastic#util#rmrf(s:sass_cache_location)
|
||||
augroup END
|
||||
|
||||
"By default do not check partials as unknown variables are a syntax error
|
||||
" By default do not check partials as unknown variables are a syntax error
|
||||
if !exists('g:syntastic_sass_check_partials')
|
||||
let g:syntastic_sass_check_partials = 0
|
||||
endif
|
||||
|
||||
"use compass imports if available
|
||||
" use compass imports if available
|
||||
let s:imports = ''
|
||||
if executable('compass')
|
||||
let s:imports = '--compass'
|
||||
|
@ -39,7 +39,8 @@ let s:save_cpo = &cpo
|
|||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_sass_sass_GetLocList() dict
|
||||
if !g:syntastic_sass_check_partials && expand('%:t', 1)[0] ==# '_'
|
||||
let buf = bufnr('')
|
||||
if !syntastic#util#bufVar(buf, 'sass_check_partials') && fnamemodify(bufname(buf), ':t')[0] ==# '_'
|
||||
return []
|
||||
endif
|
||||
|
||||
|
|
|
@ -24,9 +24,10 @@ function! SyntaxCheckers_scala_fsc_GetLocList() dict
|
|||
" fsc has some serious problems with the
|
||||
" working directory changing after being started
|
||||
" that's why we better pass an absolute path
|
||||
let buf = bufnr('')
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'args': '-Ystop-after:parser',
|
||||
\ 'fname': syntastic#util#shexpand('%:p') })
|
||||
\ 'fname': syntastic#util#shescape(fnamemodify(bufname(buf), ':p')) })
|
||||
|
||||
let errorformat =
|
||||
\ '%E%f:%l: %trror: %m,' .
|
||||
|
|
|
@ -19,21 +19,23 @@ let s:save_cpo = &cpo
|
|||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_sh_sh_IsAvailable() dict " {{{1
|
||||
call self.log('shell =', s:GetShell())
|
||||
return s:IsShellValid()
|
||||
let buf = bufnr('')
|
||||
call self.log('shell =', s:GetShell(buf))
|
||||
return s:IsShellValid(buf)
|
||||
endfunction " }}}1
|
||||
|
||||
function! SyntaxCheckers_sh_sh_GetLocList() dict " {{{1
|
||||
if s:GetShell() ==# 'zsh'
|
||||
let buf = bufnr('')
|
||||
if s:GetShell(buf) ==# 'zsh'
|
||||
return s:ForwardToZshChecker()
|
||||
endif
|
||||
|
||||
if !s:IsShellValid()
|
||||
if !s:IsShellValid(buf)
|
||||
return []
|
||||
endif
|
||||
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'exe': s:GetShell(),
|
||||
\ 'exe': s:GetShell(buf),
|
||||
\ 'args_after': '-n' })
|
||||
|
||||
let errorformat = '%f: line %l: %m'
|
||||
|
@ -45,29 +47,29 @@ endfunction " }}}1
|
|||
|
||||
" Utilities {{{1
|
||||
|
||||
function! s:GetShell() " {{{2
|
||||
if !exists('b:shell') || b:shell ==# ''
|
||||
let b:shell = ''
|
||||
let shebang = syntastic#util#parseShebang()['exe']
|
||||
function! s:GetShell(buf) " {{{2
|
||||
let shell = syntastic#util#getbufvar(a:buf, 'shell')
|
||||
if shell ==# ''
|
||||
let shebang = syntastic#util#parseShebang(a:buf)['exe']
|
||||
if shebang !=# ''
|
||||
if shebang[-strlen('bash'):-1] ==# 'bash'
|
||||
let b:shell = 'bash'
|
||||
let shell = 'bash'
|
||||
elseif shebang[-strlen('zsh'):-1] ==# 'zsh'
|
||||
let b:shell = 'zsh'
|
||||
let shell = 'zsh'
|
||||
elseif shebang[-strlen('sh'):-1] ==# 'sh'
|
||||
let b:shell = 'sh'
|
||||
let shell = 'sh'
|
||||
endif
|
||||
endif
|
||||
" try to use env variable in case no shebang could be found
|
||||
if b:shell ==# ''
|
||||
let b:shell = fnamemodify($SHELL, ':t')
|
||||
if shell ==# ''
|
||||
let shell = fnamemodify($SHELL, ':t')
|
||||
endif
|
||||
endif
|
||||
return b:shell
|
||||
return shell
|
||||
endfunction " }}}2
|
||||