From a0996d8224af4d666c39507b498d77d613092b94 Mon Sep 17 00:00:00 2001 From: amix Date: Sun, 16 Jul 2017 14:28:30 +0200 Subject: [PATCH] Updated plugins --- sources_non_forked/nerdtree/README.markdown | 2 +- .../nerdtree/autoload/nerdtree/ui_glue.vim | 22 +++- .../doc/{NERD_tree.txt => NERDTree.txt} | 2 +- .../nerdtree/lib/nerdtree/tree_dir_node.vim | 114 ++++++++++-------- .../syntastic/doc/syntastic-checkers.txt | 4 +- .../syntastic/plugin/syntastic.vim | 2 +- .../vim-fugitive/plugin/fugitive.vim | 2 +- sources_non_forked/vim-go/.gitignore | 1 + sources_non_forked/vim-go/CHANGELOG.md | 3 + sources_non_forked/vim-go/autoload/go/fmt.vim | 2 +- .../vim-go/autoload/go/textobj.vim | 14 +++ sources_non_forked/vim-go/doc/vim-go.txt | 13 +- sources_non_forked/vim-go/scripts/test.sh | 11 ++ sources_non_forked/vim-go/syntax/go.vim | 2 +- .../javascript/javascript-jasmine.snippets | 2 +- 15 files changed, 130 insertions(+), 66 deletions(-) rename sources_non_forked/nerdtree/doc/{NERD_tree.txt => NERDTree.txt} (99%) diff --git a/sources_non_forked/nerdtree/README.markdown b/sources_non_forked/nerdtree/README.markdown index 19b841bc..48d216b9 100644 --- a/sources_non_forked/nerdtree/README.markdown +++ b/sources_non_forked/nerdtree/README.markdown @@ -59,7 +59,7 @@ Installation git clone https://github.com/scrooloose/nerdtree.git ~/.vim/bundle/nerdtree -Then reload vim, run `:helptags ~/.vim/bundle/nerdtree/doc/`, and check out `:help NERD_tree.txt`. +Then reload Vim, run `:helptags ~/.vim/bundle/nerdtree/doc/`, and check out `:help NERDTree.txt`. #### [apt-vim](https://github.com/egalpin/apt-vim) diff --git a/sources_non_forked/nerdtree/autoload/nerdtree/ui_glue.vim b/sources_non_forked/nerdtree/autoload/nerdtree/ui_glue.vim index 90ce872c..2d94fd9a 100644 --- a/sources_non_forked/nerdtree/autoload/nerdtree/ui_glue.vim +++ b/sources_non_forked/nerdtree/autoload/nerdtree/ui_glue.vim @@ -404,13 +404,27 @@ function! s:jumpToLastChild(node) endfunction " FUNCTION: s:jumpToParent(node) {{{1 -" moves the cursor to the parent of the current node +" Move the cursor to the parent of the specified node. For a cascade, move to +" the parent of the cascade's highest node. At the root, do nothing. function! s:jumpToParent(node) - if !empty(a:node.parent) - call a:node.parent.putCursorHere(1, 0) + let l:parent = a:node.parent + + " If "a:node" represents a directory, back out of its cascade. + if a:node.path.isDirectory + while !empty(l:parent) && !l:parent.isRoot() + if index(l:parent.getCascade(), a:node) >= 0 + let l:parent = l:parent.parent + else + break + endif + endwhile + endif + + if !empty(l:parent) + call l:parent.putCursorHere(1, 0) call b:NERDTree.ui.centerView() else - call nerdtree#echo("cannot jump to parent") + call nerdtree#echo('could not jump to parent node') endif endfunction diff --git a/sources_non_forked/nerdtree/doc/NERD_tree.txt b/sources_non_forked/nerdtree/doc/NERDTree.txt similarity index 99% rename from sources_non_forked/nerdtree/doc/NERD_tree.txt rename to sources_non_forked/nerdtree/doc/NERDTree.txt index 427e90c7..f68880cd 100644 --- a/sources_non_forked/nerdtree/doc/NERD_tree.txt +++ b/sources_non_forked/nerdtree/doc/NERDTree.txt @@ -1,4 +1,4 @@ -*NERD_tree.txt* A tree explorer plugin that owns your momma! +*NERDTree.txt* A tree explorer plugin that owns your momma! diff --git a/sources_non_forked/nerdtree/lib/nerdtree/tree_dir_node.vim b/sources_non_forked/nerdtree/lib/nerdtree/tree_dir_node.vim index 61f72e4a..5ca94d4f 100644 --- a/sources_non_forked/nerdtree/lib/nerdtree/tree_dir_node.vim +++ b/sources_non_forked/nerdtree/lib/nerdtree/tree_dir_node.vim @@ -45,9 +45,14 @@ function! s:TreeDirNode.addChild(treenode, inOrder) endfunction " FUNCTION: TreeDirNode.close() {{{1 -" Closes this directory +" Mark this TreeDirNode as closed. function! s:TreeDirNode.close() - let self.isOpen = 0 + + " Close all directories in this directory node's cascade. This is + " necessary to ensure consistency when cascades are rendered. + for l:dirNode in self.getCascade() + let l:dirNode.isOpen = 0 + endfor endfunction " FUNCTION: TreeDirNode.closeChildren() {{{1 @@ -78,19 +83,29 @@ function! s:TreeDirNode.createChild(path, inOrder) endfunction " FUNCTION: TreeDirNode.displayString() {{{1 -unlet s:TreeDirNode.displayString +" Assemble and return a string that can represent this TreeDirNode object in +" the NERDTree window. function! s:TreeDirNode.displayString() - let cascade = self.getCascade() - let rv = "" - for node in cascade - let rv = rv . node.path.displayString() + let l:result = '' + + " Build a label that identifies this TreeDirNode. + let l:label = '' + let l:cascade = self.getCascade() + for l:dirNode in l:cascade + let l:label .= l:dirNode.path.displayString() endfor - let sym = cascade[-1].isOpen ? g:NERDTreeDirArrowCollapsible : g:NERDTreeDirArrowExpandable + " Select the appropriate open/closed status indicator symbol. + if l:cascade[-1].isOpen + let l:symbol = g:NERDTreeDirArrowCollapsible + else + let l:symbol = g:NERDTreeDirArrowExpandable + endif - let flags = cascade[-1].path.flagSet.renderToString() + let l:flags = l:cascade[-1].path.flagSet.renderToString() - return sym . ' ' . flags . rv + let l:result = l:symbol . ' ' . l:flags . l:label + return l:result endfunction " FUNCTION: TreeDirNode.findNode(path) {{{1 @@ -400,25 +415,39 @@ function! s:TreeDirNode.New(path, nerdtree) return newTreeNode endfunction -" FUNCTION: TreeDirNode.open([opts]) {{{1 -" Open the dir in the current tree or in a new tree elsewhere. -" -" If opening in the current tree, return the number of cached nodes. -unlet s:TreeDirNode.open +" FUNCTION: TreeDirNode.open([options]) {{{1 +" Open this directory node in the current tree or elsewhere if special options +" are provided. Return 0 if options were processed. Otherwise, return the +" number of new cached nodes. function! s:TreeDirNode.open(...) - let opts = a:0 ? a:1 : {} + let l:options = a:0 ? a:1 : {} - if has_key(opts, 'where') && !empty(opts['where']) - let opener = g:NERDTreeOpener.New(self.path, opts) - call opener.open(self) - else - let self.isOpen = 1 - if self.children ==# [] - return self._initChildren(0) - else - return 0 - endif + " If special options were specified, process them and return. + if has_key(l:options, 'where') && !empty(l:options['where']) + let l:opener = g:NERDTreeOpener.New(self.path, l:options) + call l:opener.open(self) + return 0 endif + + " Open any ancestors of this node that render within the same cascade. + let l:parent = self.parent + while !empty(l:parent) && !l:parent.isRoot() + if index(l:parent.getCascade(), self) >= 0 + let l:parent.isOpen = 1 + let l:parent = l:parent.parent + else + break + endif + endwhile + + let self.isOpen = 1 + + let l:numChildrenCached = 0 + if empty(self.children) + let l:numChildrenCached = self._initChildren(0) + endif + + return l:numChildrenCached endfunction " FUNCTION: TreeDirNode.openAlong([opts]) {{{1 @@ -463,35 +492,16 @@ function! s:TreeDirNode._openInNewTab() endfunction " FUNCTION: TreeDirNode.openRecursively() {{{1 -" Opens this treenode and all of its children whose paths arent 'ignored' -" because of the file filters. -" -" This method is actually a wrapper for the OpenRecursively2 method which does -" the work. +" Open this directory node and any descendant directory nodes whose pathnames +" are not ignored. function! s:TreeDirNode.openRecursively() - call self._openRecursively2(1) -endfunction + silent call self.open() -" FUNCTION: TreeDirNode._openRecursively2() {{{1 -" Opens this all children of this treenode recursively if either: -" *they arent filtered by file filters -" *a:forceOpen is 1 -" -" Args: -" forceOpen: 1 if this node should be opened regardless of file filters -function! s:TreeDirNode._openRecursively2(forceOpen) - if self.path.ignore(self.getNerdtree()) ==# 0 || a:forceOpen - let self.isOpen = 1 - if self.children ==# [] - call self._initChildren(1) + for l:child in self.children + if l:child.path.isDirectory && !l:child.path.ignore(l:child.getNerdtree()) + call l:child.openRecursively() endif - - for i in self.children - if i.path.isDirectory ==# 1 - call i._openRecursively2(0) - endif - endfor - endif + endfor endfunction " FUNCTION: TreeDirNode.refresh() {{{1 diff --git a/sources_non_forked/syntastic/doc/syntastic-checkers.txt b/sources_non_forked/syntastic/doc/syntastic-checkers.txt index e4d7b15e..c8fac05e 100644 --- a/sources_non_forked/syntastic/doc/syntastic-checkers.txt +++ b/sources_non_forked/syntastic/doc/syntastic-checkers.txt @@ -2857,7 +2857,9 @@ Checker options~ This checker is initialised using the "makeprgBuild()" function and thus it accepts the standard options described at |syntastic-config-makeprg|. -Note~ +Notes~ + +Automatically fixing errors (option "--fix") is not supported. You can also use "eslint_d" (https://github.com/mantoni/eslint_d.js), version 2.1.0 or later, instead of "ESLint". Just point 'g:syntastic_html_eslint_exec' diff --git a/sources_non_forked/syntastic/plugin/syntastic.vim b/sources_non_forked/syntastic/plugin/syntastic.vim index 67dc0d93..5c1b1e74 100644 --- a/sources_non_forked/syntastic/plugin/syntastic.vim +++ b/sources_non_forked/syntastic/plugin/syntastic.vim @@ -19,7 +19,7 @@ if has('reltime') lockvar! g:_SYNTASTIC_START endif -let g:_SYNTASTIC_VERSION = '3.8.0-60' +let g:_SYNTASTIC_VERSION = '3.8.0-63' lockvar g:_SYNTASTIC_VERSION " Sanity checks {{{1 diff --git a/sources_non_forked/vim-fugitive/plugin/fugitive.vim b/sources_non_forked/vim-fugitive/plugin/fugitive.vim index fba368dd..de10198b 100644 --- a/sources_non_forked/vim-fugitive/plugin/fugitive.vim +++ b/sources_non_forked/vim-fugitive/plugin/fugitive.vim @@ -724,7 +724,7 @@ function! s:Git(bang, args) abort let git .= ' --no-pager' endif let args = matchstr(a:args,'\v\C.{-}%($|\\@ :GoAddTags json,omitempty < @@ -981,6 +981,8 @@ af "a function", select contents from a function definition to the closing bracket. If |'g:go_textobj_include_function_doc'| is enabled it also includes the comment doc for a function declaration. This text-object also supports literal functions. + If |'g:go_textobj_include_variable'| is enabled it also + includes the variable of an function assignment *go-v_if* *go-if* if "inside a function", select contents of a function, @@ -1348,6 +1350,13 @@ Consider the comment above a function to be part of the function when using the `af` text object and `[[` motion. By default it's enabled. > let g:go_textobj_include_function_doc = 1 +< + *'g:go_textobj_include_variable'* + +Consider the variable of an function assignment to be part of the anonymous +function when using the `af` text object. By default it's enabled. > + + let g:go_textobj_include_variable = 1 < *'g:go_metalinter_autosave'* diff --git a/sources_non_forked/vim-go/scripts/test.sh b/sources_non_forked/vim-go/scripts/test.sh index 7c913ab8..ccd1b6ba 100644 --- a/sources_non_forked/vim-go/scripts/test.sh +++ b/sources_non_forked/vim-go/scripts/test.sh @@ -32,3 +32,14 @@ if [ -f "FAILED" ]; then exit 1 fi echo 2>&1 "PASS" + +# Run vimhelplint +[ -d vim-vimhelplint ] || git clone https://github.com/machakann/vim-vimhelplint +echo "Running vimhelplint" +lint=$(vim -esN --cmd 'set rtp+=./vim-vimhelplint' -c 'filetype plugin on' \ + -c 'e ../doc/vim-go.txt' -c 'verb VimhelpLintEcho' -c q 2>&1) +if [ -n "$lint" ]; then + exit 1 +else + exit 0 +fi diff --git a/sources_non_forked/vim-go/syntax/go.vim b/sources_non_forked/vim-go/syntax/go.vim index 83f6e8ff..187ba67c 100644 --- a/sources_non_forked/vim-go/syntax/go.vim +++ b/sources_non_forked/vim-go/syntax/go.vim @@ -321,7 +321,7 @@ hi def link goField Identifier " Structs & Interfaces; if g:go_highlight_types != 0 - syn match goTypeConstructor /\<\w\+{/he=e-1 + syn match goTypeConstructor /\<\w\+{\@=/he=e-1 syn match goTypeDecl /\/ nextgroup=goTypeName skipwhite skipnl syn match goTypeName /\w\+/ contained nextgroup=goDeclType skipwhite skipnl syn match goDeclType /\<\(interface\|struct\)\>/ skipwhite skipnl diff --git a/sources_non_forked/vim-snippets/snippets/javascript/javascript-jasmine.snippets b/sources_non_forked/vim-snippets/snippets/javascript/javascript-jasmine.snippets index 7045c5f7..8cae81a3 100644 --- a/sources_non_forked/vim-snippets/snippets/javascript/javascript-jasmine.snippets +++ b/sources_non_forked/vim-snippets/snippets/javascript/javascript-jasmine.snippets @@ -80,7 +80,7 @@ snippet et "expect to be truthy (js)" snippet ef "expect to be falsy (js)" expect(${1:target}).toBeFalsy(); -snippet ed "expect to be defined (js)" +snippet etbd "expect to be defined (js)" expect(${1:target}).toBeDefined(); snippet eud "expect to be defined (js)"