Skip to content

Commit

Permalink
Braid: Update mirror 'vim/bundle/nerdtree' to '2504666'
Browse files Browse the repository at this point in the history
  • Loading branch information
brycethornton committed Feb 25, 2011
1 parent 8238b9f commit 5a69011
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 90 deletions.
2 changes: 1 addition & 1 deletion .braids
Expand Up @@ -16,7 +16,7 @@ vim/bundle/git-vim:
vim/bundle/nerdtree:
branch: master
remote: braid/vim/bundle/nerdtree
revision: 7650cdc6621cd15b047dc04605b8b0bc0396564d
revision: 2504666a723c56be9aaa3980dd2ee608fe2a631f
squashed: true
type: git
url: git://github.com/scrooloose/nerdtree.git
Expand Down
4 changes: 2 additions & 2 deletions vim/bundle/nerdtree/nerdtree_plugin/fs_menu.vim
Expand Up @@ -16,8 +16,8 @@ endif
let g:loaded_nerdtree_fs_menu = 1

call NERDTreeAddMenuItem({'text': '(a)dd a childnode', 'shortcut': 'a', 'callback': 'NERDTreeAddNode'})
call NERDTreeAddMenuItem({'text': '(m)ove the curent node', 'shortcut': 'm', 'callback': 'NERDTreeMoveNode'})
call NERDTreeAddMenuItem({'text': '(d)elete the curent node', 'shortcut': 'd', 'callback': 'NERDTreeDeleteNode'})
call NERDTreeAddMenuItem({'text': '(m)ove the current node', 'shortcut': 'm', 'callback': 'NERDTreeMoveNode'})
call NERDTreeAddMenuItem({'text': '(d)elete the current node', 'shortcut': 'd', 'callback': 'NERDTreeDeleteNode'})
if g:NERDTreePath.CopyingSupported()
call NERDTreeAddMenuItem({'text': '(c)copy the current node', 'shortcut': 'c', 'callback': 'NERDTreeCopyNode'})
endif
Expand Down
174 changes: 87 additions & 87 deletions vim/bundle/nerdtree/plugin/NERD_tree.vim
Expand Up @@ -142,7 +142,7 @@ call s:initVariable("g:NERDTreeMapUpdirKeepOpen", "U")
if s:running_windows
let s:escape_chars = " `\|\"#%&,?()\*^<>"
else
let s:escape_chars = " \\`\|\"#%&,?()\*^<>"
let s:escape_chars = " \\`\|\"#%&,?()\*^<>[]"
endif
let s:NERDTreeBufName = 'NERD_tree_'

Expand Down Expand Up @@ -373,7 +373,7 @@ endfunction
" FUNCTION: Bookmark.New(name, path) {{{3
" Create a new bookmark object with the given name and path object
function! s:Bookmark.New(name, path)
if a:name =~ ' '
if a:name =~# ' '
throw "NERDTree.IllegalBookmarkNameError: illegal name:" . a:name
endif

Expand All @@ -390,7 +390,7 @@ function! s:Bookmark.openInNewTab(options)
tabnew
call s:initNerdTree(self.name)
else
exec "tabedit " . bookmark.path.str({'format': 'Edit'})
exec "tabedit " . self.path.str({'format': 'Edit'})
endif

if has_key(a:options, 'stayInCurrentTab')
Expand Down Expand Up @@ -1037,7 +1037,7 @@ endfunction
"gets the line number of the root node
function! s:TreeFileNode.GetRootLineNum()
let rootLine = 1
while getline(rootLine) !~ '^\(/\|<\)'
while getline(rootLine) !~# '^\(/\|<\)'
let rootLine = rootLine + 1
endwhile
return rootLine
Expand Down Expand Up @@ -1602,7 +1602,7 @@ function! s:TreeDirNode._initChildren(silent)
"filter out the .. and . directories
"Note: we must match .. AND ../ cos sometimes the globpath returns
"../ for path with strange chars (eg $)
if i !~ '\/\.\.\/\?$' && i !~ '\/\.\/\?$'
if i !~# '\/\.\.\/\?$' && i !~# '\/\.\/\?$'

"put the next file in a new node and attach it
try
Expand Down Expand Up @@ -1739,7 +1739,7 @@ function! s:TreeDirNode.refresh()
"filter out the .. and . directories
"Note: we must match .. AND ../ cos sometimes the globpath returns
"../ for path with strange chars (eg $)
if i !~ '\/\.\.\/\?$' && i !~ '\/\.\/\?$'
if i !~# '\/\.\.\/\?$' && i !~# '\/\.\/\?$'

try
"create a new path and see if it exists in this nodes children
Expand Down Expand Up @@ -1861,9 +1861,9 @@ let s:Path = {}
function! s:Path.AbsolutePathFor(str)
let prependCWD = 0
if s:running_windows
let prependCWD = a:str !~ '^.:\(\\\|\/\)'
let prependCWD = a:str !~# '^.:\(\\\|\/\)'
else
let prependCWD = a:str !~ '^/'
let prependCWD = a:str !~# '^/'
endif

let toReturn = a:str
Expand Down Expand Up @@ -1980,7 +1980,7 @@ function! s:Path.Create(fullpath)
try

"if it ends with a slash, assume its a dir create it
if a:fullpath =~ '\(\\\|\/\)$'
if a:fullpath =~# '\(\\\|\/\)$'
"whack the trailing slash off the end if it exists
let fullpath = substitute(a:fullpath, '\(\\\|\/\)$', '', '')

Expand Down Expand Up @@ -2153,7 +2153,7 @@ endfunction
function! s:Path.getSortOrderIndex()
let i = 0
while i < len(g:NERDTreeSortOrder)
if self.getLastPathComponent(1) =~ g:NERDTreeSortOrder[i]
if self.getLastPathComponent(1) =~# g:NERDTreeSortOrder[i]
return i
endif
let i = i + 1
Expand All @@ -2169,14 +2169,14 @@ function! s:Path.ignore()
"filter out the user specified paths to ignore
if b:NERDTreeIgnoreEnabled
for i in g:NERDTreeIgnore
if lastPathComponent =~ i
if lastPathComponent =~# i
return 1
endif
endfor
endif

"dont show hidden files unless instructed to
if b:NERDTreeShowHidden ==# 0 && lastPathComponent =~ '^\.'
if b:NERDTreeShowHidden ==# 0 && lastPathComponent =~# '^\.'
return 1
endif

Expand Down Expand Up @@ -2266,7 +2266,7 @@ function! s:Path.readInfoFromDisk(fullpath)

let self.isExecutable = 0
if !self.isDirectory
let self.isExecutable = getfperm(a:fullpath) =~ 'x'
let self.isExecutable = getfperm(a:fullpath) =~# 'x'
endif

"grab the last part of the path (minus the trailing slash)
Expand All @@ -2285,7 +2285,7 @@ function! s:Path.readInfoFromDisk(fullpath)

"we always wanna treat MS windows shortcuts as files for
"simplicity
if hardPath !~ '\.lnk$'
if hardPath !~# '\.lnk$'

let self.symLinkDest = self.symLinkDest . '/'
endif
Expand Down Expand Up @@ -2517,7 +2517,7 @@ endfunction
" FUNCTION: s:completeBookmarks(A,L,P) {{{2
" completion function for the bookmark commands
function! s:completeBookmarks(A,L,P)
return filter(s:Bookmark.BookmarkNames(), 'v:val =~ "^' . a:A . '"')
return filter(s:Bookmark.BookmarkNames(), 'v:val =~# "^' . a:A . '"')
endfunction
" FUNCTION: s:exec(cmd) {{{2
" same as :exec cmd but eventignore=all is set for the duration
Expand Down Expand Up @@ -2564,7 +2564,7 @@ function! s:initNerdTree(name)
let dir = a:name ==# '' ? getcwd() : a:name

"hack to get an absolute path if a relative path is given
if dir =~ '^\.'
if dir =~# '^\.'
let dir = getcwd() . s:Path.Slash() . dir
endif
let dir = resolve(dir)
Expand Down Expand Up @@ -3068,7 +3068,7 @@ function! s:getPath(ln)
endif

" in case called from outside the tree
if line !~ '^ *[|`]' || line =~ '^$'
if line !~# '^ *[|`]' || line =~# '^$'
return {}
endif

Expand All @@ -3082,7 +3082,7 @@ function! s:getPath(ln)
let curFile = s:stripMarkupFromLine(line, 0)

let wasdir = 0
if curFile =~ '/$'
if curFile =~# '/$'
let wasdir = 1
let curFile = substitute(curFile, '/\?$', '/', "")
endif
Expand All @@ -3099,7 +3099,7 @@ function! s:getPath(ln)
let dir = b:NERDTreeRoot.path.str({'format': 'UI'}) . dir
break
endif
if curLineStripped =~ '/$'
if curLineStripped =~# '/$'
let lpindent = s:indentLevelFor(curLine)
if lpindent < indent
let indent = indent - 1
Expand Down Expand Up @@ -3218,7 +3218,7 @@ function! s:putCursorOnBookmarkTable()
let rootNodeLine = s:TreeFileNode.GetRootLineNum()

let line = 1
while getline(line) !~ '^>-\+Bookmarks-\+$'
while getline(line) !~# '^>-\+Bookmarks-\+$'
let line = line + 1
if line >= rootNodeLine
throw "NERDTree.BookmarkTableNotFoundError: didnt find the bookmarks table"
Expand Down Expand Up @@ -3365,91 +3365,91 @@ function! s:setupStatusline()
endfunction
"FUNCTION: s:setupSyntaxHighlighting() {{{2
function! s:setupSyntaxHighlighting()
"treeFlags are syntax items that should be invisible, but give clues as to
"NERDTreeFlags are syntax items that should be invisible, but give clues as to
"how things should be highlighted
syn match treeFlag #\~#
syn match treeFlag #\[RO\]#
syn match NERDTreeFlag #\~#
syn match NERDTreeFlag #\[RO\]#

"highlighting for the .. (up dir) line at the top of the tree
execute "syn match treeUp #". s:tree_up_dir_line ."#"
execute "syn match NERDTreeUp #". s:tree_up_dir_line ."#"

"highlighting for the ~/+ symbols for the directory nodes
syn match treeClosable #\~\<#
syn match treeClosable #\~\.#
syn match treeOpenable #+\<#
syn match treeOpenable #+\.#he=e-1
syn match NERDTreeClosable #\~\<#
syn match NERDTreeClosable #\~\.#
syn match NERDTreeOpenable #+\<#
syn match NERDTreeOpenable #+\.#he=e-1

"highlighting for the tree structural parts
syn match treePart #|#
syn match treePart #`#
syn match treePartFile #[|`]-#hs=s+1 contains=treePart
syn match NERDTreePart #|#
syn match NERDTreePart #`#
syn match NERDTreePartFile #[|`]-#hs=s+1 contains=NERDTreePart

"quickhelp syntax elements
syn match treeHelpKey #" \{1,2\}[^ ]*:#hs=s+2,he=e-1
syn match treeHelpKey #" \{1,2\}[^ ]*,#hs=s+2,he=e-1
syn match treeHelpTitle #" .*\~#hs=s+2,he=e-1 contains=treeFlag
syn match treeToggleOn #".*(on)#hs=e-2,he=e-1 contains=treeHelpKey
syn match treeToggleOff #".*(off)#hs=e-3,he=e-1 contains=treeHelpKey
syn match treeHelpCommand #" :.\{-}\>#hs=s+3
syn match treeHelp #^".*# contains=treeHelpKey,treeHelpTitle,treeFlag,treeToggleOff,treeToggleOn,treeHelpCommand
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 NERDTreeHelpCommand #" :.\{-}\>#hs=s+3
syn match NERDTreeHelp #^".*# contains=NERDTreeHelpKey,NERDTreeHelpTitle,NERDTreeFlag,NERDTreeToggleOff,NERDTreeToggleOn,NERDTreeHelpCommand

"highlighting for readonly files
syn match treeRO #.*\[RO\]#hs=s+2 contains=treeFlag,treeBookmark,treePart,treePartFile
syn match NERDTreeRO #.*\[RO\]#hs=s+2 contains=NERDTreeFlag,NERDTreeBookmark,NERDTreePart,NERDTreePartFile

"highlighting for sym links
syn match treeLink #[^-| `].* -> # contains=treeBookmark,treeOpenable,treeClosable,treeDirSlash
syn match NERDTreeLink #[^-| `].* -> # contains=NERDTreeBookmark,NERDTreeOpenable,NERDTreeClosable,NERDTreeDirSlash

"highlighing for directory nodes and file nodes
syn match treeDirSlash #/#
syn match treeDir #[^-| `].*/# contains=treeLink,treeDirSlash,treeOpenable,treeClosable
syn match treeExecFile #[|`]-.*\*\($\| \)# contains=treeLink,treePart,treeRO,treePartFile,treeBookmark
syn match treeFile #|-.*# contains=treeLink,treePart,treeRO,treePartFile,treeBookmark,treeExecFile
syn match treeFile #`-.*# contains=treeLink,treePart,treeRO,treePartFile,treeBookmark,treeExecFile
syn match treeCWD #^/.*$#
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 NERDTreeCWD #^/.*$#

"highlighting for bookmarks
syn match treeBookmark # {.*}#hs=s+1
syn match NERDTreeBookmark # {.*}#hs=s+1

"highlighting for the bookmarks table
syn match treeBookmarksLeader #^>#
syn match treeBookmarksHeader #^>-\+Bookmarks-\+$# contains=treeBookmarksLeader
syn match treeBookmarkName #^>.\{-} #he=e-1 contains=treeBookmarksLeader
syn match treeBookmark #^>.*$# contains=treeBookmarksLeader,treeBookmarkName,treeBookmarksHeader
syn match NERDTreeBookmarksLeader #^>#
syn match NERDTreeBookmarksHeader #^>-\+Bookmarks-\+$# contains=NERDTreeBookmarksLeader
syn match NERDTreeBookmarkName #^>.\{-} #he=e-1 contains=NERDTreeBookmarksLeader
syn match NERDTreeBookmark #^>.*$# contains=NERDTreeBookmarksLeader,NERDTreeBookmarkName,NERDTreeBookmarksHeader

if g:NERDChristmasTree
hi def link treePart Special
hi def link treePartFile Type
hi def link treeFile Normal
hi def link treeExecFile Title
hi def link treeDirSlash Identifier
hi def link treeClosable Type
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 treePart Normal
hi def link treePartFile Normal
hi def link treeFile Normal
hi def link treeClosable Title
endif

hi def link treeBookmarksHeader statement
hi def link treeBookmarksLeader ignore
hi def link treeBookmarkName Identifier
hi def link treeBookmark normal

hi def link treeHelp String
hi def link treeHelpKey Identifier
hi def link treeHelpCommand Identifier
hi def link treeHelpTitle Macro
hi def link treeToggleOn Question
hi def link treeToggleOff WarningMsg

hi def link treeDir Directory
hi def link treeUp Directory
hi def link treeCWD Statement
hi def link treeLink Macro
hi def link treeOpenable Title
hi def link treeFlag ignore
hi def link treeRO WarningMsg
hi def link treeBookmark Statement
hi def link NERDTreePart Normal
hi def link NERDTreePartFile Normal
hi def link NERDTreeFile Normal
hi def link NERDTreeClosable Title
endif

hi def link NERDTreeBookmarksHeader statement
hi def link NERDTreeBookmarksLeader ignore
hi def link NERDTreeBookmarkName Identifier
hi def link NERDTreeBookmark normal

hi def link NERDTreeHelp String
hi def link NERDTreeHelpKey Identifier
hi def link NERDTreeHelpCommand Identifier
hi def link NERDTreeHelpTitle Macro
hi def link NERDTreeToggleOn Question
hi def link NERDTreeToggleOff WarningMsg

hi def link NERDTreeDir Directory
hi def link NERDTreeUp Directory
hi def link NERDTreeCWD Statement
hi def link NERDTreeLink Macro
hi def link NERDTreeOpenable Title
hi def link NERDTreeFlag ignore
hi def link NERDTreeRO WarningMsg
hi def link NERDTreeBookmark Statement

hi def link NERDTreeCurrentNode Search
endfunction
Expand All @@ -3476,7 +3476,7 @@ function! s:stripMarkupFromLine(line, removeLeadingSpaces)
let line = substitute (line, '*\ze\($\| \)', "","")

let wasdir = 0
if line =~ '/$'
if line =~# '/$'
let wasdir = 1
endif
let line = substitute (line,' -> .*',"","") " remove link to
Expand Down Expand Up @@ -3634,14 +3634,14 @@ function! s:checkForActivate()
"if they clicked a dir, check if they clicked on the + or ~ sign
"beside it
if currentNode.path.isDirectory
if startToCur =~ s:tree_markup_reg . '$' && char =~ '[+~]'
if startToCur =~# s:tree_markup_reg . '$' && char =~# '[+~]'
call s:activateNode(0)
return
endif
endif

if (g:NERDTreeMouseMode ==# 2 && currentNode.path.isDirectory) || g:NERDTreeMouseMode ==# 3
if char !~ s:tree_markup_reg && startToCur !~ '\/$'
if char !~# s:tree_markup_reg && startToCur !~# '\/$'
call s:activateNode(0)
return
endif
Expand Down Expand Up @@ -4041,7 +4041,7 @@ endfunction
"re-rendered
function! s:upDir(keepState)
let cwd = b:NERDTreeRoot.path.str({'format': 'UI'})
if cwd ==# "/" || cwd =~ '^[^/]..$'
if cwd ==# "/" || cwd =~# '^[^/]..$'
call s:echo("already at top dir")
else
if !a:keepState
Expand Down

0 comments on commit 5a69011

Please sign in to comment.