Changeset 9851733a8b4fa681f1256b8cdb3007f5cfa15619


Ignore:
Timestamp:
11/14/11 14:07:59 (6 months ago)
Author:
Luper Rouch <luper.rouch@…>
Children:
3981b13d03c192281eebfa9c40d26809e52a3426
Parents:
cffa83966a2fc1701263eaa7c21c658a8150c7ac
git-committer:
Luper Rouch <luper.rouch@…> (11/14/11 14:07:59)
Message:

updated nerdtree

Location:
various/config/dot-vim
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • various/config/dot-vim/doc/NERD_tree.txt

    rf819d8b r9851733  
    643643                                opened. 
    644644 
     645|'NERDTreeMinimalUI'|           Disables display of the 'Bookmarks' label and  
     646                                'Press ? for help' text. 
     647 
     648|'NERDTreeDirArrows'|           Tells the NERD tree to use arrows instead of 
     649                                + ~ chars when displaying directories. 
     650 
    645651------------------------------------------------------------------------------ 
    6466523.2. Customisation details                             *NERDTreeOptionDetails* 
     
    922928This option is used to change the size of the NERD tree when it is loaded. 
    923929 
     930------------------------------------------------------------------------------ 
     931                                                         *'NERDTreeMinimalUI'* 
     932Values: 0 or 1 
     933Default: 0 
     934 
     935This options disables the 'Bookmarks' label 'Press ? for help' text. Use one 
     936of the following lines to set this option: > 
     937    let NERDTreeMinimalUI=0 
     938    let NERDTreeMinimalUI=1 
     939< 
     940 
     941------------------------------------------------------------------------------ 
     942                                                           *'NERDTreeDirArrows'* 
     943Values: 0 or 1 
     944Default: 0. 
     945 
     946This option is used to change the default look of directory nodes displayed in 
     947the tree. When set to 0 it shows old-school bars (|), + and ~ chars. If set to 
     9481 it shows right and down arrows.  Use one of the follow lines to set this 
     949option: > 
     950    let NERDTreeDirArrows=0 
     951    let NERDTreeDirArrows=1 
     952< 
     953 
    924954============================================================================== 
    9259554. The NERD tree API                                             *NERDTreeAPI* 
     
    10801110============================================================================== 
    108111116. Changelog                                               *NERDTreeChangelog* 
     1112 
     11134.x.x 
     1114    - Fix a bug with :NERDTreeFind and symlinks. Thanks to Vitaly Bogdanov. 
    10821115 
    108311164.1.0 
     
    12151248    jfilip1024 
    12161249    Chris Chambers 
     1250    Vitaly Bogdanov 
    12171251 
    12181252============================================================================== 
  • various/config/dot-vim/nerdtree_plugin/fs_menu.vim

    r829c049 r9851733  
    1717 
    1818call NERDTreeAddMenuItem({'text': '(a)dd a childnode', 'shortcut': 'a', 'callback': 'NERDTreeAddNode'}) 
    19 call NERDTreeAddMenuItem({'text': '(m)ove the curent node', 'shortcut': 'm', 'callback': 'NERDTreeMoveNode'}) 
    20 call NERDTreeAddMenuItem({'text': '(d)elete the curent node', 'shortcut': 'd', 'callback': 'NERDTreeDeleteNode'}) 
     19call NERDTreeAddMenuItem({'text': '(m)ove the current node', 'shortcut': 'm', 'callback': 'NERDTreeMoveNode'}) 
     20call NERDTreeAddMenuItem({'text': '(d)elete the current node', 'shortcut': 'd', 'callback': 'NERDTreeDeleteNode'}) 
    2121if g:NERDTreePath.CopyingSupported() 
    2222    call NERDTreeAddMenuItem({'text': '(c)copy the current node', 'shortcut': 'c', 'callback': 'NERDTreeCopyNode'}) 
     
    5858                          \ "==========================================================\n". 
    5959                          \ "Enter the dir/file name to be created. Dirs end with a '/'\n" . 
    60                           \ "", curDirNode.path.str({'format': 'Glob'}) . g:NERDTreePath.Slash()) 
     60                          \ "", curDirNode.path.str() . g:NERDTreePath.Slash(), "file") 
    6161 
    6262    if newNodeName ==# '' 
     
    8686                          \ "==========================================================\n" . 
    8787                          \ "Enter the new path for the node:                          \n" . 
    88                           \ "", curNode.path.str()) 
     88                          \ "", curNode.path.str(), "file") 
    8989 
    9090    if newNodePath ==# '' 
     
    164164                          \ "==========================================================\n" . 
    165165                          \ "Enter the new path to copy the node to:                   \n" . 
    166                           \ "", currentNode.path.str()) 
     166                          \ "", currentNode.path.str(), "file") 
    167167 
    168168    if newNodePath != "" 
     
    180180            try 
    181181                let newNode = currentNode.copy(newNodePath) 
    182                 call NERDTreeRender() 
    183                 call newNode.putCursorHere(0, 0) 
     182                if !empty(newNode) 
     183                    call NERDTreeRender() 
     184                    call newNode.putCursorHere(0, 0) 
     185                endif 
    184186            catch /^NERDTree/ 
    185187                call s:echoWarning("Could not copy node") 
  • various/config/dot-vim/plugin/NERD_tree.vim

    rf819d8b r9851733  
    4040function! s:initVariable(var, value) 
    4141    if !exists(a:var) 
    42         exec 'let ' . a:var . ' = ' . "'" . a:value . "'" 
     42        exec 'let ' . a:var . ' = ' . "'" . substitute(a:value, "'", "''", "g") . "'" 
    4343        return 1 
    4444    endif 
     
    5252call s:initVariable("g:NERDTreeCaseSensitiveSort", 0) 
    5353call s:initVariable("g:NERDTreeChDirMode", 0) 
     54call s:initVariable("g:NERDTreeMinimalUI", 0) 
    5455if !exists("g:NERDTreeIgnore") 
    5556    let g:NERDTreeIgnore = ['\~$'] 
     
    6667call s:initVariable("g:NERDTreeShowLineNumbers", 0) 
    6768call s:initVariable("g:NERDTreeSortDirs", 1) 
     69call s:initVariable("g:NERDTreeDirArrows", 0) 
    6870 
    6971if !exists("g:NERDTreeSortOrder") 
     
    143145    let s:escape_chars =  " `\|\"#%&,?()\*^<>" 
    144146else 
    145     let s:escape_chars =  " \\`\|\"#%&,?()\*^<>" 
     147    let s:escape_chars =  " \\`\|\"#%&,?()\*^<>[]" 
    146148endif 
    147149let s:NERDTreeBufName = 'NERD_tree_' 
    148150 
    149151let s:tree_wid = 2 
    150 let s:tree_markup_reg = '^[ `|]*[\-+~]' 
     152let s:tree_markup_reg = '^[ `|]*[\-+~▾▸ ]\+' 
    151153let s:tree_up_dir_line = '.. (up a dir)' 
    152154 
     
    168170    "Save the cursor position whenever we close the nerd tree 
    169171    exec "autocmd BufWinLeave ". s:NERDTreeBufName ."* call <SID>saveScreenState()" 
     172 
     173    "disallow insert mode in the NERDTree 
     174    exec "autocmd BufEnter ". s:NERDTreeBufName ."* stopinsert" 
     175 
    170176    "cache bookmarks when vim loads 
    171177    autocmd VimEnter * call s:Bookmark.CacheBookmarks(0) 
     
    195201            let n = s:TreeFileNode.New(self.path) 
    196202            call n.open() 
     203            call s:closeTreeIfQuitOnOpen() 
    197204        endif 
    198205    endif 
     
    373380" Create a new bookmark object with the given name and path object 
    374381function! s:Bookmark.New(name, path) 
    375     if a:name =~ ' ' 
     382    if a:name =~# ' ' 
    376383        throw "NERDTree.IllegalBookmarkNameError: illegal name:" . a:name 
    377384    endif 
     
    390397        call s:initNerdTree(self.name) 
    391398    else 
    392         exec "tabedit " . bookmark.path.str({'format': 'Edit'}) 
     399        exec "tabedit " . self.path.str({'format': 'Edit'}) 
    393400    endif 
    394401 
     
    559566 
    560567"FUNCTION: MenuController._current(key) {{{3 
    561 "get the MenuItem that is curently selected 
     568"get the MenuItem that is currently selected 
    562569function! s:MenuController._current() 
    563570    return self.menuItems[self.selection] 
     
    807814"bookmark this node with a:name 
    808815function! s:TreeFileNode.bookmark(name) 
     816 
     817    "if a bookmark exists with the same name and the node is cached then save 
     818    "it so we can update its display string 
     819    let oldMarkedNode = {} 
    809820    try 
    810821        let oldMarkedNode = s:Bookmark.GetNodeForName(a:name, 1) 
    811         call oldMarkedNode.path.cacheDisplayString() 
    812822    catch /^NERDTree.BookmarkNotFoundError/ 
     823    catch /^NERDTree.BookmarkedNodeNotFoundError/ 
    813824    endtry 
    814825 
     
    816827    call self.path.cacheDisplayString() 
    817828    call s:Bookmark.Write() 
     829 
     830    if !empty(oldMarkedNode) 
     831        call oldMarkedNode.path.cacheDisplayString() 
     832    endif 
    818833endfunction 
    819834"FUNCTION: TreeFileNode.cacheParent() {{{3 
     
    856871    if !empty(parent) 
    857872        call parent.refresh() 
    858     endif 
    859     return parent.findNode(newPath) 
     873        return parent.findNode(newPath) 
     874    else 
     875        return {} 
     876    endif 
    860877endfunction 
    861878 
     
    10291046function! s:TreeFileNode.GetRootLineNum() 
    10301047    let rootLine = 1 
    1031     while getline(rootLine) !~ '^\(/\|<\)' 
     1048    while getline(rootLine) !~# '^\(/\|<\)' 
    10321049        let rootLine = rootLine + 1 
    10331050    endwhile 
     
    13051322        if a:depth > 1 
    13061323            for j in a:vertMap[0:-2] 
    1307                 if j ==# 1 
    1308                     let treeParts = treeParts . '| ' 
     1324                if g:NERDTreeDirArrows 
     1325                    let treeParts = treeParts . '  ' 
    13091326                else 
    1310                     let treeParts = treeParts . '  ' 
     1327                    if j ==# 1 
     1328                        let treeParts = treeParts . '| ' 
     1329                    else 
     1330                        let treeParts = treeParts . '  ' 
     1331                    endif 
    13111332                endif 
    13121333            endfor 
     
    13151336        "get the last vertical tree part for this line which will be different 
    13161337        "if this node is the last child of its parent 
    1317         if a:isLastChild 
    1318             let treeParts = treeParts . '`' 
    1319         else 
    1320             let treeParts = treeParts . '|' 
    1321         endif 
    1322  
     1338        if !g:NERDTreeDirArrows 
     1339            if a:isLastChild 
     1340                let treeParts = treeParts . '`' 
     1341            else 
     1342                let treeParts = treeParts . '|' 
     1343            endif 
     1344        endif 
    13231345 
    13241346        "smack the appropriate dir/file symbol on the line before the file/dir 
     
    13261348        if self.path.isDirectory 
    13271349            if self.isOpen 
    1328                 let treeParts = treeParts . '~' 
     1350                if g:NERDTreeDirArrows 
     1351                    let treeParts = treeParts . '▾ ' 
     1352                else 
     1353                    let treeParts = treeParts . '~' 
     1354                endif 
    13291355            else 
    1330                 let treeParts = treeParts . '+' 
     1356                if g:NERDTreeDirArrows 
     1357                    let treeParts = treeParts . '▸ ' 
     1358                else 
     1359                    let treeParts = treeParts . '+' 
     1360                endif 
    13311361            endif 
    13321362        else 
    1333             let treeParts = treeParts . '-' 
     1363            if g:NERDTreeDirArrows 
     1364                let treeParts = treeParts . '  ' 
     1365            else 
     1366                let treeParts = treeParts . '-' 
     1367            endif 
    13341368        endif 
    13351369        let line = treeParts . self.displayString() 
     
    15941628        "Note: we must match .. AND ../ cos sometimes the globpath returns 
    15951629        "../ for path with strange chars (eg $) 
    1596         if i !~ '\/\.\.\/\?$' && i !~ '\/\.\/\?$' 
     1630        if i !~# '\/\.\.\/\?$' && i !~# '\/\.\/\?$' 
    15971631 
    15981632            "put the next file in a new node and attach it 
     
    17311765            "Note: we must match .. AND ../ cos sometimes the globpath returns 
    17321766            "../ for path with strange chars (eg $) 
    1733             if i !~ '\/\.\.\/\?$' && i !~ '\/\.\/\?$' 
     1767            if i !~# '\/\.\.\/\?$' && i !~# '\/\.\/\?$' 
    17341768 
    17351769                try 
     
    18531887    let prependCWD = 0 
    18541888    if s:running_windows 
    1855         let prependCWD = a:str !~ '^.:\(\\\|\/\)' 
    1856     else 
    1857         let prependCWD = a:str !~ '^/' 
     1889        let prependCWD = a:str !~# '^.:\(\\\|\/\)' 
     1890    else 
     1891        let prependCWD = a:str !~# '^/' 
    18581892    endif 
    18591893 
     
    19722006 
    19732007        "if it ends with a slash, assume its a dir create it 
    1974         if a:fullpath =~ '\(\\\|\/\)$' 
     2008        if a:fullpath =~# '\(\\\|\/\)$' 
    19752009            "whack the trailing slash off the end if it exists 
    19762010            let fullpath = substitute(a:fullpath, '\(\\\|\/\)$', '', '') 
     
    20022036    let dest = s:Path.WinToUnixPath(a:dest) 
    20032037 
    2004     let cmd = g:NERDTreeCopyCmd . " " . self.str() . " " . dest 
     2038    let cmd = g:NERDTreeCopyCmd . " " . escape(self.str(), s:escape_chars) . " " . escape(dest, s:escape_chars) 
    20052039    let success = system(cmd) 
    20062040    if success != 0 
     
    21452179    let i = 0 
    21462180    while i < len(g:NERDTreeSortOrder) 
    2147         if  self.getLastPathComponent(1) =~ g:NERDTreeSortOrder[i] 
     2181        if  self.getLastPathComponent(1) =~# g:NERDTreeSortOrder[i] 
    21482182            return i 
    21492183        endif 
     
    21612195    if b:NERDTreeIgnoreEnabled 
    21622196        for i in g:NERDTreeIgnore 
    2163             if lastPathComponent =~ i 
     2197            if lastPathComponent =~# i 
    21642198                return 1 
    21652199            endif 
     
    21682202 
    21692203    "dont show hidden files unless instructed to 
    2170     if b:NERDTreeShowHidden ==# 0 && lastPathComponent =~ '^\.' 
     2204    if b:NERDTreeShowHidden ==# 0 && lastPathComponent =~# '^\.' 
    21712205        return 1 
    21722206    endif 
     
    22582292    let self.isExecutable = 0 
    22592293    if !self.isDirectory 
    2260         let self.isExecutable = getfperm(a:fullpath) =~ 'x' 
     2294        let self.isExecutable = getfperm(a:fullpath) =~# 'x' 
    22612295    endif 
    22622296 
     
    22772311            "we always wanna treat MS windows shortcuts as files for 
    22782312            "simplicity 
    2279             if hardPath !~ '\.lnk$' 
     2313            if hardPath !~# '\.lnk$' 
    22802314 
    22812315                let self.symLinkDest = self.symLinkDest . '/' 
     
    25092543" completion function for the bookmark commands 
    25102544function! s:completeBookmarks(A,L,P) 
    2511     return filter(s:Bookmark.BookmarkNames(), 'v:val =~ "^' . a:A . '"') 
     2545    return filter(s:Bookmark.BookmarkNames(), 'v:val =~# "^' . a:A . '"') 
    25122546endfunction 
    25132547" FUNCTION: s:exec(cmd) {{{2 
     
    25222556function! s:findAndRevealPath() 
    25232557    try 
    2524         let p = s:Path.New(expand("%")) 
     2558        let p = s:Path.New(expand("%:p")) 
    25252559    catch /^NERDTree.InvalidArgumentsError/ 
    25262560        call s:echo("no file for the current buffer") 
     
    25562590 
    25572591        "hack to get an absolute path if a relative path is given 
    2558         if dir =~ '^\.' 
     2592        if dir =~# '^\.' 
    25592593            let dir = getcwd() . s:Path.Slash() . dir 
    25602594        endif 
     
    26372671    else 
    26382672        setlocal nonu 
     2673        if v:version >= 703 
     2674            setlocal nornu 
     2675        endif 
    26392676    endif 
    26402677 
     
    28132850 
    28142851    if winnr("$") != 1 
     2852        if winnr() == s:getTreeWinNum() 
     2853            wincmd p 
     2854            let bufnr = bufnr("") 
     2855            wincmd p 
     2856        else 
     2857            let bufnr = bufnr("") 
     2858        endif 
     2859 
    28152860        call s:exec(s:getTreeWinNum() . " wincmd w") 
    28162861        close 
    2817         call s:exec("wincmd p") 
     2862        call s:exec(bufwinnr(bufnr) . " wincmd w") 
    28182863    else 
    28192864        close 
     
    28652910    else 
    28662911        setlocal nonu 
     2912        if v:version >= 703 
     2913            setlocal nornu 
     2914        endif 
    28672915    endif 
    28682916 
     
    29803028        let @h=@h."\" :ClearBookmarks [<names>]\n" 
    29813029        let @h=@h."\" :ClearAllBookmarks\n" 
    2982     else 
     3030        silent! put h 
     3031    elseif g:NERDTreeMinimalUI == 0 
    29833032        let @h="\" Press ". g:NERDTreeMapHelp ." for help\n" 
    2984     endif 
    2985  
    2986     silent! put h 
     3033        silent! put h 
     3034    endif 
    29873035 
    29883036    let @h = old_h 
     
    30513099    endif 
    30523100 
    3053     " in case called from outside the tree 
    3054     if line !~ '^ *[|`]' || line =~ '^$' 
    3055         return {} 
     3101    if !g:NERDTreeDirArrows 
     3102        " in case called from outside the tree 
     3103        if line !~# '^ *[|`▸▾ ]' || line =~# '^$' 
     3104            return {} 
     3105        endif 
    30563106    endif 
    30573107 
     
    30663116 
    30673117    let wasdir = 0 
    3068     if curFile =~ '/$' 
     3118    if curFile =~# '/$' 
    30693119        let wasdir = 1 
    30703120        let curFile = substitute(curFile, '/\?$', '/', "") 
     
    30833133            break 
    30843134        endif 
    3085         if curLineStripped =~ '/$' 
     3135        if curLineStripped =~# '/$' 
    30863136            let lpindent = s:indentLevelFor(curLine) 
    30873137            if lpindent < indent 
     
    31093159"FUNCTION: s:indentLevelFor(line) {{{2 
    31103160function! s:indentLevelFor(line) 
    3111     return match(a:line, '[^ \-+~`|]') / s:tree_wid 
     3161    let level = match(a:line, '[^ \-+~▸▾`|]') / s:tree_wid 
     3162    " check if line includes arrows 
     3163    if match(a:line, '[▸▾]') > -1 
     3164        " decrement level as arrow uses 3 ascii chars 
     3165        let level = level - 1 
     3166    endif 
     3167    return level 
    31123168endfunction 
    31133169"FUNCTION: s:isTreeOpen() {{{2 
     
    31993255    endif 
    32003256 
     3257    if g:NERDTreeMinimalUI 
     3258        return cursor(1, 2) 
     3259    endif 
     3260 
    32013261    let rootNodeLine = s:TreeFileNode.GetRootLineNum() 
    32023262 
    32033263    let line = 1 
    3204     while getline(line) !~ '^>-\+Bookmarks-\+$' 
     3264    while getline(line) !~# '^>-\+Bookmarks-\+$' 
    32053265        let line = line + 1 
    32063266        if line >= rootNodeLine 
     
    32083268        endif 
    32093269    endwhile 
    3210     call cursor(line, 0) 
     3270    call cursor(line, 2) 
    32113271endfunction 
    32123272 
     
    32243284function! s:renderBookmarks() 
    32253285 
    3226     call setline(line(".")+1, ">----------Bookmarks----------") 
    3227     call cursor(line(".")+1, col(".")) 
     3286    if g:NERDTreeMinimalUI == 0 
     3287        call setline(line(".")+1, ">----------Bookmarks----------") 
     3288        call cursor(line(".")+1, col(".")) 
     3289    endif 
    32283290 
    32293291    for i in s:Bookmark.Bookmarks() 
     
    32523314 
    32533315    "delete the blank line before the help and add one after it 
    3254     call setline(line(".")+1, "") 
    3255     call cursor(line(".")+1, col(".")) 
     3316    if g:NERDTreeMinimalUI == 0 
     3317        call setline(line(".")+1, "") 
     3318        call cursor(line(".")+1, col(".")) 
     3319    endif 
    32563320 
    32573321    if b:NERDTreeShowBookmarks 
     
    32603324 
    32613325    "add the 'up a dir' line 
    3262     call setline(line(".")+1, s:tree_up_dir_line) 
    3263     call cursor(line(".")+1, col(".")) 
     3326    if !g:NERDTreeMinimalUI 
     3327        call setline(line(".")+1, s:tree_up_dir_line) 
     3328        call cursor(line(".")+1, col(".")) 
     3329    endif 
    32643330 
    32653331    "draw the header line 
     
    33493415"FUNCTION: s:setupSyntaxHighlighting() {{{2 
    33503416function! s:setupSyntaxHighlighting() 
    3351     "treeFlags are syntax items that should be invisible, but give clues as to 
     3417    "NERDTreeFlags are syntax items that should be invisible, but give clues as to 
    33523418    "how things should be highlighted 
    3353     syn match treeFlag #\~# 
    3354     syn match treeFlag #\[RO\]# 
     3419    syn match NERDTreeFlag #\~# 
     3420    syn match NERDTreeFlag #\[RO\]# 
    33553421 
    33563422    "highlighting for the .. (up dir) line at the top of the tree 
    3357     execute "syn match treeUp #". s:tree_up_dir_line ."#" 
     3423    execute "syn match NERDTreeUp #\\V". s:tree_up_dir_line ."#" 
    33583424 
    33593425    "highlighting for the ~/+ symbols for the directory nodes 
    3360     syn match treeClosable #\~\<# 
    3361     syn match treeClosable #\~\.# 
    3362     syn match treeOpenable #+\<# 
    3363     syn match treeOpenable #+\.#he=e-1 
     3426    syn match NERDTreeClosable #\~\<# 
     3427    syn match NERDTreeClosable #\~\.# 
     3428    syn match NERDTreeOpenable #+\<# 
     3429    syn match NERDTreeOpenable #+\.#he=e-1 
    33643430 
    33653431    "highlighting for the tree structural parts 
    3366     syn match treePart #|# 
    3367     syn match treePart #`# 
    3368     syn match treePartFile #[|`]-#hs=s+1 contains=treePart 
     3432    syn match NERDTreePart #|# 
     3433    syn match NERDTreePart #`# 
     3434    syn match NERDTreePartFile #[|`]-#hs=s+1 contains=NERDTreePart 
    33693435 
    33703436    "quickhelp syntax elements 
    3371     syn match treeHelpKey #" \{1,2\}[^ ]*:#hs=s+2,he=e-1 
    3372     syn match treeHelpKey #" \{1,2\}[^ ]*,#hs=s+2,he=e-1 
    3373     syn match treeHelpTitle #" .*\~#hs=s+2,he=e-1 contains=treeFlag 
    3374     syn match treeToggleOn #".*(on)#hs=e-2,he=e-1 contains=treeHelpKey 
    3375     syn match treeToggleOff #".*(off)#hs=e-3,he=e-1 contains=treeHelpKey 
    3376     syn match treeHelpCommand #" :.\{-}\>#hs=s+3 
    3377     syn match treeHelp  #^".*# contains=treeHelpKey,treeHelpTitle,treeFlag,treeToggleOff,treeToggleOn,treeHelpCommand 
     3437    syn match NERDTreeHelpKey #" \{1,2\}[^ ]*:#hs=s+2,he=e-1 
     3438    syn match NERDTreeHelpKey #" \{1,2\}[^ ]*,#hs=s+2,he=e-1 
     3439    syn match NERDTreeHelpTitle #" .*\~#hs=s+2,he=e-1 contains=NERDTreeFlag 
     3440    syn match NERDTreeToggleOn #".*(on)#hs=e-2,he=e-1 contains=NERDTreeHelpKey 
     3441    syn match NERDTreeToggleOff #".*(off)#hs=e-3,he=e-1 contains=NERDTreeHelpKey 
     3442    syn match NERDTreeHelpCommand #" :.\{-}\>#hs=s+3 
     3443    syn match NERDTreeHelp  #^".*# contains=NERDTreeHelpKey,NERDTreeHelpTitle,NERDTreeFlag,NERDTreeToggleOff,NERDTreeToggleOn,NERDTreeHelpCommand 
    33783444 
    33793445    "highlighting for readonly files 
    3380     syn match treeRO #.*\[RO\]#hs=s+2 contains=treeFlag,treeBookmark,treePart,treePartFile 
     3446    syn match NERDTreeRO #.*\[RO\]#hs=s+2 contains=NERDTreeFlag,NERDTreeBookmark,NERDTreePart,NERDTreePartFile 
    33813447 
    33823448    "highlighting for sym links 
    3383     syn match treeLink #[^-| `].* -> # contains=treeBookmark,treeOpenable,treeClosable,treeDirSlash 
     3449    syn match NERDTreeLink #[^-| `].* -> # contains=NERDTreeBookmark,NERDTreeOpenable,NERDTreeClosable,NERDTreeDirSlash 
    33843450 
    33853451    "highlighing for directory nodes and file nodes 
    3386     syn match treeDirSlash #/# 
    3387     syn match treeDir #[^-| `].*/# contains=treeLink,treeDirSlash,treeOpenable,treeClosable 
    3388     syn match treeExecFile  #[|`]-.*\*\($\| \)# contains=treeLink,treePart,treeRO,treePartFile,treeBookmark 
    3389     syn match treeFile  #|-.*# contains=treeLink,treePart,treeRO,treePartFile,treeBookmark,treeExecFile 
    3390     syn match treeFile  #`-.*# contains=treeLink,treePart,treeRO,treePartFile,treeBookmark,treeExecFile 
    3391     syn match treeCWD #^/.*$# 
     3452    syn match NERDTreeDirSlash #/# 
     3453    syn match NERDTreeDir #[^-| `].*/# contains=NERDTreeLink,NERDTreeDirSlash,NERDTreeOpenable,NERDTreeClosable 
     3454    syn match NERDTreeExecFile  #[|` ].*\*\($\| \)# contains=NERDTreeLink,NERDTreePart,NERDTreeRO,NERDTreePartFile,NERDTreeBookmark 
     3455    syn match NERDTreeFile  #|-.*# contains=NERDTreeLink,NERDTreePart,NERDTreeRO,NERDTreePartFile,NERDTreeBookmark,NERDTreeExecFile 
     3456    syn match NERDTreeFile  #`-.*# contains=NERDTreeLink,NERDTreePart,NERDTreeRO,NERDTreePartFile,NERDTreeBookmark,NERDTreeExecFile 
     3457    syn match NERDTreeCWD #^[</].*$# 
    33923458 
    33933459    "highlighting for bookmarks 
    3394     syn match treeBookmark # {.*}#hs=s+1 
     3460    syn match NERDTreeBookmark # {.*}#hs=s+1 
    33953461 
    33963462    "highlighting for the bookmarks table 
    3397     syn match treeBookmarksLeader #^># 
    3398     syn match treeBookmarksHeader #^>-\+Bookmarks-\+$# contains=treeBookmarksLeader 
    3399     syn match treeBookmarkName #^>.\{-} #he=e-1 contains=treeBookmarksLeader 
    3400     syn match treeBookmark #^>.*$# contains=treeBookmarksLeader,treeBookmarkName,treeBookmarksHeader 
     3463    syn match NERDTreeBookmarksLeader #^># 
     3464    syn match NERDTreeBookmarksHeader #^>-\+Bookmarks-\+$# contains=NERDTreeBookmarksLeader 
     3465    syn match NERDTreeBookmarkName #^>.\{-} #he=e-1 contains=NERDTreeBookmarksLeader 
     3466    syn match NERDTreeBookmark #^>.*$# contains=NERDTreeBookmarksLeader,NERDTreeBookmarkName,NERDTreeBookmarksHeader 
    34013467 
    34023468    if g:NERDChristmasTree 
    3403         hi def link treePart Special 
    3404         hi def link treePartFile Type 
    3405         hi def link treeFile Normal 
    3406         hi def link treeExecFile Title 
    3407         hi def link treeDirSlash Identifier 
    3408         hi def link treeClosable Type 
    3409     else 
    3410         hi def link treePart Normal 
    3411         hi def link treePartFile Normal 
    3412         hi def link treeFile Normal 
    3413         hi def link treeClosable Title 
    3414     endif 
    3415  
    3416     hi def link treeBookmarksHeader statement 
    3417     hi def link treeBookmarksLeader ignore 
    3418     hi def link treeBookmarkName Identifier 
    3419     hi def link treeBookmark normal 
    3420  
    3421     hi def link treeHelp String 
    3422     hi def link treeHelpKey Identifier 
    3423     hi def link treeHelpCommand Identifier 
    3424     hi def link treeHelpTitle Macro 
    3425     hi def link treeToggleOn Question 
    3426     hi def link treeToggleOff WarningMsg 
    3427  
    3428     hi def link treeDir Directory 
    3429     hi def link treeUp Directory 
    3430     hi def link treeCWD Statement 
    3431     hi def link treeLink Macro 
    3432     hi def link treeOpenable Title 
    3433     hi def link treeFlag ignore 
    3434     hi def link treeRO WarningMsg 
    3435     hi def link treeBookmark Statement 
     3469        hi def link NERDTreePart Special 
     3470        hi def link NERDTreePartFile Type 
     3471        hi def link NERDTreeFile Normal 
     3472        hi def link NERDTreeExecFile Title 
     3473        hi def link NERDTreeDirSlash Identifier 
     3474        hi def link NERDTreeClosable Type 
     3475    else 
     3476        hi def link NERDTreePart Normal 
     3477        hi def link NERDTreePartFile Normal 
     3478        hi def link NERDTreeFile Normal 
     3479        hi def link NERDTreeClosable Title 
     3480    endif 
     3481 
     3482    hi def link NERDTreeBookmarksHeader statement 
     3483    hi def link NERDTreeBookmarksLeader ignore 
     3484    hi def link NERDTreeBookmarkName Identifier 
     3485    hi def link NERDTreeBookmark normal 
     3486 
     3487    hi def link NERDTreeHelp String 
     3488    hi def link NERDTreeHelpKey Identifier 
     3489    hi def link NERDTreeHelpCommand Identifier 
     3490    hi def link NERDTreeHelpTitle Macro 
     3491    hi def link NERDTreeToggleOn Question 
     3492    hi def link NERDTreeToggleOff WarningMsg 
     3493 
     3494    hi def link NERDTreeDir Directory 
     3495    hi def link NERDTreeUp Directory 
     3496    hi def link NERDTreeCWD Statement 
     3497    hi def link NERDTreeLink Macro 
     3498    hi def link NERDTreeOpenable Title 
     3499    hi def link NERDTreeFlag ignore 
     3500    hi def link NERDTreeRO WarningMsg 
     3501    hi def link NERDTreeBookmark Statement 
    34363502 
    34373503    hi def link NERDTreeCurrentNode Search 
     
    34603526 
    34613527    let wasdir = 0 
    3462     if line =~ '/$' 
     3528    if line =~# '/$' 
    34633529        let wasdir = 1 
    34643530    endif 
     
    36133679    if currentNode != {} 
    36143680        let startToCur = strpart(getline(line(".")), 0, col(".")) 
    3615         let char = strpart(startToCur, strlen(startToCur)-1, 1) 
    3616  
    3617         "if they clicked a dir, check if they clicked on the + or ~ sign 
    3618         "beside it 
     3681 
    36193682        if currentNode.path.isDirectory 
    3620             if startToCur =~ s:tree_markup_reg . '$' && char =~ '[+~]' 
     3683            if startToCur =~# s:tree_markup_reg . '$' && startToCur =~# '[+~▾▸]$' 
    36213684                call s:activateNode(0) 
    36223685                return 
     
    36253688 
    36263689        if (g:NERDTreeMouseMode ==# 2 && currentNode.path.isDirectory) || g:NERDTreeMouseMode ==# 3 
    3627             if char !~ s:tree_markup_reg && startToCur !~ '\/$' 
     3690            let char = strpart(startToCur, strlen(startToCur)-1, 1) 
     3691            if char !~# s:tree_markup_reg 
    36283692                call s:activateNode(0) 
    36293693                return 
     
    40254089function! s:upDir(keepState) 
    40264090    let cwd = b:NERDTreeRoot.path.str({'format': 'UI'}) 
    4027     if cwd ==# "/" || cwd =~ '^[^/]..$' 
     4091    if cwd ==# "/" || cwd =~# '^[^/]..$' 
    40284092        call s:echo("already at top dir") 
    40294093    else 
Note: See TracChangeset for help on using the changeset viewer.