Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

base fork: amix/vimrc
base: 4ba28bb25b
...
head fork: amix/vimrc
compare: b92f0f2eb1
  • 2 commits
  • 156 files changed
  • 0 commit comments
  • 1 contributor
Showing with 2,648 additions and 1,225 deletions.
  1. +41 −3 sources_non_forked/ack.vim/README.md
  2. +17 −6 sources_non_forked/ack.vim/autoload/ack.vim
  3. +14 −2 sources_non_forked/ack.vim/doc/ack.txt
  4. +1 −1  sources_non_forked/ack.vim/ftplugin/qf.vim
  5. +6 −2 sources_non_forked/ack.vim/plugin/ack.vim
  6. +6 −1 sources_non_forked/goyo.vim/plugin/goyo.vim
  7. +5 −2 sources_non_forked/nerdtree/README.markdown
  8. +11 −3 sources_non_forked/nerdtree/autoload/nerdtree.vim
  9. +38 −24 sources_non_forked/nerdtree/doc/NERD_tree.txt
  10. +6 −2 sources_non_forked/nerdtree/lib/nerdtree/bookmark.vim
  11. +1 −1  sources_non_forked/nerdtree/lib/nerdtree/creator.vim
  12. +1 −1  sources_non_forked/nerdtree/lib/nerdtree/menu_item.vim
  13. +21 −0 sources_non_forked/nerdtree/lib/nerdtree/path.vim
  14. +2 −2 sources_non_forked/nerdtree/lib/nerdtree/tree_dir_node.vim
  15. +13 −6 sources_non_forked/nerdtree/nerdtree_plugin/fs_menu.vim
  16. +4 −2 sources_non_forked/nerdtree/plugin/NERD_tree.vim
  17. +51 −39 sources_non_forked/nerdtree/syntax/nerdtree.vim
  18. +89 −33 sources_non_forked/syntastic/CONTRIBUTING.md
  19. +24 −13 sources_non_forked/syntastic/README.markdown
  20. +1 −1  sources_non_forked/syntastic/autoload/syntastic/c.vim
  21. +30 −4 sources_non_forked/syntastic/autoload/syntastic/log.vim
  22. +2 −0  sources_non_forked/syntastic/autoload/syntastic/postprocess.vim
  23. +24 −0 sources_non_forked/syntastic/autoload/syntastic/preprocess.vim
  24. +1 −0  sources_non_forked/syntastic/autoload/syntastic/util.vim
  25. +27 −13 sources_non_forked/syntastic/doc/syntastic.txt
  26. +51 −33 sources_non_forked/syntastic/plugin/syntastic.vim
  27. +5 −11 sources_non_forked/syntastic/plugin/syntastic/checker.vim
  28. +2 −2 sources_non_forked/syntastic/plugin/syntastic/cursor.vim
  29. +9 −2 sources_non_forked/syntastic/plugin/syntastic/highlighting.vim
  30. +28 −2 sources_non_forked/syntastic/plugin/syntastic/loclist.vim
  31. +1 −0  sources_non_forked/syntastic/plugin/syntastic/notifiers.vim
  32. +40 −44 sources_non_forked/syntastic/plugin/syntastic/registry.vim
  33. +13 −10 sources_non_forked/syntastic/plugin/syntastic/signs.vim
  34. +4 −8 sources_non_forked/syntastic/syntax_checkers/actionscript/mxmlc.vim
  35. +3 −2 sources_non_forked/syntastic/syntax_checkers/bemhtml/bemhtmllint.vim
  36. +45 −0 sources_non_forked/syntastic/syntax_checkers/bro/bro.vim
  37. +14 −11 sources_non_forked/syntastic/syntax_checkers/c/checkpatch.vim
  38. +1 −1  sources_non_forked/syntastic/syntax_checkers/c/make.vim
  39. +55 −0 sources_non_forked/syntastic/syntax_checkers/cabal/cabal.vim
  40. +2 −1  sources_non_forked/syntastic/syntax_checkers/co/coco.vim
  41. +5 −1 sources_non_forked/syntastic/syntax_checkers/coffee/coffeelint.vim
  42. +3 −7 sources_non_forked/syntastic/syntax_checkers/css/csslint.vim
  43. +26 −0 sources_non_forked/syntastic/syntax_checkers/css/recess.vim
  44. +6 −0 sources_non_forked/syntastic/syntax_checkers/d/dmd.vim
  45. +16 −11 sources_non_forked/syntastic/syntax_checkers/eruby/ruby.vim
  46. +3 −7 sources_non_forked/syntastic/syntax_checkers/haml/haml.vim
  47. +3 −1 sources_non_forked/syntastic/syntax_checkers/haskell/hdevtools.vim
  48. +7 −16 sources_non_forked/syntastic/syntax_checkers/html/jshint.vim
  49. +4 −0 sources_non_forked/syntastic/syntax_checkers/html/tidy.vim
  50. +51 −65 sources_non_forked/syntastic/syntax_checkers/java/javac.vim
  51. +10 −22 sources_non_forked/syntastic/syntax_checkers/javascript/closurecompiler.vim
  52. +8 −11 sources_non_forked/syntastic/syntax_checkers/javascript/eslint.vim
  53. +2 −5 sources_non_forked/syntastic/syntax_checkers/javascript/gjslint.vim
  54. +7 −14 sources_non_forked/syntastic/syntax_checkers/javascript/jshint.vim
  55. +3 −6 sources_non_forked/syntastic/syntax_checkers/javascript/jsl.vim
  56. +1 −1  sources_non_forked/syntastic/syntax_checkers/javascript/jslint.vim
  57. +44 −0 sources_non_forked/syntastic/syntax_checkers/less/recess.vim
  58. +4 −3 sources_non_forked/syntastic/syntax_checkers/lisp/clisp.vim
  59. +8 −12 sources_non_forked/syntastic/syntax_checkers/perl/perl.vim
  60. +2 −2 sources_non_forked/syntastic/syntax_checkers/php/phpcs.vim
  61. +2 −5 sources_non_forked/syntastic/syntax_checkers/puppet/puppetlint.vim
  62. +2 −1  sources_non_forked/syntastic/syntax_checkers/python/flake8.vim
  63. +3 −1 sources_non_forked/syntastic/syntax_checkers/python/frosted.vim
  64. +25 −11 sources_non_forked/syntastic/syntax_checkers/python/pep257.vim
  65. +2 −1  sources_non_forked/syntastic/syntax_checkers/python/pep8.vim
  66. +2 −1  sources_non_forked/syntastic/syntax_checkers/python/py3kwarn.vim
  67. +8 −7 sources_non_forked/syntastic/syntax_checkers/python/pyflakes.vim
  68. +3 −1 sources_non_forked/syntastic/syntax_checkers/python/pylama.vim
  69. +1 −0  sources_non_forked/syntastic/syntax_checkers/python/pylint.vim
  70. +3 −1 sources_non_forked/syntastic/syntax_checkers/python/python.vim
  71. +4 −1 sources_non_forked/syntastic/syntax_checkers/r/lint.vim
  72. +2 −1  sources_non_forked/syntastic/syntax_checkers/r/svtools.vim
  73. +2 −10 sources_non_forked/syntastic/syntax_checkers/ruby/jruby.vim
  74. +1 −1  sources_non_forked/syntastic/syntax_checkers/ruby/macruby.vim
  75. +8 −10 sources_non_forked/syntastic/syntax_checkers/ruby/mri.vim
  76. +5 −1 sources_non_forked/syntastic/syntax_checkers/ruby/rubylint.vim
  77. +1 −0  sources_non_forked/syntastic/syntax_checkers/sass/sass.vim
  78. +10 −14 sources_non_forked/syntastic/syntax_checkers/{rust/rustc.vim → sass/sassc.vim}
  79. +2 −5 sources_non_forked/syntastic/syntax_checkers/scala/fsc.vim
  80. +3 −7 sources_non_forked/syntastic/syntax_checkers/scala/scalac.vim
  81. +0 −1  sources_non_forked/syntastic/syntax_checkers/scss/sass.vim
  82. +25 −0 sources_non_forked/syntastic/syntax_checkers/scss/sassc.vim
  83. +36 −35 sources_non_forked/syntastic/syntax_checkers/sh/sh.vim
  84. +46 −0 sources_non_forked/syntastic/syntax_checkers/typescript/tslint.vim
  85. +1 −1  sources_non_forked/syntastic/syntax_checkers/vala/valac.vim
  86. +1 −1  sources_non_forked/syntastic/syntax_checkers/vhdl/ghdl.vim
  87. +3 −2 sources_non_forked/syntastic/syntax_checkers/vim/vimlint.vim
  88. +4 −9 sources_non_forked/syntastic/syntax_checkers/yaml/yamlxs.vim
  89. +1 −1  sources_non_forked/syntastic/syntax_checkers/z80/z80syntaxchecker.vim
  90. +2 −24 sources_non_forked/tlib/autoload/tlib/Filter_cnf.vim
  91. +3 −1 sources_non_forked/tlib/autoload/tlib/World.vim
  92. +5 −3 sources_non_forked/tlib/autoload/tlib/string.vim
  93. +2 −2 sources_non_forked/tlib/doc/tlib.txt
  94. +2 −2 sources_non_forked/tlib/plugin/02tlib.vim
  95. +1 −1  sources_non_forked/vim-airline/README.md
  96. +6 −4 sources_non_forked/vim-airline/autoload/airline.vim
  97. +23 −17 sources_non_forked/vim-airline/autoload/airline/extensions.vim
  98. +8 −1 sources_non_forked/vim-airline/autoload/airline/extensions/branch.vim
  99. +16 −1 sources_non_forked/vim-airline/autoload/airline/extensions/hunks.vim
  100. +54 −0 sources_non_forked/vim-airline/autoload/airline/extensions/nrrwrgn.vim
  101. +3 −3 sources_non_forked/vim-airline/autoload/airline/extensions/tabline/unique_tail_improved.vim
  102. +28 −9 sources_non_forked/vim-airline/autoload/airline/extensions/whitespace.vim
  103. +4 −1 sources_non_forked/vim-airline/autoload/airline/highlighter.vim
  104. +1 −1  sources_non_forked/vim-airline/autoload/airline/themes/bubblegum.vim
  105. +29 −5 sources_non_forked/vim-airline/doc/airline.txt
  106. +3 −1 sources_non_forked/vim-commentary/README.markdown
  107. +3 −0  sources_non_forked/vim-commentary/doc/commentary.txt
  108. +1 −0  sources_non_forked/vim-commentary/plugin/commentary.vim
  109. +2 −2 sources_non_forked/vim-fugitive/README.markdown
  110. +42 −16 sources_non_forked/vim-fugitive/doc/fugitive.txt
  111. +363 −107 sources_non_forked/vim-fugitive/plugin/fugitive.vim
  112. +1 −1  sources_non_forked/vim-golang/autoload/go/complete.vim
  113. +3 −1 sources_non_forked/vim-golang/ftplugin/go.vim
  114. +16 −4 sources_non_forked/vim-golang/indent/go.vim
  115. +5 −3 sources_non_forked/vim-golang/readme.txt
  116. +17 −0 sources_non_forked/vim-markdown/README.markdown
  117. +1 −1  sources_non_forked/vim-markdown/ftplugin/markdown.vim
  118. +2 −2 sources_non_forked/vim-markdown/syntax/markdown.vim
  119. +0 −5 sources_non_forked/vim-snipmate/after/plugin/snipMate.vim
  120. +25 −13 sources_non_forked/vim-snipmate/autoload/snipMate.vim
  121. +7 −1 sources_non_forked/vim-snipmate/doc/snipMate.txt
  122. +26 −10 sources_non_forked/vim-snipmate/plugin/snipMate.vim
  123. +22 −16 sources_non_forked/vim-snippets/README.md
  124. +12 −12 sources_non_forked/vim-snippets/UltiSnips/c.snippets
  125. +1 −1  sources_non_forked/vim-snippets/UltiSnips/cpp.snippets
  126. +29 −29 sources_non_forked/vim-snippets/UltiSnips/d.snippets
  127. +6 −0 sources_non_forked/vim-snippets/UltiSnips/go.snippets
  128. +5 −5 sources_non_forked/vim-snippets/UltiSnips/java.snippets
  129. +12 −0 sources_non_forked/vim-snippets/UltiSnips/javascript.snippets
  130. +25 −0 sources_non_forked/vim-snippets/UltiSnips/javascript_angular.snippets
  131. +34 −0 sources_non_forked/vim-snippets/UltiSnips/julia.snippets
  132. +11 −0 sources_non_forked/vim-snippets/UltiSnips/markdown.snippets
  133. +3 −0  sources_non_forked/vim-snippets/UltiSnips/pandoc.snippets
  134. +22 −0 sources_non_forked/vim-snippets/UltiSnips/php_symfony2.snippets
  135. +35 −2 sources_non_forked/vim-snippets/UltiSnips/r.snippets
  136. +92 −55 sources_non_forked/vim-snippets/UltiSnips/rust.snippets
  137. +1 −1  sources_non_forked/vim-snippets/UltiSnips/tex.snippets
  138. +3 −39 sources_non_forked/vim-snippets/UltiSnips/vim.snippets
  139. +18 −0 sources_non_forked/vim-snippets/snippets/_.snippets
  140. +20 −0 sources_non_forked/vim-snippets/snippets/css.snippets
  141. +3 −30 sources_non_forked/vim-snippets/snippets/elixir.snippets
  142. +12 −0 sources_non_forked/vim-snippets/snippets/go.snippets
  143. +4 −1 sources_non_forked/vim-snippets/snippets/html.snippets
  144. +0 −72 sources_non_forked/vim-snippets/snippets/html_minimal.snippets
  145. +60 −17 sources_non_forked/vim-snippets/snippets/java.snippets
  146. +1 −1  sources_non_forked/vim-snippets/snippets/javascript/javascript.snippets
  147. +102 −0 sources_non_forked/vim-snippets/snippets/julia.snippets
  148. +1 −1  sources_non_forked/vim-snippets/snippets/php.snippets
  149. +13 −3 sources_non_forked/vim-snippets/snippets/r.snippets
  150. +2 −2 sources_non_forked/vim-snippets/snippets/ruby.snippets
  151. +125 −0 sources_non_forked/vim-snippets/snippets/rust.snippets
  152. +36 −0 sources_non_forked/vim-snippets/snippets/scheme.snippets
  153. +1 −1  sources_non_forked/vim-snippets/snippets/sh.snippets
  154. +83 −76 sources_non_forked/vim-snippets/snippets/tex.snippets
  155. +14 −12 sources_non_forked/vim-snippets/snippets/vim.snippets
  156. +8 −6 sources_non_forked/vim-surround/plugin/surround.vim
44 sources_non_forked/ack.vim/README.md
View
@@ -9,7 +9,7 @@ ack from vim, and shows the results in a split window.
### Ack
-You will need the ack, of course, to install it follow the
+You will need the ack(>= 2.0), of course, to install it follow the
[manual](http://beyondgrep.com/install/)
### The Plugin
@@ -75,8 +75,8 @@ check out the docs for the Perl script 'ack', for obvious reasons:
### Gotchas
Some characters have special meaning, and need to be escaped your search
-pattern. For instance, '#'. You have to escape it like this :Ack '\\\#define
-foo' to search for #define foo. (From blueyed in issue #5.)
+pattern. For instance, '#'. You have to escape it like this `:Ack '\\\#define
+foo'` to search for '#define foo'. (From blueyed in issue #5.)
## Changelog
@@ -91,3 +91,41 @@ foo' to search for #define foo. (From blueyed in issue #5.)
* Add g:ack_mapping
* Add g:ack_default_options
* Add a help toggle `?`(like NERDTree)
+
+### 1.0.1
+
+* Fixes #124. Bug with `g:ack_autofold_results`
+
+### 1.0.2
+
+* Add compatibility with [vim-dispatch](https://github.com/tpope/vim-dispatch)
+
+### 1.0.3
+
+* Fixes #127. Use `&l:hlsearch` instead of `v:hlsearch` to keep compatibility
+with versions that does not have this variable.
+
+### 1.0.4
+
+* Fixes #128. Always apply mappings, even when using vim-dispatch.
+
+### 1.0.5
+
+* Fixes #128. Fixes the `errorformat` for ack when using vim-dispatch.
+* Do not use vim-dispatch by default. To use vim-dispath must set
+`g:ack_use_dispatch`
+
+### 1.0.6
+
+* Fixes highlight function to work when user passes options. Ex.: Ack -i test
+ Thank's @mannih. (#131, #134)
+
+### 1.0.7
+
+* Fixes highlight function to work when passes more than one option, or options
+with double dashes(--option) Thank's to @MiguelLatorre and @mannih
+
+### 1.0.8
+
+* Fixes (again) highlight, now using negative look behind.
+* Change mappings `o` and `O` to behave as documented
23 sources_non_forked/ack.vim/autoload/ack.vim
View
@@ -8,6 +8,7 @@ function! ack#Ack(cmd, args)
else
let l:grepargs = a:args . join(a:000, ' ')
end
+ echom l:grepargs
let l:ackprg_run = g:ackprg
" Format, used to manage column jump
@@ -26,7 +27,14 @@ function! ack#Ack(cmd, args)
try
" NOTE: we escape special chars, but not everything using shellescape to
" allow for passing arguments etc
- silent execute a:cmd . " " . escape(l:grepargs, '|#%')
+ if g:ack_use_dispatch
+ let &l:errorformat = g:ackformat
+ let &l:makeprg=g:ackprg." " . escape(l:grepargs, '|#%')
+ Make
+ else
+ silent execute a:cmd . " " . escape(l:grepargs, '|#%')
+ endif
+
finally
let &grepprg=grepprg_bak
let &grepformat=grepformat_bak
@@ -42,7 +50,12 @@ function! ack#Ack(cmd, args)
let s:close_cmd = ':cclose<CR>'
endif
- call ack#show_results()
+ if !g:ack_use_dispatch
+ call ack#show_results()
+ else
+ copen
+ endif
+ call <SID>apply_maps()
call <SID>highlight(l:grepargs)
redraw!
@@ -50,7 +63,6 @@ endfunction
function! ack#show_results()
execute s:handler
- call <SID>apply_maps()
endfunction
function! s:apply_maps()
@@ -100,9 +112,8 @@ function! s:highlight(args)
return
endif
- let @/ = matchstr(a:args, "\\v\\w+\>|['\"]\\zs[^\"]+\\ze['\"]")
- setlocal hlsearch
- call feedkeys(":let v:hlsearch=1 \| echo \<CR>", "n")
+ let @/ = matchstr(a:args, "\\v(-)\@<!(\<)\@<=\\w+|['\"]\\zs.{-}\\ze['\"]")
+ call feedkeys(":let &l:hlsearch=1 \| echo \<CR>", "n")
endfunction
function! ack#AckFromSearch(cmd, args)
16 sources_non_forked/ack.vim/doc/ack.txt
View
@@ -86,7 +86,7 @@ Example:
let g:ackprg = "other-bin-ack"
<
- g:ack_default_options*
+ *g:ack_default_options*
g:ack_default_options
Default: " -s -H --nocolor --nogroup --column"
@@ -94,7 +94,7 @@ Use this option to specify the options used by ack
Example:
>
- let g:ackprg =
+ let g:ack_default_options =
\ " -s -H --nocolor --nogroup --column --smart-case --follow"
<
@@ -203,6 +203,18 @@ Example:
let g:ackpreview = 1
<
+ *g:ack_use_dispatch*
+
+g:ack_use_dispatch
+Default: 0
+
+Use this option to use vim-dispatch to search the results in background
+
+Example:
+>
+ let g:ack_use_dispatch = 1
+<
+
==============================================================================
MAPPINGS *ack-mappings*
2  sources_non_forked/ack.vim/ftplugin/qf.vim
View
@@ -1,4 +1,4 @@
-if g:ack_autofold_results
+if exists("g:ack_autofold_results") && g:ack_autofold_results
setlocal foldlevel=0
setlocal foldmethod=expr
setlocal foldexpr=matchstr(getline(v:lnum),'^[^\|]\\+')==#matchstr(getline(v:lnum+1),'^[^\|]\\+')?1:'<1'
8 sources_non_forked/ack.vim/plugin/ack.vim
View
@@ -22,12 +22,16 @@ if !exists("g:ack_apply_lmappings")
let g:ack_apply_lmappings = !exists("g:ack_lhandler")
endif
+if !exists("g:ack_use_dispatch")
+ let g:ack_use_dispatch = 0
+end
+
let s:ack_mappings = {
\ "t": "<C-W><CR><C-W>T",
\ "T": "<C-W><CR><C-W>TgT<C-W>j",
\ "o": "<CR>",
- \ "O": "<CR><C-W><C-W>:ccl<CR>",
- \ "go": "<CR><C-W>j",
+ \ "O": "<CR><C-W>p<C-W>c",
+ \ "go": "<CR><C-W>p",
\ "h": "<C-W><CR><C-W>K",
\ "H": "<C-W><CR><C-W>K<C-W>b",
\ "v": "<C-W><CR><C-W>H<C-W>b<C-W>J<C-W>t",
7 sources_non_forked/goyo.vim/plugin/goyo.vim
View
@@ -104,13 +104,13 @@ function! s:tranquilize()
\ 'StatusLine', 'StatusLineNC', 'SignColumn']
" -1 on Vim / '' on GVim
if bg == -1 || empty(bg)
- call s:set_color(grp, '', 'NONE')
call s:set_color(grp, 'fg', get(g:, 'goyo_bg', 'black'))
call s:set_color(grp, 'bg', 'NONE')
else
call s:set_color(grp, 'fg', bg)
call s:set_color(grp, 'bg', bg)
endif
+ call s:set_color(grp, '', 'NONE')
endfor
endfunction
@@ -244,6 +244,8 @@ function! s:goyo_off()
let goyo_disabled_airline = t:goyo_disabled_airline
let goyo_disabled_powerline = t:goyo_disabled_powerline
let goyo_disabled_lightline = t:goyo_disabled_lightline
+ let goyo_orig_buffer = t:goyo_master
+ let [line, col] = [line('.'), col('.')]
if tabpagenr() == 1
tabnew
@@ -252,6 +254,9 @@ function! s:goyo_off()
endif
tabclose
execute 'normal! '.s:orig_tab.'gt'
+ if winbufnr(0) == goyo_orig_buffer
+ execute printf('normal! %dG%d|', line, col)
+ endif
let wmh = remove(goyo_revert, 'winminheight')
let wh = remove(goyo_revert, 'winheight')
7 sources_non_forked/nerdtree/README.markdown
View
@@ -60,7 +60,7 @@ Installation
cd ~/.vim/bundle
git clone https://github.com/scrooloose/nerdtree.git
-Then reload vim, run `:helptags`, and check out `:help NERD_tree.txt`.
+Then reload vim, run `:Helptags`, and check out `:help NERD_tree.txt`.
Faq
@@ -80,7 +80,10 @@ A. Stick this in your vimrc: `autocmd vimenter * NERDTree`
__Q. How can I open a NERDTree automatically when vim starts up if no files were specified?__
-A. Stick this in your vimrc `autocmd vimenter * if !argc() | NERDTree | endif`
+A. Stick this in your vimrc
+
+ autocmd StdinReadPre * let s:std_in=1
+ autocmd VimEnter * if !argc() == 0 && !exists("s:std_in") | NERDTree | endif
__Q. How can I map a specific key or shortcut to open NERDTree?__
14 sources_non_forked/nerdtree/autoload/nerdtree.vim
View
@@ -513,7 +513,7 @@ function! nerdtree#dumpHelp()
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."\" :Bookmark [<name>]\n"
let @h=@h."\" :BookmarkToRoot <name>\n"
let @h=@h."\" :RevealBookmark <name>\n"
let @h=@h."\" :OpenBookmark <name>\n"
@@ -1068,9 +1068,17 @@ function! s:closeCurrentDir(node)
if parent ==# {} || parent.isRoot()
call nerdtree#echo("cannot close tree root")
else
- call a:node.parent.close()
+ while g:NERDTreeCascadeOpenSingleChildDir && !parent.parent.isRoot()
+ if parent.parent.getVisibleChildCount() == 1
+ call parent.close()
+ let parent = parent.parent
+ else
+ break
+ endif
+ endwhile
+ call parent.close()
call nerdtree#renderView()
- call a:node.parent.putCursorHere(0, 0)
+ call parent.putCursorHere(0, 0)
endif
endfunction
62 sources_non_forked/nerdtree/doc/NERD_tree.txt
View
@@ -109,7 +109,7 @@ The following features and functionality are provided by the NERD tree:
<
:NERDTreeFromBookmark <bookmark> *:NERDTreeFromBookmark*
Opens a fresh NERD tree with the root initialized to the dir for
- <bookmark>. This only reason to use this command over :NERDTree is for
+ <bookmark>. The only reason to use this command over :NERDTree is for
the completion (which is for bookmarks rather than directories).
:NERDTreeToggle [<start-directory> | <bookmark>] *:NERDTreeToggle*
@@ -160,7 +160,7 @@ click bookmarks or use the |NERDTree-o| mapping to activate them. See also,
Note that the following commands are only available in the NERD tree buffer.
-:Bookmark <name>
+:Bookmark [<name>]
Bookmark the current node as <name>. If there is already a <name>
bookmark, it is overwritten. <name> must not contain spaces.
If <name> is not provided, it defaults to the file or directory name.
@@ -358,7 +358,7 @@ Default key: O
Map option: NERDTreeMapOpenRecursively
Applies to: directories.
-Recursively opens the selelected directory.
+Recursively opens the selected directory.
All files and directories are cached, but if a directory would not be
displayed due to file filters (see |'NERDTreeIgnore'| |NERDTree-f|) or the
@@ -609,17 +609,19 @@ NERD tree. These options should be set in your vimrc.
|'loaded_nerd_tree'| Turns off the script.
-|'NERDChristmasTree'| Tells the NERD tree to make itself colourful
- and pretty.
-
|'NERDTreeAutoCenter'| Controls whether the NERD tree window centers
when the cursor moves within a specified
distance to the top/bottom of the window.
+
|'NERDTreeAutoCenterThreshold'| Controls the sensitivity of autocentering.
|'NERDTreeCaseSensitiveSort'| Tells the NERD tree whether to be case
sensitive or not when sorting nodes.
+|'NERDTreeSortHiddenFirst'| Tells the NERD tree whether to take the dot
+ at the beginning of the hidden file names
+ into account when sorting nodes.
+
|'NERDTreeChDirMode'| Tells the NERD tree if/when it should change
vim's current working directory.
@@ -631,8 +633,13 @@ NERD tree. These options should be set in your vimrc.
|'NERDTreeIgnore'| Tells the NERD tree which files to ignore.
+|'NERDTreeRespectWildIgnore'| Tells the NERD tree to respect |'wildignore'|.
+
|'NERDTreeBookmarksFile'| Where the bookmarks are stored.
+|'NERDTreeBookmarksSort'| Whether the bookmarks list is sorted on
+ display.
+
|'NERDTreeMouseMode'| Tells the NERD tree how to handle mouse
clicks.
@@ -667,8 +674,8 @@ NERD tree. These options should be set in your vimrc.
|'NERDTreeDirArrows'| Tells the NERD tree to use arrows instead of
+ ~ chars when displaying directories.
-|'NERDTreeCasadeOpenSingleChildDir'|
- Casade open while selected directory has only
+|'NERDTreeCascadeOpenSingleChildDir'|
+ Cascade open while selected directory has only
one child that also is a directory.
|'NERDTreeAutoDeleteBuffer'| Tells the NERD tree to automatically remove
@@ -686,15 +693,6 @@ If this plugin is making you feel homicidal, it may be a good idea to turn it
off with this line in your vimrc: >
let loaded_nerd_tree=1
<
-------------------------------------------------------------------------------
- *'NERDChristmasTree'*
-Values: 0 or 1.
-Default: 1.
-
-If this option is set to 1 then some extra syntax highlighting elements are
-added to the nerd tree to make it more colourful.
-
-Set it to 0 for a more vanilla looking tree.
------------------------------------------------------------------------------
*'NERDTreeAutoCenter'*
@@ -818,6 +816,13 @@ The file filters can be turned on and off dynamically with the |NERDTree-f|
mapping.
------------------------------------------------------------------------------
+ *'NERDTreeRespectWildIgnore'*
+Values: 0 or 1.
+Default: 0.
+
+If set to 1, the |'wildignore'| setting is respected.
+
+------------------------------------------------------------------------------
*'NERDTreeBookmarksFile'*
Values: a path
Default: $HOME/.NERDTreeBookmarks
@@ -825,6 +830,14 @@ Default: $HOME/.NERDTreeBookmarks
This is where bookmarks are saved. See |NERDTreeBookmarkCommands|.
------------------------------------------------------------------------------
+ *'NERDTreeBookmarksSort'*
+Values: 0 or 1
+Default: 1
+
+If set to 0 then the bookmarks list is not sorted.
+If set to 1 the bookmarks list is sorted.
+
+------------------------------------------------------------------------------
*'NERDTreeMouseMode'*
Values: 1, 2 or 3.
Default: 1.
@@ -987,16 +1000,17 @@ option: >
<
------------------------------------------------------------------------------
- *'NERDTreeCasadeOpenSingleChildDir'*
+ *'NERDTreeCascadeOpenSingleChildDir'*
Values: 0 or 1
Default: 1.
When opening dir nodes, this option tells NERDTree to recursively open dirs
that have only one child which is also a dir. NERDTree will stop when it finds
-a dir that contains anything but another single dir. This option may be useful
-for Java projects. Use one of the follow lines to set this option: >
- let NERDTreeCasadeOpenSingleChildDir=0
- let NERDTreeCasadeOpenSingleChildDir=1
+a dir that contains anything but another single dir. This option also causes
+the |NERDTree-x| mapping to close dirs in the same manner. This option may be
+useful for Java projects. Use one of the follow lines to set this option: >
+ let NERDTreeCascadeOpenSingleChildDir=0
+ let NERDTreeCascadeOpenSingleChildDir=1
<
------------------------------------------------------------------------------
@@ -1062,8 +1076,8 @@ NERDTreeAddKeyMap({options}) *NERDTreeAddKeyMap()*
call NERDTreeAddKeyMap({
\ 'key': 'foo',
\ 'callback': 'NERDTreeCDHandler',
- \ 'quickhelpText': 'echo full path of current node' })
- \ 'scope': 'DirNode'
+ \ 'quickhelpText': 'echo full path of current node',
+ \ 'scope': 'DirNode' })
function! NERDTreeCDHandler(dirnode)
call a:dirnode.changeToDir()
8 sources_non_forked/nerdtree/lib/nerdtree/bookmark.vim
View
@@ -19,7 +19,9 @@ function! s:Bookmark.AddBookmark(name, path)
endif
endfor
call add(s:Bookmark.Bookmarks(), s:Bookmark.New(a:name, a:path))
- call s:Bookmark.Sort()
+ if g:NERDTreeBookmarksSort ==# 1
+ call s:Bookmark.Sort()
+ endif
endfunction
" FUNCTION: Bookmark.Bookmarks() {{{1
@@ -101,7 +103,9 @@ function! s:Bookmark.CacheBookmarks(silent)
call nerdtree#echo(invalidBookmarksFound . " invalid bookmarks were read. See :help NERDTreeInvalidBookmarks for info.")
endif
endif
- call s:Bookmark.Sort()
+ if g:NERDTreeBookmarksSort ==# 1
+ call s:Bookmark.Sort()
+ endif
endif
endfunction
2  sources_non_forked/nerdtree/lib/nerdtree/creator.vim
View
@@ -279,8 +279,8 @@ function! s:Creator._setCommonBufOptions()
let b:NERDTreeShowFiles = g:NERDTreeShowFiles
let b:NERDTreeShowHidden = g:NERDTreeShowHidden
let b:NERDTreeShowBookmarks = g:NERDTreeShowBookmarks
- setfiletype nerdtree
call self._bindMappings()
+ setlocal filetype=nerdtree
endfunction
"FUNCTION: s:Creator._setupStatusline() {{{1
2  sources_non_forked/nerdtree/lib/nerdtree/menu_item.vim
View
@@ -90,7 +90,7 @@ endfunction
"callback
function! s:MenuItem.execute()
if len(self.children)
- let mc = s:MenuController.New(self.children)
+ let mc = g:NERDTreeMenuController.New(self.children)
call mc.showMenu()
else
if self.callback != -1
21 sources_non_forked/nerdtree/lib/nerdtree/path.vim
View
@@ -103,6 +103,10 @@ function! s:Path.compareTo(path)
elseif thisSS > thatSS
return 1
else
+ if !g:NERDTreeSortHiddenFirst
+ let thisPath = substitute(thisPath, '^[._]', '', '')
+ let thatPath = substitute(thatPath, '^[._]', '', '')
+ endif
"if the sort sequences are the same then compare the paths
"alphabetically
let pathCompare = g:NERDTreeCaseSensitiveSort ? thisPath <# thatPath : thisPath <? thatPath
@@ -141,6 +145,7 @@ function! s:Path.Create(fullpath)
"assume its a file and create
else
+ call s:Path.createParentDirectories(a:fullpath)
call writefile([], a:fullpath)
endif
catch
@@ -161,6 +166,8 @@ function! s:Path.copy(dest)
throw "NERDTree.CopyingNotSupportedError: Copying is not supported on this OS"
endif
+ call s:Path.createParentDirectories(a:dest)
+
let dest = s:Path.WinToUnixPath(a:dest)
let cmd = g:NERDTreeCopyCmd . " " . escape(self.str(), nerdtree#escChars()) . " " . escape(dest, nerdtree#escChars())
@@ -197,6 +204,20 @@ function! s:Path.copyingWillOverwrite(dest)
endif
endfunction
+"FUNCTION: Path.createParentDirectories(path) {{{1
+"
+"create parent directories for this path if needed
+"without throwing any errors is those directories already exist
+"
+"Args:
+"path: full path of the node whose parent directories may need to be created
+function! s:Path.createParentDirectories(path)
+ let dir_path = fnamemodify(a:path, ':h')
+ if !isdirectory(dir_path)
+ call mkdir(dir_path, 'p')
+ endif
+endfunction
+
"FUNCTION: Path.delete() {{{1
"
"Deletes the file represented by this path.
4 sources_non_forked/nerdtree/lib/nerdtree/tree_dir_node.vim
View
@@ -229,7 +229,7 @@ function! s:TreeDirNode._initChildren(silent)
let globDir = dir.str({'format': 'Glob'})
if version >= 703
- let filesStr = globpath(globDir, '*', 1) . "\n" . globpath(globDir, '.*', 1)
+ let filesStr = globpath(globDir, '*', !g:NERDTreeRespectWildIgnore) . "\n" . globpath(globDir, '.*', !g:NERDTreeRespectWildIgnore)
else
let filesStr = globpath(globDir, '*') . "\n" . globpath(globDir, '.*')
endif
@@ -500,7 +500,7 @@ function! s:TreeDirNode.toggleOpen(...)
if self.isOpen ==# 1
call self.close()
else
- if g:NERDTreeCasadeOpenSingleChildDir == 0
+ if g:NERDTreeCascadeOpenSingleChildDir == 0
call self.open(opts)
else
call self.openAlong(opts)
19 sources_non_forked/nerdtree/nerdtree_plugin/fs_menu.vim
View
@@ -82,13 +82,14 @@ endfunction
function! s:promptToRenameBuffer(bufnum, msg, newFileName)
echo a:msg
if g:NERDTreeAutoDeleteBuffer || nr2char(getchar()) ==# 'y'
+ let quotedFileName = "'" . a:newFileName . "'"
" 1. ensure that a new buffer is loaded
- exec "badd " . a:newFileName
+ exec "badd " . quotedFileName
" 2. ensure that all windows which display the just deleted filename
" display a buffer for a new filename.
let s:originalTabNumber = tabpagenr()
let s:originalWindowNumber = winnr()
- exec "tabdo windo if winbufnr(0) == " . a:bufnum . " | exec ':e! " . a:newFileName . "' | endif"
+ exec "tabdo windo if winbufnr(0) == " . a:bufnum . " | exec \":e! " . quotedFileName . "\" | endif"
exec "tabnext " . s:originalTabNumber
exec s:originalWindowNumber . "wincmd w"
" 3. We don't need a previous buffer anymore
@@ -114,7 +115,10 @@ function! NERDTreeAddNode()
let parentNode = b:NERDTreeRoot.findNode(newPath.getParent())
let newTreeNode = g:NERDTreeFileNode.New(newPath)
- if parentNode.isOpen || !empty(parentNode.children)
+ if empty(parentNode)
+ call b:NERDTreeRoot.refresh()
+ call nerdtree#renderView()
+ elseif parentNode.isOpen || !empty(parentNode.children)
call parentNode.addChild(newTreeNode, 1)
call NERDTreeRender()
call newTreeNode.putCursorHere(1, 0)
@@ -138,7 +142,7 @@ function! NERDTreeMoveNode()
endif
try
- let bufnum = bufnr(curNode.path.str())
+ let bufnum = bufnr("^".curNode.path.str()."$")
call curNode.rename(newNodePath)
call NERDTreeRender()
@@ -186,7 +190,7 @@ function! NERDTreeDeleteNode()
"if the node is open in a buffer, ask the user if they want to
"close that buffer
- let bufnum = bufnr(currentNode.path.str())
+ let bufnum = bufnr("^".currentNode.path.str()."$")
if buflisted(bufnum)
let prompt = "\nNode deleted.\n\nThe file is open in buffer ". bufnum . (bufwinnr(bufnum) ==# -1 ? " (hidden)" : "") .". Delete this buffer? (yN)"
call s:promptToDelBuffer(bufnum, prompt)
@@ -224,7 +228,10 @@ function! NERDTreeCopyNode()
if confirmed
try
let newNode = currentNode.copy(newNodePath)
- if !empty(newNode)
+ if empty(newNode)
+ call b:NERDTreeRoot.refresh()
+ call nerdtree#renderView()
+ else
call NERDTreeRender()
call newNode.putCursorHere(0, 0)
endif
6 sources_non_forked/nerdtree/plugin/NERD_tree.vim
View
@@ -45,28 +45,30 @@ function! s:initVariable(var, value)
endfunction
"SECTION: Init variable calls and other random constants {{{2
-call s:initVariable("g:NERDChristmasTree", 1)
call s:initVariable("g:NERDTreeAutoCenter", 1)
call s:initVariable("g:NERDTreeAutoCenterThreshold", 3)
call s:initVariable("g:NERDTreeCaseSensitiveSort", 0)
+call s:initVariable("g:NERDTreeSortHiddenFirst", 1)
call s:initVariable("g:NERDTreeChDirMode", 0)
call s:initVariable("g:NERDTreeMinimalUI", 0)
if !exists("g:NERDTreeIgnore")
let g:NERDTreeIgnore = ['\~$']
endif
call s:initVariable("g:NERDTreeBookmarksFile", expand('$HOME') . '/.NERDTreeBookmarks')
+call s:initVariable("g:NERDTreeBookmarksSort", 1)
call s:initVariable("g:NERDTreeHighlightCursorline", 1)
call s:initVariable("g:NERDTreeHijackNetrw", 1)
call s:initVariable("g:NERDTreeMouseMode", 1)
call s:initVariable("g:NERDTreeNotificationThreshold", 100)
call s:initVariable("g:NERDTreeQuitOnOpen", 0)
+call s:initVariable("g:NERDTreeRespectWildIgnore", 0)
call s:initVariable("g:NERDTreeShowBookmarks", 0)
call s:initVariable("g:NERDTreeShowFiles", 1)
call s:initVariable("g:NERDTreeShowHidden", 0)
call s:initVariable("g:NERDTreeShowLineNumbers", 0)
call s:initVariable("g:NERDTreeSortDirs", 1)
call s:initVariable("g:NERDTreeDirArrows", !nerdtree#runningWindows())
-call s:initVariable("g:NERDTreeCasadeOpenSingleChildDir", 1)
+call s:initVariable("g:NERDTreeCascadeOpenSingleChildDir", 1)
if !exists("g:NERDTreeSortOrder")
let g:NERDTreeSortOrder = ['\/$', '*', '\.swp$', '\.bak$', '\~$']
90 sources_non_forked/nerdtree/syntax/nerdtree.vim
View
@@ -7,38 +7,54 @@ syn match NERDTreeFlag #\[RO\]#
"highlighting for the .. (up dir) line at the top of the tree
execute "syn match NERDTreeUp #\\V". s:tree_up_dir_line ."#"
-"highlighting for the ~/+ symbols for the directory nodes
-syn match NERDTreeClosable #\~\<#
-syn match NERDTreeClosable #\~\.#
-syn match NERDTreeOpenable #+\<#
-syn match NERDTreeOpenable #+\.#he=e-1
-
-"highlighting for the tree structural parts
-syn match NERDTreePart #|#
-syn match NERDTreePart #`#
-syn match NERDTreePartFile #[|`]-#hs=s+1 contains=NERDTreePart
-
"quickhelp syntax elements
-syn match NERDTreeHelpKey #" \{1,2\}[^ ]*:#hs=s+2,he=e-1
-syn match NERDTreeHelpKey #" \{1,2\}[^ ]*,#hs=s+2,he=e-1
-syn match NERDTreeHelpTitle #" .*\~#hs=s+2,he=e-1 contains=NERDTreeFlag
-syn match NERDTreeToggleOn #".*(on)#hs=e-2,he=e-1 contains=NERDTreeHelpKey
-syn match NERDTreeToggleOff #".*(off)#hs=e-3,he=e-1 contains=NERDTreeHelpKey
+syn match NERDTreeHelpKey #" \{1,2\}[^ ]*:#ms=s+2,me=e-1
+syn match NERDTreeHelpKey #" \{1,2\}[^ ]*,#ms=s+2,me=e-1
+syn match NERDTreeHelpTitle #" .*\~#ms=s+2,me=e-1
+syn match NERDTreeToggleOn #(on)#ms=s+1,he=e-1
+syn match NERDTreeToggleOff #(off)#ms=e-3,me=e-1
syn match NERDTreeHelpCommand #" :.\{-}\>#hs=s+3
syn match NERDTreeHelp #^".*# contains=NERDTreeHelpKey,NERDTreeHelpTitle,NERDTreeFlag,NERDTreeToggleOff,NERDTreeToggleOn,NERDTreeHelpCommand
-"highlighting for readonly files
-syn match NERDTreeRO #.*\[RO\]#hs=s+2 contains=NERDTreeFlag,NERDTreeBookmark,NERDTreePart,NERDTreePartFile
-
"highlighting for sym links
-syn match NERDTreeLink #[^-| `].* -> # contains=NERDTreeBookmark,NERDTreeOpenable,NERDTreeClosable,NERDTreeDirSlash
+syn match NERDTreeLinkTarget #->.*# containedin=NERDTreeDir,NERDTreeFile
+syn match NERDTreeLinkFile #.* ->#me=e-3 containedin=NERDTreeFile
+syn match NERDTreeLinkDir #.*/ ->#me=e-3 containedin=NERDTreeDir
"highlighing for directory nodes and file nodes
-syn match NERDTreeDirSlash #/#
-syn match NERDTreeDir #[^-| `].*/# contains=NERDTreeLink,NERDTreeDirSlash,NERDTreeOpenable,NERDTreeClosable
-syn match NERDTreeExecFile #[|` ].*\*\($\| \)# contains=NERDTreeLink,NERDTreePart,NERDTreeRO,NERDTreePartFile,NERDTreeBookmark
-syn match NERDTreeFile #|-.*# contains=NERDTreeLink,NERDTreePart,NERDTreeRO,NERDTreePartFile,NERDTreeBookmark,NERDTreeExecFile
-syn match NERDTreeFile #`-.*# contains=NERDTreeLink,NERDTreePart,NERDTreeRO,NERDTreePartFile,NERDTreeBookmark,NERDTreeExecFile
+syn match NERDTreeDirSlash #/# containedin=NERDTreeDir
+
+if g:NERDTreeDirArrows
+ syn match NERDTreeClosable #▾# containedin=NERDTreeDir,NERDTreeFile
+ syn match NERDTreeOpenable #▸# containedin=NERDTreeDir,NERDTreeFile
+
+ syn match NERDTreeDir #[^▾▸ ].*/#
+ syn match NERDTreeExecFile #^ .*\*\($\| \)# contains=NERDTreeRO,NERDTreeBookmark
+ syn match NERDTreeFile #^[^"\.▾▸] *[^▾▸]*# contains=NERDTreeLink,NERDTreeRO,NERDTreeBookmark,NERDTreeExecFile
+
+ "highlighting for readonly files
+ syn match NERDTreeRO # *\zs.*\ze \[RO\]# contains=NERDTreeFlag,NERDTreeBookmark,NERDTreeFile
+else
+ "highlighting for the ~/+ symbols for the directory nodes
+ syn match NERDTreeClosable #\~\<#
+ syn match NERDTreeClosable #\~\.#
+ syn match NERDTreeOpenable #+\<#
+ syn match NERDTreeOpenable #+\.#he=e-1
+
+ "highlighting for the tree structural parts
+ syn match NERDTreePart #|#
+ syn match NERDTreePart #`#
+ syn match NERDTreePartFile #[|`]-#hs=s+1 contains=NERDTreePart
+
+ syn match NERDTreeDir #[^-| `].*/# contains=NERDTreeLink,NERDTreeOpenable,NERDTreeClosable
+ syn match NERDTreeExecFile #[|` ].*\*\($\| \)# contains=NERDTreeLink,NERDTreePart,NERDTreePartFile,NERDTreeBookmark
+ syn match NERDTreeFile #|-.*# contains=NERDTreeLink,NERDTreePart,NERDTreePartFile,NERDTreeBookmark,NERDTreeExecFile
+ syn match NERDTreeFile #`-.*# contains=NERDTreeLink,NERDTreePart,NERDTreePartFile,NERDTreeBookmark,NERDTreeExecFile
+
+ "highlighting for readonly files
+ syn match NERDTreeRO #|-.*\[RO\]#he=e-5 contains=NERDTreeFlag,NERDTreeBookmark,NERDTreePart,NERDTreePartFile
+endif
+
syn match NERDTreeCWD #^[</].*$#
"highlighting for bookmarks
@@ -50,19 +66,10 @@ syn match NERDTreeBookmarksHeader #^>-\+Bookmarks-\+$# contains=NERDTreeBookmark
syn match NERDTreeBookmarkName #^>.\{-} #he=e-1 contains=NERDTreeBookmarksLeader
syn match NERDTreeBookmark #^>.*$# contains=NERDTreeBookmarksLeader,NERDTreeBookmarkName,NERDTreeBookmarksHeader
-if exists("g:NERDChristmasTree") && g:NERDChristmasTree
- hi def link NERDTreePart Special
- hi def link NERDTreePartFile Type
- hi def link NERDTreeFile Normal
- hi def link NERDTreeExecFile Title
- hi def link NERDTreeDirSlash Identifier
- hi def link NERDTreeClosable Type
-else
- hi def link NERDTreePart Normal
- hi def link NERDTreePartFile Normal
- hi def link NERDTreeFile Normal
- hi def link NERDTreeClosable Title
-endif
+hi def link NERDTreePart Special
+hi def link NERDTreePartFile Type
+hi def link NERDTreeExecFile Title
+hi def link NERDTreeDirSlash Identifier
hi def link NERDTreeBookmarksHeader statement
hi def link NERDTreeBookmarksLeader ignore
@@ -76,11 +83,16 @@ hi def link NERDTreeHelpTitle Macro
hi def link NERDTreeToggleOn Question
hi def link NERDTreeToggleOff WarningMsg
+hi def link NERDTreeLinkTarget Type
+hi def link NERDTreeLinkFile Macro
+hi def link NERDTreeLinkDir Macro
+
hi def link NERDTreeDir Directory
hi def link NERDTreeUp Directory
+hi def link NERDTreeFile Normal
hi def link NERDTreeCWD Statement
-hi def link NERDTreeLink Macro
hi def link NERDTreeOpenable Title
+hi def link NERDTreeClosable Title
hi def link NERDTreeFlag ignore
hi def link NERDTreeRO WarningMsg
hi def link NERDTreeBookmark Statement
122 sources_non_forked/syntastic/CONTRIBUTING.md
View
@@ -1,49 +1,105 @@
-# Bug reports / Github issues
+# CONTRIBUTING
+- - -
+1\. [Bug reports / GitHub issues](#bugreps)
+2\. [Submitting a patch](#patches)
+3\. [General style notes](#generalstyle)
+4\. [Syntax checker notes](#checkerstyle)
+- - -
-When reporting a bug make sure you search the existing github issues for the
-same/similar issues. If you find one, feel free to add a `+1` comment with any
-additional information that may help us solve the issue.
+<a name="bugreps"></a>
+
+## 1. Bug reports / GitHub issues
+
+Please note that the preferred channel for posting bug reports is the
+[issue tracker at GitHub][0]. Reports posted elsewhere are less likely
+to be seen by the core team.
+
+When reporting a bug make sure you search the existing GitHub issues
+for the same/similar issues. If you find one, feel free to add a `+1`
+comment with any additional information that may help us solve the
+issue.
When creating a new issue be sure to state the following:
-* Steps to reproduce the bug.
-* The version of vim you are using.
-* The version of syntastic you are using.
+* steps to reproduce the bug;
+* the version of Vim you are using (run `:ver` to find out);
+* the version of syntastic you are using (see `:SyntasticInfo`).
+
+For syntax checker bugs also state the version of the checker executable
+that you are using. Adding debugging information is typically useful
+too:
+
+* open a file handled by your checker;
+* set `g:syntastic_debug` to 1 or 3;
+* run the checker;
+* copy the output of `:mes`.
+
+<a name="patches"></a>
+
+## 2. Submitting a patch
-For syntax checker bugs also state the version of the checker executable that you are using.
+Before you consider adding features to syntastic, _please_ spend a few
+minutes (re-)reading the latest version of the [manual][1]. Syntastic
+is changing rapidly at times, and it's quite possible that some of the
+features you want to add exist already.
-# Submitting a patch
+To submit a patch:
-* Fork the repo on github
-* Make a [topic branch](https://github.com/dchelimsky/rspec/wiki/Topic-Branches#using-topic-branches-when-contributing-patches) and start hacking
-* Submit a pull request based off your topic branch
+* fork the [repo][2] on GitHub;
+* make a [topic branch][3] and start hacking;
+* submit a pull request based off your topic branch.
-Small focused patches are preferred.
+Small, focused patches are preferred.
-Large changes to the code should be discussed with the core team first. Create an issue and explain your plan and see what we say.
+Large changes to the code should be discussed with the core team first.
+Create an issue and explain your plan and see what we say.
-# General style notes
+Also make sure to update the manual whenever applicable. Nobody can use
+features that aren't documented.
-Following the coding conventions/styles used in the syntastic core:
+<a name="generalstyle"></a>
-* Use 4 space indents.
-* Don't use abbreviated keywords - e.g. use `endfunction`, not `endfun` (there's always room for more fun!).
-* Don't use `l:` prefixes for variables unless actually required (i.e. almost never).
-* Code for maintainability. We would rather a function be a couple of lines longer and have (for example) some [explaining variables](http://www.refactoring.com/catalog/extractVariable.html) to aid readability.
+## 3. General style notes
-# Syntax checker style notes
+Follow the coding conventions/styles used in the syntastic core:
-The preferred style for error format strings is one "clause" per line. E.g.
-(from the coffeelint checker):
+* use 4 space indents;
+* don't use abbreviated keywords - e.g. use `endfunction`, not `endfun`
+(there's always room for more fun!);
+* don't use `l:` prefixes for variables unless actually required (i.e.
+almost never);
+* code for maintainability; we would rather a function be a couple of
+lines longer and have (for example) some [explaining variables][4] to
+aid readability.
-```viml
-let errorformat = '%E%f:%l:%c: %trror: %m,' .
- \ 'Syntax%trror: In %f\, %m on line %l,' .
- \ '%EError: In %f\, Parse error on line %l: %m,' .
- \ '%EError: In %f\, %m on line %l,' .
- \ '%W%f(%l): lint warning: %m,' .
- \ '%W%f(%l): warning: %m,' .
- \ '%E%f(%l): SyntaxError: %m,' .
- \ '%-Z%p^,' .
- \ '%-G%.%#'
+<a name="checkerstyle"></a>
+
+## 4. Syntax checker notes
+
+Make sure to read the [guide][5] if you plan to add new syntax checkers.
+
+Use the existing checkers as templates, rather than writing everything
+from scratch.
+
+The preferred style for error format strings is one "clause" per line.
+E.g. (from the `coffee` checker):
+
+```vim
+let errorformat =
+ \ '%E%f:%l:%c: %trror: %m,' .
+ \ 'Syntax%trror: In %f\, %m on line %l,' .
+ \ '%EError: In %f\, Parse error on line %l: %m,' .
+ \ '%EError: In %f\, %m on line %l,' .
+ \ '%W%f(%l): lint warning: %m,' .
+ \ '%W%f(%l): warning: %m,' .
+ \ '%E%f(%l): SyntaxError: %m,' .
+ \ '%-Z%p^,' .
+ \ '%-G%.%#'
```
+
+[0]: https://github.com/scrooloose/syntastic/issues
+[1]: https://github.com/scrooloose/syntastic/blob/master/doc/syntastic.txt
+[2]: https://github.com/scrooloose/syntastic
+[3]: https://github.com/dchelimsky/rspec/wiki/Topic-Branches#using-topic-branches-when-contributing-patches
+[4]: http://www.refactoring.com/catalog/extractVariable.html
+[5]: https://github.com/scrooloose/syntastic/wiki/Syntax-Checker-Guide
37 sources_non_forked/syntastic/README.markdown
View
@@ -35,16 +35,16 @@ the user is notified and is happy because they didn't have to compile their
code or execute their script to find them.
At the time of this writing, syntax checking plugins exist for ActionScript,
-Ada, AppleScript, AsciiDoc, ASM, BEMHTML, Bourne shell, C, C++, C#, Chef,
-CoffeeScript, Coco, Coq, CSS, Cucumber, CUDA, D, Dart, DocBook, Dust, Elixir,
-Erlang, eRuby, Fortran, Gentoo metadata, GLSL, Go, Haml, Haskell, Haxe,
+Ada, AppleScript, AsciiDoc, ASM, BEMHTML, Bro, Bourne shell, C, C++, C#, Cabal,
+Chef, CoffeeScript, Coco, Coq, CSS, Cucumber, CUDA, D, Dart, DocBook, Dust,
+Elixir, Erlang, eRuby, Fortran, Gentoo metadata, GLSL, Go, Haml, Haskell, Haxe,
Handlebars, HSS, HTML, Java, JavaScript, JSON, JSX, LESS, Lex, Limbo, LISP,
LLVM intermediate language, Lua, MATLAB, NASM, Objective-C, Objective-C++,
OCaml, Perl, Perl POD, PHP, gettext Portable Object, OS X and iOS property
-lists, Puppet, Python, Racket, R, reStructuredText, Ruby, Rust, SASS/SCSS,
-Scala, Slim, Tcl, TeX, Texinfo, Twig, TypeScript, Vala, Verilog, VHDL, VimL,
-xHtml, XML, XSLT, YACC, YAML, z80, Zope page templates, and zsh. See the
-[wiki][3] for details about the corresponding supported checkers.
+lists, Puppet, Python, Racket, R, reStructuredText, Ruby, SASS/SCSS, Scala,
+Slim, Tcl, TeX, Texinfo, Twig, TypeScript, Vala, Verilog, VHDL, VimL, xHtml,
+XML, XSLT, YACC, YAML, z80, Zope page templates, and zsh. See the [wiki][3]
+for details about the corresponding supported checkers.
Below is a screenshot showing the methods that Syntastic uses to display syntax
errors. Note that, in practise, you will only have a subset of these methods
@@ -76,9 +76,8 @@ First I'll show you how to install Tim Pope's [pathogen][1] so that it's easy to
install syntastic. Do this in your terminal so that you get the `pathogen.vim`
file and the directories it needs:
```sh
-mkdir -p ~/.vim/autoload ~/.vim/bundle; \
-curl -so ~/.vim/autoload/pathogen.vim \
- https://raw.github.com/tpope/vim-pathogen/master/autoload/pathogen.vim
+mkdir -p ~/.vim/autoload ~/.vim/bundle && \
+curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
```
Next you *need* to add this to your `~/.vimrc`:
```vim
@@ -92,7 +91,7 @@ execute pathogen#infect()
You now have pathogen installed and can put syntastic into `~/.vim/bundle` like
this:
```sh
-cd ~/.vim/bundle
+cd ~/.vim/bundle && \
git clone https://github.com/scrooloose/syntastic.git
```
Quit vim and start it back up to reload it, then type:
@@ -143,6 +142,14 @@ still producing useful results, the checker is now disabled by default. To
let g:syntastic_enable_perl_checker = 1
```
+<a name="faqrust"></a>
+
+__Q. What happened to the `rustc` checker?__
+
+A. It has been included in the [Rust compiler package][12]. If you have
+a recent version of the Rust compiler, the checker should be picked up
+automatically by syntastic.
+
<a name="faqloclist"></a>
__Q. I run a checker and the location list is not updated...__
@@ -272,8 +279,10 @@ cabbrev <silent> bd lclose\|bdelete
## 4\. Other resources
The preferred place for posting suggestions, reporting bugs, and general
-discussions related to syntastic is the [issue tracker at GitHub][4]. There
-are also a [google group][5], and a [syntastic tag at StackOverflow][6].
+discussions related to syntastic is the [issue tracker at GitHub][4].
+A guide for writing syntax checkers can be found in the [wiki][11].
+There are also a dedicated [google group][5], and a
+[syntastic tag at StackOverflow][6].
Syntastic aims to provide a common interface to syntax checkers for as many
languages as possible. For particular languages, there are, of course, other
@@ -291,3 +300,5 @@ a look at [jedi-vim][7], [python-mode][8], or [YouCompleteMe][9].
[8]: https://github.com/klen/python-mode
[9]: http://valloric.github.io/YouCompleteMe/
[10]: http://perldoc.perl.org/perlrun.html#*-c*
+[11]: https://github.com/scrooloose/syntastic/wiki/Syntax-Checker-Guide
+[12]: https://github.com/rust-lang/rust/
2  sources_non_forked/syntastic/autoload/syntastic/c.vim
View
@@ -180,7 +180,7 @@ endfunction " }}}2
function! s:getIncludeDirs(filetype) " {{{2
let include_dirs = []
- if a:filetype =~# '\v^%(c|cpp|d|objc|objcpp)$' &&
+ if a:filetype =~# '\v^%(c|cpp|objc|objcpp)$' &&
\ (!exists('g:syntastic_'.a:filetype.'_no_default_include_dirs') ||
\ !g:syntastic_{a:filetype}_no_default_include_dirs)
let include_dirs = copy(s:default_includes)
34 sources_non_forked/syntastic/autoload/syntastic/log.vim
View
@@ -6,7 +6,7 @@ let g:loaded_syntastic_log_autoload = 1
let s:save_cpo = &cpo
set cpo&vim
-let s:deprecation_notices_issued = []
+let s:one_time_notices_issued = []
" Public functions {{{1
@@ -27,15 +27,39 @@ function! syntastic#log#error(msg) " {{{2
echohl None
endfunction " }}}2
-function! syntastic#log#deprecationWarn(msg) " {{{2
- if index(s:deprecation_notices_issued, a:msg) >= 0
+function! syntastic#log#oneTimeWarn(msg) " {{{2
+ if index(s:one_time_notices_issued, a:msg) >= 0
return
endif
- call add(s:deprecation_notices_issued, a:msg)
+ call add(s:one_time_notices_issued, a:msg)
call syntastic#log#warn(a:msg)
endfunction " }}}2
+" @vimlint(EVL102, 1, l:OLD_VAR)
+function! syntastic#log#deprecationWarn(old, new, ...) " {{{2
+ if exists('g:syntastic_' . a:old) && !exists('g:syntastic_' . a:new)
+ let msg = 'variable g:syntastic_' . a:old . ' is deprecated, please use '
+
+ if a:0
+ let OLD_VAR = g:syntastic_{a:old}
+ try
+ let NEW_VAR = eval(a:1)
+ let msg .= 'in its stead: let g:syntastic_' . a:new . ' = ' . string(NEW_VAR)
+ let g:syntastic_{a:new} = NEW_VAR
+ catch
+ let msg .= 'g:syntastic_' . a:new . ' instead'
+ endtry
+ else
+ let msg .= 'g:syntastic_' . a:new . ' instead'
+ let g:syntastic_{a:new} = g:syntastic_{a:old}
+ endif
+
+ call syntastic#log#oneTimeWarn(msg)
+ endif
+endfunction " }}}2
+" @vimlint(EVL102, 0, l:OLD_VAR)
+
function! syntastic#log#debug(level, msg, ...) " {{{2
if !s:isDebugEnabled(a:level)
return
@@ -113,6 +137,7 @@ function! s:isDebugEnabled_dumb(level) " {{{2
endfunction " }}}2
let s:isDebugEnabled = function(exists('*and') ? 's:isDebugEnabled_smart' : 's:isDebugEnabled_dumb')
+lockvar s:isDebugEnabled
function! s:logRedirect(on) " {{{2
if exists("g:syntastic_debug_file")
@@ -138,6 +163,7 @@ function! s:logTimestamp_dumb() " {{{2
endfunction " }}}2
let s:logTimestamp = function(has('reltime') ? 's:logTimestamp_smart' : 's:logTimestamp_dumb')
+lockvar s:logTimestamp
function! s:formatVariable(name) " {{{2
let vals = []
2  sources_non_forked/syntastic/autoload/syntastic/postprocess.vim
View
@@ -14,6 +14,8 @@ function! syntastic#postprocess#compressWhitespace(errors) " {{{2
let e['text'] = substitute(e['text'], "\001", '', 'g')
let e['text'] = substitute(e['text'], '\n', ' ', 'g')
let e['text'] = substitute(e['text'], '\m\s\{2,}', ' ', 'g')
+ let e['text'] = substitute(e['text'], '\m^\s\+', '', '')
+ let e['text'] = substitute(e['text'], '\m\s\+$', '', '')
endfor
return a:errors
24 sources_non_forked/syntastic/autoload/syntastic/preprocess.vim
View
@@ -8,6 +8,26 @@ set cpo&vim
" Public functions {{{1
+function! syntastic#preprocess#cabal(errors) " {{{2
+ let out = []
+ let star = 0
+ for err in a:errors
+ if star
+ if err == ''
+ let star = 0
+ else
+ let out[-1] .= ' ' . err
+ endif
+ else
+ call add(out, err)
+ if err =~ '\m^*\s'
+ let star = 1
+ endif
+ endif
+ endfor
+ return out
+endfunction " }}}2
+
function! syntastic#preprocess#checkstyle(errors) " {{{2
let out = []
let fname = expand('%')
@@ -95,6 +115,10 @@ function! syntastic#preprocess#rparse(errors) " {{{2
return out
endfunction " }}}2
+function! syntastic#preprocess#tslint(errors) " {{{2
+ return map(copy(a:errors), 'substitute(v:val, ''\m^\(([^)]\+)\)\s\(.\+\)$'', ''\2 \1'', "")')
+endfunction " }}}2
+
function! syntastic#preprocess#validator(errors) " {{{2
let out = []
for e in a:errors
1  sources_non_forked/syntastic/autoload/syntastic/util.vim
View
@@ -88,6 +88,7 @@ endfunction " }}}2
" strwidth() was added in Vim 7.3; if it doesn't exist, we use strlen()
" and hope for the best :)
let s:width = function(exists('*strwidth') ? 'strwidth' : 'strlen')
+lockvar s:width
"print as much of a:msg as possible without "Press Enter" prompt appearing
function! syntastic#util#wideMsg(msg) " {{{2
40 sources_non_forked/syntastic/doc/syntastic.txt
View
@@ -38,9 +38,10 @@ CONTENTS *syntastic-contents*
6.1.Handling of composite filetypes........|syntastic-composite|
6.2.Interaction with python-mode...........|syntastic-pymode|
6.3.Interaction with the fish shell........|syntastic-fish|
- 6.4.Using syntastic with the fizsh shell...|syntastic-fizsh|
- 6.5.Interaction with Eclim.................|syntastic-eclim|
- 6.6.Interaction with vim-virtualenv........|syntastic-vim-virtualenv|
+ 6.4.Interaction with PowerShell............|syntastic-powershell|
+ 6.5.Using syntastic with the fizsh shell...|syntastic-fizsh|
+ 6.6.Interaction with Eclim.................|syntastic-eclim|
+ 6.7.Interaction with vim-virtualenv........|syntastic-vim-virtualenv|
7.About........................................|syntastic-about|
8.License......................................|syntastic-license|
@@ -83,7 +84,7 @@ see |syntastic-checker-options| for details. You can also change the arguments
passed to a specific checker as well.
Use |:SyntasticCheck| to manually check right now. Use |:SyntasticToggleMode|
-to switch between active (checking on writting the buffer) and passive (manual)
+to switch between active (checking on writing the buffer) and passive (manual)
checking.
==============================================================================
@@ -93,7 +94,7 @@ Syntax checking can be done automatically or on demand (see
|'syntastic_mode_map'| and |:SyntasticToggleMode| for configuring this).
When syntax checking is done, the features below can be used to notify the
-user of errors. See |syntastic-options| for how to configure and
+user of errors. See |syntastic-global-options| for how to configure and
activate/deactivate these features.
* A statusline flag
@@ -169,6 +170,8 @@ and the SpellCap group is used for warnings. If you wish to customize the
colors for highlighting you can use the following groups:
SyntasticError - Links to 'SpellBad' by default
SyntasticWarning - Links to 'SpellCap' by default
+ SyntasticStyleError - Links to SyntasticError by default
+ SyntasticStyleWarning - Links to SyntasticWarning by default
Example: >
highlight SyntasticError guibg=#2f0000
@@ -288,10 +291,12 @@ to label error messages with the names of the checkers that created them. >
<
*'syntastic_sort_aggregated_errors'*
Default: 1
-By default, when |syntastic_aggregate_errors| is enabled, errors are grouped
-by file, then sorted by line number, then grouped by type (namely, errors take
-precedence over warnings), then they are sorted by column number. If you want
-to leave messages grouped by checker output, set this variable to 0. >
+By default, when results from multiple checkers are aggregated in a single
+error list (that is either when |syntastic_aggregate_errors| is enabled, or
+when checking a file with a composite filetype), errors are grouped by file,
+then sorted by line number, then grouped by type (namely errors take precedence
+over warnings), then they are sorted by column number. If you want to leave
+messages grouped by checker output, set this variable to 0. >
let g:syntastic_sort_aggregated_errors = 0
<
*'syntastic_echo_current_error'*
@@ -593,7 +598,7 @@ Checkers that use 'makeprgBuild()' construct a 'makeprg' like this: >
\ 'tail': '> /tmp/output' })
<
The result is a 'makeprg' of the form: >
- <exe> <args> <filename> <post_args> <tail>
+ <exe> <args> <fname> <post_args> <tail>
<
*'syntastic_<filetype>_<checker>_exe'*
All arguments above are optional, and can be overridden by setting global
@@ -666,7 +671,16 @@ traditional shell, such as 'zsh', 'bash', 'ksh', or even the original Bourne
set shell=bash
<
------------------------------------------------------------------------------
-6.4. Using syntastic with the fizsh shell *syntastic-fizsh*
+6.4. Interaction with PowerShell *syntastic-powershell*
+
+At the time of this writing, syntastic is not compatible with using 'Windows
+PowerShell' (http://technet.microsoft.com/en-us/library/bb978526.aspx) as Vim's
+'shell'. You may still run Vim from 'PowerShell', but you do have to point
+Vim's 'shell' to a more traditional program, such as 'cmd.exe': >
+ set shell=cmd.exe
+<
+------------------------------------------------------------------------------
+6.5. Using syntastic with the fizsh shell *syntastic-fizsh*
Using syntastic with the 'fizsh' shell (see https://github.com/zsh-users/fizsh)
is possible, but potentially problematic. In order to do it you'll need to set
@@ -679,7 +693,7 @@ interactive features of 'fizsh'. Using a more traditional shell such as 'zsh',
set shell=zsh
<
------------------------------------------------------------------------------
-6.5. Interaction with Eclim *syntastic-eclim*
+6.6. Interaction with Eclim *syntastic-eclim*
As far as syntastic is concerned there shouldn't be any compatibility problems
with the 'Eclim' Vim plugin (see http://eclim.org/). However, at the time of
@@ -688,7 +702,7 @@ makes syntastic forget some of its configuration parameters. No solutions or
workarounds are known for now.
------------------------------------------------------------------------------
-6.6. Interaction with vim-virtualenv *syntastic-vim-virtualenv*
+6.7. Interaction with vim-virtualenv *syntastic-vim-virtualenv*
At the time of this writing, syntastic can't run checkers installed
in Python virtual environments activated by 'vim-virtualenv' (see
84 sources_non_forked/syntastic/plugin/syntastic.vim
View
@@ -16,9 +16,11 @@ let g:loaded_syntastic_plugin = 1
if has('reltime')
let g:syntastic_start = reltime()
+ lockvar! g:syntastic_start
endif
-let g:syntastic_version = '3.4.0-34'
+let g:syntastic_version = '3.4.0-90'
+lockvar g:syntastic_version
" Sanity checks {{{1
@@ -30,6 +32,8 @@ for s:feature in ['autocmd', 'eval', 'modify_fname', 'quickfix', 'user_commands'
endfor
let s:running_windows = syntastic#util#isRunningWindows()
+lockvar s:running_windows
+
if !s:running_windows && executable('uname')
try
let s:uname = system('uname')
@@ -37,6 +41,7 @@ if !s:running_windows && executable('uname')
call syntastic#log#error("your shell " . &shell . " doesn't use traditional UNIX syntax for redirections")
finish
endtry
+ lockvar s:uname
endif
" }}}1
@@ -70,6 +75,7 @@ let g:syntastic_defaults = {
\ 'style_warning_symbol': 'S>',
\ 'warning_symbol': '>>'
\ }
+lockvar! g:syntastic_defaults
for s:key in keys(g:syntastic_defaults)
if !exists('g:syntastic_' . s:key)
@@ -78,7 +84,7 @@ for s:key in keys(g:syntastic_defaults)
endfor
if exists("g:syntastic_quiet_warnings")
- call syntastic#log#deprecationWarn("variable g:syntastic_quiet_warnings is deprecated, please use let g:syntastic_quiet_messages = {'level': 'warnings'} instead")
+ call syntastic#log#oneTimeWarn("variable g:syntastic_quiet_warnings is deprecated, please use let g:syntastic_quiet_messages = {'level': 'warnings'} instead")
if g:syntastic_quiet_warnings
let s:quiet_warnings = get(g:syntastic_quiet_messages, 'type', [])
if type(s:quiet_warnings) != type([])
@@ -106,13 +112,19 @@ let s:debug_dump_options = [
if v:version > 703 || (v:version == 703 && has('patch446'))
call add(s:debug_dump_options, 'shellxescape')
endif
+lockvar! s:debug_dump_options
" debug constants
-let g:SyntasticDebugTrace = 1
-let g:SyntasticDebugLoclist = 2
-let g:SyntasticDebugNotifications = 4
-let g:SyntasticDebugAutocommands = 8
-let g:SyntasticDebugVariables = 16
+let g:SyntasticDebugTrace = 1
+lockvar g:SyntasticDebugTrace
+let g:SyntasticDebugLoclist = 2
+lockvar g:SyntasticDebugLoclist
+let g:SyntasticDebugNotifications = 4
+lockvar g:SyntasticDebugNotifications
+let g:SyntasticDebugAutocommands = 8
+lockvar g:SyntasticDebugAutocommands
+let g:SyntasticDebugVariables = 16
+lockvar g:SyntasticDebugVariables
" }}}1
@@ -130,7 +142,7 @@ let s:modemap = g:SyntasticModeMap.Instance()
function! s:CompleteCheckerName(argLead, cmdLine, cursorPos) " {{{2
let checker_names = []
for ft in s:resolveFiletypes()
- call extend(checker_names, keys(s:registry.getCheckersMap(ft)))
+ call extend(checker_names, s:registry.getNamesOfAvailableCheckers(ft))
endfor
return join(checker_names, "\n")
endfunction " }}}2
@@ -169,11 +181,6 @@ command! SyntasticSetLoclist call g:SyntasticLoclist.current().setloclist()
augroup syntastic
autocmd BufReadPost * call s:BufReadPostHook()
autocmd BufWritePost * call s:BufWritePostHook()
-
- autocmd BufWinEnter * call s:BufWinEnterHook()
-
- " TODO: the next autocmd should be "autocmd BufWinLeave * if &buftype == '' | lclose | endif"
- " but in recent versions of Vim lclose can no longer be called from BufWinLeave
autocmd BufEnter * call s:BufEnterHook()
augroup END
@@ -198,24 +205,22 @@ function! s:BufWritePostHook() " {{{2
call s:UpdateErrors(1)
endfunction " }}}2
-function! s:BufWinEnterHook() " {{{2
- call syntastic#log#debug(g:SyntasticDebugAutocommands,
- \ 'autocmd: BufWinEnter, buffer ' . bufnr("") . ' = ' . string(bufname(str2nr(bufnr("")))) .
- \ ', &buftype = ' . string(&buftype))
- if &buftype == ''
- call s:notifiers.refresh(g:SyntasticLoclist.current())
- endif
-endfunction " }}}2
-
function! s:BufEnterHook() " {{{2
call syntastic#log#debug(g:SyntasticDebugAutocommands,
\ 'autocmd: BufEnter, buffer ' . bufnr("") . ' = ' . string(bufname(str2nr(bufnr("")))) .
\ ', &buftype = ' . string(&buftype))
- " TODO: at this point there is no b:syntastic_loclist
- let loclist = filter(getloclist(0), 'v:val["valid"] == 1')
- let buffers = syntastic#util#unique(map( loclist, 'v:val["bufnr"]' ))
- if &buftype == 'quickfix' && !empty(loclist) && empty(filter( buffers, 'syntastic#util#bufIsActive(v:val)' ))
- call g:SyntasticLoclistHide()
+ if &buftype == ''
+ call s:notifiers.refresh(g:SyntasticLoclist.current())
+ elseif &buftype == 'quickfix'
+ " TODO: this is needed because in recent versions of Vim lclose
+ " can no longer be called from BufWinLeave
+ " TODO: at this point there is no b:syntastic_loclist
+ let loclist = filter(copy(getloclist(0)), 'v:val["valid"] == 1')
+ let owner = str2nr(getbufvar(bufnr(""), 'syntastic_owner_buffer'))
+ let buffers = syntastic#util#unique(map(loclist, 'v:val["bufnr"]') + (owner ? [owner] : []))
+ if !empty(loclist) && empty(filter( buffers, 'syntastic#util#bufIsActive(v:val)' ))
+ call SyntasticLoclistHide()
+ endif
endif
endfunction " }}}2
@@ -223,7 +228,7 @@ function! s:QuitPreHook() " {{{2
call syntastic#log#debug(g:SyntasticDebugAutocommands,
\ 'autocmd: QuitPre, buffer ' . bufnr("") . ' = ' . string(bufname(str2nr(bufnr("")))))
let b:syntastic_skip_checks = !g:syntastic_check_on_wq
- call g:SyntasticLoclistHide()
+ call SyntasticLoclistHide()
endfunction " }}}2
" }}}1
@@ -278,7 +283,7 @@ endfunction " }}}2
"clear the loc list for the buffer
function! s:ClearCache() " {{{2
call s:notifiers.reset(g:SyntasticLoclist.current())
- unlet! b:syntastic_loclist
+ call b:syntastic_loclist.destroy()
endfunction " }}}2
"detect and cache all syntax errors in this buffer
@@ -296,8 +301,8 @@ function! s:CacheErrors(checker_names) " {{{2
" }}}3
let filetypes = s:resolveFiletypes()
- let aggregate_errors = syntastic#util#var('aggregate_errors')
- let decorate_errors = (aggregate_errors || len(filetypes) > 1) && syntastic#util#var('id_checkers')
+ let aggregate_errors = syntastic#util#var('aggregate_errors') || len(filetypes) > 1
+ let decorate_errors = aggregate_errors && syntastic#util#var('id_checkers')
let sort_aggregated_errors = aggregate_errors && syntastic#util#var('sort_aggregated_errors')
let clist = []
@@ -306,8 +311,15 @@ function! s:CacheErrors(checker_names) " {{{2
endfor
let names = []
+ let unavailable_checkers = 0
for checker in clist
let cname = checker.getFiletype() . '/' . checker.getName()
+ if !checker.isAvailable()
+ call syntastic#log#debug(g:SyntasticDebugTrace, 'CacheErrors: Checker ' . cname . ' is not available')
+ let unavailable_checkers += 1
+ continue
+ endif
+
call syntastic#log#debug(g:SyntasticDebugTrace, 'CacheErrors: Invoking checker: ' . cname)
let loclist = checker.getLocList()
@@ -317,6 +329,10 @@ function! s:CacheErrors(checker_names) " {{{2
call loclist.decorate(cname)
endif
call add(names, cname)
+ if checker.getWantSort() && !sort_aggregated_errors
+ call loclist.sort()
+ call syntastic#log#debug(g:SyntasticDebugLoclist, 'sorted:', loclist)
+ endif
let newLoclist = newLoclist.extend(loclist)
@@ -340,7 +356,7 @@ function! s:CacheErrors(checker_names) " {{{2
" }}}3
" issue warning about no active checkers {{{3
- if empty(clist)
+ if len(clist) == unavailable_checkers
if !empty(a:checker_names)
if len(a:checker_names) == 1
call syntastic#log#warn('checker ' . a:checker_names[0] . ' is not available')
@@ -360,7 +376,8 @@ function! s:CacheErrors(checker_names) " {{{2
endif
endif
- let b:syntastic_loclist = newLoclist
+ call newLoclist.setOwner(bufnr(''))
+ call newLoclist.deploy()
endfunction " }}}2
function! s:ToggleMode() " {{{2
@@ -550,6 +567,7 @@ endfunction " }}}2
function! s:uname() " {{{2
if !exists('s:uname')
let s:uname = system('uname')
+ lockvar s:uname
endif
return s:uname
endfunction " }}}2
16 sources_non_forked/syntastic/plugin/syntastic/checker.vim
View
@@ -69,7 +69,6 @@ function! g:SyntasticChecker.getLocListRaw() " {{{2
call self._populateHighlightRegexes(list)
call syntastic#log#debug(g:SyntasticDebugLoclist, name . ' raw:', list)
call self._quietMessages(list)
- call self._sortMessages(list)
return list
endfunction " }}}2
@@ -99,7 +98,10 @@ function! g:SyntasticChecker.makeprgBuild(opts) " {{{2
endfunction " }}}2
function! g:SyntasticChecker.isAvailable() " {{{2
- return self._isAvailableFunc()
+ if !has_key(self, '_available')
+ let self._available = self._isAvailableFunc()
+ endif
+ return self._available
endfunction " }}}2
" }}}1
@@ -131,20 +133,12 @@ function! g:SyntasticChecker._quietMessages(errors) " {{{2
endif
endfunction " }}}2
-function! g:SyntasticChecker._sortMessages(errors) " {{{2
- " don't sort now if we're going to sort the aggregated list later
- if self._sort && !(syntastic#util#var('aggregate_errors') && syntastic#util#var('sort_aggregated_errors'))
- call syntastic#util#sortLoclist(a:errors)
- call syntastic#log#debug(g:SyntasticDebugLoclist, 'sorted:', a:errors)
- endif
-endfunction " }}}2
-
function! g:SyntasticChecker._populateHighlightRegexes(errors) " {{{2
if has_key(self, '_highlightRegexFunc')
for e in a:errors
if e['valid']
let term = self._highlightRegexFunc(e)
- if len(term) > 0
+ if term != ''
let e['hl'] = term
endif
endif
4 sources_non_forked/syntastic/plugin/syntastic/cursor.vim
View
@@ -22,7 +22,7 @@ function! g:SyntasticCursorNotifier.refresh(loclist) " {{{2
let b:syntastic_messages = copy(a:loclist.messages(bufnr('')))
let b:oldLine = -1
autocmd! syntastic CursorMoved
- autocmd syntastic CursorMoved * call g:SyntasticRefreshCursor()
+ autocmd syntastic CursorMoved * call SyntasticRefreshCursor()
endif
endfunction " }}}2
@@ -40,7 +40,7 @@ endfunction " }}}2
" Private methods {{{1
" The following defensive nonsense is needed because of the nature of autocmd
-function! g:SyntasticRefreshCursor() " {{{2
+function! SyntasticRefreshCursor() " {{{2
if !exists('b:syntastic_messages') || empty(b:syntastic_messages)
" file not checked
return
11 sources_non_forked/syntastic/plugin/syntastic/highlighting.vim
View
@@ -5,6 +5,7 @@ let g:loaded_syntastic_notifier_highlighting = 1
" Highlighting requires getmatches introduced in 7.1.040
let s:has_highlighting = v:version > 701 || (v:version == 701 && has('patch040'))
+lockvar s:has_highlighting
let g:SyntasticHighlightingNotifier = {}
@@ -18,6 +19,7 @@ function! g:SyntasticHighlightingNotifier.New() " {{{2
if !s:setup_done
call self._setup()
let s:setup_done = 1
+ lockvar s:setup_done
endif
return newObj
@@ -35,7 +37,7 @@ function! g:SyntasticHighlightingNotifier.refresh(loclist) " {{{2