1
0
mirror of https://github.com/amix/vimrc synced 2025-06-16 09:35:01 +08:00

plugins update

This commit is contained in:
Geezus
2019-05-16 14:48:47 -05:00
parent 5bc3d0226c
commit 555992dd9b
162 changed files with 3534 additions and 1379 deletions

View File

@ -10,6 +10,29 @@ endfunction
" SECTION: General Functions {{{1
"============================================================
"FUNCTION: nerdtree#and(x,y) {{{2
" Implements and() function for Vim <= 7.2
function! nerdtree#and(x,y)
if exists("*and")
return and(a:x, a:y)
else
let l:x = a:x
let l:y = a:y
let l:n = 0
let l:result = 0
while l:x > 0 && l:y > 0
if (l:x % 2) && (l:y % 2)
let l:result += float2nr(pow(2, l:n))
endif
echomsg l:x . ", " . l:y . " => " l:result
let l:x = float2nr(l:x / 2)
let l:y = float2nr(l:y / 2)
let l:n += 1
endwhile
return l:result
endif
endfunction
"FUNCTION: nerdtree#checkForBrowse(dir) {{{2
"inits a window tree in the current buffer if appropriate
function! nerdtree#checkForBrowse(dir)
@ -169,7 +192,7 @@ endfunction
"msg: the message to echo
function! nerdtree#echo(msg)
redraw
echomsg "NERDTree: " . a:msg
echomsg empty(a:msg) ? "" : ("NERDTree: " . a:msg)
endfunction
"FUNCTION: nerdtree#echoError {{{2

View File

@ -492,7 +492,7 @@ function! s:openNodeRecursively(node)
call nerdtree#echo("Recursively opening node. Please wait...")
call a:node.openRecursively()
call b:NERDTree.render()
redraw!
call nerdtree#echo("")
endfunction
" FUNCTION: s:previewBookmark(bookmark) {{{1
@ -543,8 +543,9 @@ function! s:refreshRoot()
call nerdtree#exec(g:NERDTree.GetWinNum() . "wincmd w")
call b:NERDTree.root.refresh()
call b:NERDTree.render()
redraw!
redraw
call nerdtree#exec(l:curWin . "wincmd w")
call nerdtree#echo("")
endfunction
" FUNCTION: s:refreshCurrent(node) {{{1
@ -558,7 +559,7 @@ function! s:refreshCurrent(node)
call nerdtree#echo("Refreshing node. This could take a while...")
call node.refresh()
call b:NERDTree.render()
redraw!
call nerdtree#echo("")
endfunction
" FUNCTION: nerdtree#ui_glue#setupCommands() {{{1

View File

@ -256,7 +256,7 @@ endfunction
function! s:Bookmark.open(nerdtree, ...)
let opts = a:0 ? a:1 : {}
if and(g:NERDTreeQuitOnOpen,2)
if nerdtree#and(g:NERDTreeQuitOnOpen,2)
call a:nerdtree.ui.toggleShowBookmarks()
endif

View File

@ -66,7 +66,7 @@ endfunction
"FUNCTION: s:NERDTree.CloseIfQuitOnOpen() {{{1
"Closes the NERD tree window if the close on open option is set
function! s:NERDTree.CloseIfQuitOnOpen()
if and(g:NERDTreeQuitOnOpen,1) && s:NERDTree.IsOpen()
if nerdtree#and(g:NERDTreeQuitOnOpen,1) && s:NERDTree.IsOpen()
call s:NERDTree.Close()
endif
endfunction

View File

@ -432,7 +432,7 @@ function! s:TreeDirNode._initChildren(silent)
call self.sortChildren()
redraw!
call nerdtree#echo("")
if invalidFilesFound
call nerdtree#echoWarning(invalidFilesFound . " file(s) could not be loaded into the NERD tree")

View File

@ -280,11 +280,10 @@ endfunction
" FUNCTION: s:UI._indentLevelFor(line) {{{1
function! s:UI._indentLevelFor(line)
" have to do this work around because match() returns bytes, not chars
let numLeadBytes = match(a:line, '\M\[^ '.g:NERDTreeDirArrowExpandable.g:NERDTreeDirArrowCollapsible.']')
" The next line is a backward-compatible workaround for strchars(a:line(0:numLeadBytes-1]). strchars() is in 7.3+
let leadChars = len(split(a:line[0:numLeadBytes-1], '\zs'))
" Replace multi-character DirArrows with a single space so the
" indentation calculation doesn't get messed up.
let l:line = substitute(substitute(a:line, '\V'.g:NERDTreeDirArrowExpandable, ' ', ''), '\V'.g:NERDTreeDirArrowCollapsible, ' ', '')
let leadChars = match(l:line, '\M\[^ ]')
return leadChars / s:UI.IndentWid()
endfunction

View File

@ -14,8 +14,8 @@
if exists("loaded_nerd_tree")
finish
endif
if v:version < 700
echoerr "NERDTree: this plugin requires vim >= 7. DOWNLOAD IT! You'll thank me later!"
if v:version < 703
echoerr "NERDTree: this plugin requires vim >= 7.3. DOWNLOAD IT! You'll thank me later!"
finish
endif
let loaded_nerd_tree = 1
@ -77,6 +77,7 @@ else
call s:initVariable("g:NERDTreeDirArrowExpandable", "+")
call s:initVariable("g:NERDTreeDirArrowCollapsible", "~")
endif
call s:initVariable("g:NERDTreeCascadeOpenSingleChildDir", 1)
call s:initVariable("g:NERDTreeCascadeSingleChildDir", 1)