1
0
Fork 0
mirror of synced 2024-12-30 10:29:25 -05:00

Updated plugins

This commit is contained in:
amix 2017-07-16 14:28:30 +02:00
parent 391f8b5c06
commit a0996d8224
15 changed files with 130 additions and 66 deletions

View file

@ -59,7 +59,7 @@ Installation
git clone https://github.com/scrooloose/nerdtree.git ~/.vim/bundle/nerdtree 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) #### [apt-vim](https://github.com/egalpin/apt-vim)

View file

@ -404,13 +404,27 @@ function! s:jumpToLastChild(node)
endfunction endfunction
" FUNCTION: s:jumpToParent(node) {{{1 " 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) function! s:jumpToParent(node)
if !empty(a:node.parent) let l:parent = a:node.parent
call a:node.parent.putCursorHere(1, 0)
" 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() call b:NERDTree.ui.centerView()
else else
call nerdtree#echo("cannot jump to parent") call nerdtree#echo('could not jump to parent node')
endif endif
endfunction endfunction

View file

@ -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!

View file

@ -45,9 +45,14 @@ function! s:TreeDirNode.addChild(treenode, inOrder)
endfunction endfunction
" FUNCTION: TreeDirNode.close() {{{1 " FUNCTION: TreeDirNode.close() {{{1
" Closes this directory " Mark this TreeDirNode as closed.
function! s:TreeDirNode.close() 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 endfunction
" FUNCTION: TreeDirNode.closeChildren() {{{1 " FUNCTION: TreeDirNode.closeChildren() {{{1
@ -78,19 +83,29 @@ function! s:TreeDirNode.createChild(path, inOrder)
endfunction endfunction
" FUNCTION: TreeDirNode.displayString() {{{1 " 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() function! s:TreeDirNode.displayString()
let cascade = self.getCascade() let l:result = ''
let rv = ""
for node in cascade " Build a label that identifies this TreeDirNode.
let rv = rv . node.path.displayString() let l:label = ''
let l:cascade = self.getCascade()
for l:dirNode in l:cascade
let l:label .= l:dirNode.path.displayString()
endfor 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 endfunction
" FUNCTION: TreeDirNode.findNode(path) {{{1 " FUNCTION: TreeDirNode.findNode(path) {{{1
@ -400,25 +415,39 @@ function! s:TreeDirNode.New(path, nerdtree)
return newTreeNode return newTreeNode
endfunction endfunction
" FUNCTION: TreeDirNode.open([opts]) {{{1 " FUNCTION: TreeDirNode.open([options]) {{{1
" Open the dir in the current tree or in a new tree elsewhere. " Open this directory node in the current tree or elsewhere if special options
" " are provided. Return 0 if options were processed. Otherwise, return the
" If opening in the current tree, return the number of cached nodes. " number of new cached nodes.
unlet s:TreeDirNode.open
function! s:TreeDirNode.open(...) 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']) " If special options were specified, process them and return.
let opener = g:NERDTreeOpener.New(self.path, opts) if has_key(l:options, 'where') && !empty(l:options['where'])
call opener.open(self) let l:opener = g:NERDTreeOpener.New(self.path, l:options)
else call l:opener.open(self)
let self.isOpen = 1 return 0
if self.children ==# []
return self._initChildren(0)
else
return 0
endif
endif 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 endfunction
" FUNCTION: TreeDirNode.openAlong([opts]) {{{1 " FUNCTION: TreeDirNode.openAlong([opts]) {{{1
@ -463,35 +492,16 @@ function! s:TreeDirNode._openInNewTab()
endfunction endfunction
" FUNCTION: TreeDirNode.openRecursively() {{{1 " FUNCTION: TreeDirNode.openRecursively() {{{1
" Opens this treenode and all of its children whose paths arent 'ignored' " Open this directory node and any descendant directory nodes whose pathnames
" because of the file filters. " are not ignored.
"
" This method is actually a wrapper for the OpenRecursively2 method which does
" the work.
function! s:TreeDirNode.openRecursively() function! s:TreeDirNode.openRecursively()
call self._openRecursively2(1) silent call self.open()
endfunction
" FUNCTION: TreeDirNode._openRecursively2() {{{1 for l:child in self.children
" Opens this all children of this treenode recursively if either: if l:child.path.isDirectory && !l:child.path.ignore(l:child.getNerdtree())
" *they arent filtered by file filters call l:child.openRecursively()
" *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)
endif endif
endfor
for i in self.children
if i.path.isDirectory ==# 1
call i._openRecursively2(0)
endif
endfor
endif
endfunction endfunction
" FUNCTION: TreeDirNode.refresh() {{{1 " FUNCTION: TreeDirNode.refresh() {{{1

View file

@ -2857,7 +2857,9 @@ Checker options~
This checker is initialised using the "makeprgBuild()" function and thus it This checker is initialised using the "makeprgBuild()" function and thus it
accepts the standard options described at |syntastic-config-makeprg|. 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 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' 2.1.0 or later, instead of "ESLint". Just point 'g:syntastic_html_eslint_exec'

View file

@ -19,7 +19,7 @@ if has('reltime')
lockvar! g:_SYNTASTIC_START lockvar! g:_SYNTASTIC_START
endif endif
let g:_SYNTASTIC_VERSION = '3.8.0-60' let g:_SYNTASTIC_VERSION = '3.8.0-63'
lockvar g:_SYNTASTIC_VERSION lockvar g:_SYNTASTIC_VERSION
" Sanity checks {{{1 " Sanity checks {{{1

View file

@ -724,7 +724,7 @@ function! s:Git(bang, args) abort
let git .= ' --no-pager' let git .= ' --no-pager'
endif endif
let args = matchstr(a:args,'\v\C.{-}%($|\\@<!%(\\\\)*\|)@=') let args = matchstr(a:args,'\v\C.{-}%($|\\@<!%(\\\\)*\|)@=')
if exists(':terminal') if exists(':terminal') && has('nvim')
let dir = s:repo().tree() let dir = s:repo().tree()
if expand('%') != '' if expand('%') != ''
-tabedit % -tabedit %

View file

@ -4,3 +4,4 @@ doc/tags
# Test specific files # Test specific files
FAILED FAILED
test.log test.log
scripts/vim-vimhelplint

View file

@ -9,12 +9,15 @@ IMPROVEMENTS
* `:GoBuild` now compiles the package with the `-i` flag added. This means that subsequent calls are much more faster due caching of packages [gh-1330] * `:GoBuild` now compiles the package with the `-i` flag added. This means that subsequent calls are much more faster due caching of packages [gh-1330]
* `:GoCoverage` echos now the progress if `g:go_echo_command_info` is enabled [gh-1333] * `:GoCoverage` echos now the progress if `g:go_echo_command_info` is enabled [gh-1333]
* Add `g:go_doc_max_height` setting to control the maximum height of the window created by `:GoDoc` and `K` mapping [gh-1335] * Add `g:go_doc_max_height` setting to control the maximum height of the window created by `:GoDoc` and `K` mapping [gh-1335]
* The `af` text object is able to include the assignment variable for anonymous functions. Can be disabled with `g:go_textobj_include_variable = 0` [gh-1345]
BUG FIXES: BUG FIXES:
* Fix obtaining package's import path for the current directory. This fixes some issues we had if the user was using multiple GOPATH's [gh-1321] * Fix obtaining package's import path for the current directory. This fixes some issues we had if the user was using multiple GOPATH's [gh-1321]
* Fix documentation for vim-go & syntastic integration for errcheck using [gh-1323] * Fix documentation for vim-go & syntastic integration for errcheck using [gh-1323]
* Fix showing an output if a test has finished when `:GoTest` is called [gh-1327] * Fix showing an output if a test has finished when `:GoTest` is called [gh-1327]
* Fix warning when goimports doesn't support srcdir [gh-1344]
* Fix brokwn code folding with go_highlight_types [gh-1338]
## 1.13 - (June 6, 2017) ## 1.13 - (June 6, 2017)

View file

@ -184,7 +184,7 @@ function! s:fmt_cmd(bin_name, source, target)
if !exists('b:goimports_vendor_compatible') if !exists('b:goimports_vendor_compatible')
let out = go#util#System(bin_path . " --help") let out = go#util#System(bin_path . " --help")
if out !~ "-srcdir" if out !~ "-srcdir"
call go#util#EchoWarning(printf("vim-go: goimports (%s) does not support srcdir. Update with: :GoUpdateBinaries", , bin_path)) call go#util#EchoWarning(printf("vim-go: goimports (%s) does not support srcdir. Update with: :GoUpdateBinaries", bin_path))
else else
let b:goimports_vendor_compatible = 1 let b:goimports_vendor_compatible = 1
endif endif

View file

@ -6,6 +6,10 @@ if !exists("g:go_textobj_include_function_doc")
let g:go_textobj_include_function_doc = 1 let g:go_textobj_include_function_doc = 1
endif endif
if !exists("g:go_textobj_include_variable")
let g:go_textobj_include_variable = 1
endif
" ( ) motions " ( ) motions
" { } motions " { } motions
" s for sentence " s for sentence
@ -60,6 +64,16 @@ function! go#textobj#Function(mode) abort
" want's to include doc comments for function declarations " want's to include doc comments for function declarations
if has_key(info, 'doc') && g:go_textobj_include_function_doc if has_key(info, 'doc') && g:go_textobj_include_function_doc
call cursor(info.doc.line, info.doc.col) call cursor(info.doc.line, info.doc.col)
elseif info['sig']['name'] == '' && g:go_textobj_include_variable
" one liner anonymous functions
if info.lbrace.line == info.rbrace.line
" jump to first nonblack char, to get the correct column
call cursor(info.lbrace.line, 0 )
normal! ^
call cursor(info.func.line, col("."))
else
call cursor(info.func.line, info.rbrace.col)
endif
else else
call cursor(info.func.line, info.func.col) call cursor(info.func.line, info.func.col)
endif endif

View file

@ -690,8 +690,8 @@ CTRL-t
:GoAddTags xml db :GoAddTags xml db
< <
If [option] is passed it'll either add a new tag with an option or will If [option] is passed it'll either add a new tag with an option or will
modify existing tags. An example of adding `omitempty` to all `json` fields modify existing tags. An example of adding `omitempty` to all `json`
would be: fields would be:
> >
:GoAddTags json,omitempty :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 closing bracket. If |'g:go_textobj_include_function_doc'| is
enabled it also includes the comment doc for a function enabled it also includes the comment doc for a function
declaration. This text-object also supports literal functions. 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* *go-v_if* *go-if*
if "inside a function", select contents of a function, 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. > the `af` text object and `[[` motion. By default it's enabled. >
let g:go_textobj_include_function_doc = 1 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'* *'g:go_metalinter_autosave'*

View file

@ -32,3 +32,14 @@ if [ -f "FAILED" ]; then
exit 1 exit 1
fi fi
echo 2>&1 "PASS" 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

View file

@ -321,7 +321,7 @@ hi def link goField Identifier
" Structs & Interfaces; " Structs & Interfaces;
if g:go_highlight_types != 0 if g:go_highlight_types != 0
syn match goTypeConstructor /\<\w\+{/he=e-1 syn match goTypeConstructor /\<\w\+{\@=/he=e-1
syn match goTypeDecl /\<type\>/ nextgroup=goTypeName skipwhite skipnl syn match goTypeDecl /\<type\>/ nextgroup=goTypeName skipwhite skipnl
syn match goTypeName /\w\+/ contained nextgroup=goDeclType skipwhite skipnl syn match goTypeName /\w\+/ contained nextgroup=goDeclType skipwhite skipnl
syn match goDeclType /\<\(interface\|struct\)\>/ skipwhite skipnl syn match goDeclType /\<\(interface\|struct\)\>/ skipwhite skipnl

View file

@ -80,7 +80,7 @@ snippet et "expect to be truthy (js)"
snippet ef "expect to be falsy (js)" snippet ef "expect to be falsy (js)"
expect(${1:target}).toBeFalsy(); expect(${1:target}).toBeFalsy();
snippet ed "expect to be defined (js)" snippet etbd "expect to be defined (js)"
expect(${1:target}).toBeDefined(); expect(${1:target}).toBeDefined();
snippet eud "expect to be defined (js)" snippet eud "expect to be defined (js)"