Changeset 9851733a8b4fa681f1256b8cdb3007f5cfa15619
- Timestamp:
- 11/14/11 14:07:59 (6 months ago)
- Children:
- 3981b13d03c192281eebfa9c40d26809e52a3426
- Parents:
- cffa83966a2fc1701263eaa7c21c658a8150c7ac
- git-committer:
- Luper Rouch <luper.rouch@…> (11/14/11 14:07:59)
- Location:
- various/config/dot-vim
- Files:
-
- 3 edited
-
doc/NERD_tree.txt (modified) (4 diffs)
-
nerdtree_plugin/fs_menu.vim (modified) (5 diffs)
-
plugin/NERD_tree.vim (modified) (47 diffs)
Legend:
- Unmodified
- Added
- Removed
-
various/config/dot-vim/doc/NERD_tree.txt
rf819d8b r9851733 643 643 opened. 644 644 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 645 651 ------------------------------------------------------------------------------ 646 652 3.2. Customisation details *NERDTreeOptionDetails* … … 922 928 This option is used to change the size of the NERD tree when it is loaded. 923 929 930 ------------------------------------------------------------------------------ 931 *'NERDTreeMinimalUI'* 932 Values: 0 or 1 933 Default: 0 934 935 This options disables the 'Bookmarks' label 'Press ? for help' text. Use one 936 of the following lines to set this option: > 937 let NERDTreeMinimalUI=0 938 let NERDTreeMinimalUI=1 939 < 940 941 ------------------------------------------------------------------------------ 942 *'NERDTreeDirArrows'* 943 Values: 0 or 1 944 Default: 0. 945 946 This option is used to change the default look of directory nodes displayed in 947 the tree. When set to 0 it shows old-school bars (|), + and ~ chars. If set to 948 1 it shows right and down arrows. Use one of the follow lines to set this 949 option: > 950 let NERDTreeDirArrows=0 951 let NERDTreeDirArrows=1 952 < 953 924 954 ============================================================================== 925 955 4. The NERD tree API *NERDTreeAPI* … … 1080 1110 ============================================================================== 1081 1111 6. Changelog *NERDTreeChangelog* 1112 1113 4.x.x 1114 - Fix a bug with :NERDTreeFind and symlinks. Thanks to Vitaly Bogdanov. 1082 1115 1083 1116 4.1.0 … … 1215 1248 jfilip1024 1216 1249 Chris Chambers 1250 Vitaly Bogdanov 1217 1251 1218 1252 ============================================================================== -
various/config/dot-vim/nerdtree_plugin/fs_menu.vim
r829c049 r9851733 17 17 18 18 call NERDTreeAddMenuItem({'text': '(a)dd a childnode', 'shortcut': 'a', 'callback': 'NERDTreeAddNode'}) 19 call NERDTreeAddMenuItem({'text': '(m)ove the cur ent node', 'shortcut': 'm', 'callback': 'NERDTreeMoveNode'})20 call NERDTreeAddMenuItem({'text': '(d)elete the cur ent node', 'shortcut': 'd', 'callback': 'NERDTreeDeleteNode'})19 call NERDTreeAddMenuItem({'text': '(m)ove the current node', 'shortcut': 'm', 'callback': 'NERDTreeMoveNode'}) 20 call NERDTreeAddMenuItem({'text': '(d)elete the current node', 'shortcut': 'd', 'callback': 'NERDTreeDeleteNode'}) 21 21 if g:NERDTreePath.CopyingSupported() 22 22 call NERDTreeAddMenuItem({'text': '(c)copy the current node', 'shortcut': 'c', 'callback': 'NERDTreeCopyNode'}) … … 58 58 \ "==========================================================\n". 59 59 \ "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") 61 61 62 62 if newNodeName ==# '' … … 86 86 \ "==========================================================\n" . 87 87 \ "Enter the new path for the node: \n" . 88 \ "", curNode.path.str() )88 \ "", curNode.path.str(), "file") 89 89 90 90 if newNodePath ==# '' … … 164 164 \ "==========================================================\n" . 165 165 \ "Enter the new path to copy the node to: \n" . 166 \ "", currentNode.path.str() )166 \ "", currentNode.path.str(), "file") 167 167 168 168 if newNodePath != "" … … 180 180 try 181 181 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 184 186 catch /^NERDTree/ 185 187 call s:echoWarning("Could not copy node") -
various/config/dot-vim/plugin/NERD_tree.vim
rf819d8b r9851733 40 40 function! s:initVariable(var, value) 41 41 if !exists(a:var) 42 exec 'let ' . a:var . ' = ' . "'" . a:value. "'"42 exec 'let ' . a:var . ' = ' . "'" . substitute(a:value, "'", "''", "g") . "'" 43 43 return 1 44 44 endif … … 52 52 call s:initVariable("g:NERDTreeCaseSensitiveSort", 0) 53 53 call s:initVariable("g:NERDTreeChDirMode", 0) 54 call s:initVariable("g:NERDTreeMinimalUI", 0) 54 55 if !exists("g:NERDTreeIgnore") 55 56 let g:NERDTreeIgnore = ['\~$'] … … 66 67 call s:initVariable("g:NERDTreeShowLineNumbers", 0) 67 68 call s:initVariable("g:NERDTreeSortDirs", 1) 69 call s:initVariable("g:NERDTreeDirArrows", 0) 68 70 69 71 if !exists("g:NERDTreeSortOrder") … … 143 145 let s:escape_chars = " `\|\"#%&,?()\*^<>" 144 146 else 145 let s:escape_chars = " \\`\|\"#%&,?()\*^<> "147 let s:escape_chars = " \\`\|\"#%&,?()\*^<>[]" 146 148 endif 147 149 let s:NERDTreeBufName = 'NERD_tree_' 148 150 149 151 let s:tree_wid = 2 150 let s:tree_markup_reg = '^[ `|]*[\-+~ ]'152 let s:tree_markup_reg = '^[ `|]*[\-+~▾▸ ]\+' 151 153 let s:tree_up_dir_line = '.. (up a dir)' 152 154 … … 168 170 "Save the cursor position whenever we close the nerd tree 169 171 exec "autocmd BufWinLeave ". s:NERDTreeBufName ."* call <SID>saveScreenState()" 172 173 "disallow insert mode in the NERDTree 174 exec "autocmd BufEnter ". s:NERDTreeBufName ."* stopinsert" 175 170 176 "cache bookmarks when vim loads 171 177 autocmd VimEnter * call s:Bookmark.CacheBookmarks(0) … … 195 201 let n = s:TreeFileNode.New(self.path) 196 202 call n.open() 203 call s:closeTreeIfQuitOnOpen() 197 204 endif 198 205 endif … … 373 380 " Create a new bookmark object with the given name and path object 374 381 function! s:Bookmark.New(name, path) 375 if a:name =~ ' '382 if a:name =~# ' ' 376 383 throw "NERDTree.IllegalBookmarkNameError: illegal name:" . a:name 377 384 endif … … 390 397 call s:initNerdTree(self.name) 391 398 else 392 exec "tabedit " . bookmark.path.str({'format': 'Edit'})399 exec "tabedit " . self.path.str({'format': 'Edit'}) 393 400 endif 394 401 … … 559 566 560 567 "FUNCTION: MenuController._current(key) {{{3 561 "get the MenuItem that is cur ently selected568 "get the MenuItem that is currently selected 562 569 function! s:MenuController._current() 563 570 return self.menuItems[self.selection] … … 807 814 "bookmark this node with a:name 808 815 function! 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 = {} 809 820 try 810 821 let oldMarkedNode = s:Bookmark.GetNodeForName(a:name, 1) 811 call oldMarkedNode.path.cacheDisplayString()812 822 catch /^NERDTree.BookmarkNotFoundError/ 823 catch /^NERDTree.BookmarkedNodeNotFoundError/ 813 824 endtry 814 825 … … 816 827 call self.path.cacheDisplayString() 817 828 call s:Bookmark.Write() 829 830 if !empty(oldMarkedNode) 831 call oldMarkedNode.path.cacheDisplayString() 832 endif 818 833 endfunction 819 834 "FUNCTION: TreeFileNode.cacheParent() {{{3 … … 856 871 if !empty(parent) 857 872 call parent.refresh() 858 endif 859 return parent.findNode(newPath) 873 return parent.findNode(newPath) 874 else 875 return {} 876 endif 860 877 endfunction 861 878 … … 1029 1046 function! s:TreeFileNode.GetRootLineNum() 1030 1047 let rootLine = 1 1031 while getline(rootLine) !~ '^\(/\|<\)'1048 while getline(rootLine) !~# '^\(/\|<\)' 1032 1049 let rootLine = rootLine + 1 1033 1050 endwhile … … 1305 1322 if a:depth > 1 1306 1323 for j in a:vertMap[0:-2] 1307 if j ==# 11308 let treeParts = treeParts . ' |'1324 if g:NERDTreeDirArrows 1325 let treeParts = treeParts . ' ' 1309 1326 else 1310 let treeParts = treeParts . ' ' 1327 if j ==# 1 1328 let treeParts = treeParts . '| ' 1329 else 1330 let treeParts = treeParts . ' ' 1331 endif 1311 1332 endif 1312 1333 endfor … … 1315 1336 "get the last vertical tree part for this line which will be different 1316 1337 "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 1323 1345 1324 1346 "smack the appropriate dir/file symbol on the line before the file/dir … … 1326 1348 if self.path.isDirectory 1327 1349 if self.isOpen 1328 let treeParts = treeParts . '~' 1350 if g:NERDTreeDirArrows 1351 let treeParts = treeParts . '▾ ' 1352 else 1353 let treeParts = treeParts . '~' 1354 endif 1329 1355 else 1330 let treeParts = treeParts . '+' 1356 if g:NERDTreeDirArrows 1357 let treeParts = treeParts . '▸ ' 1358 else 1359 let treeParts = treeParts . '+' 1360 endif 1331 1361 endif 1332 1362 else 1333 let treeParts = treeParts . '-' 1363 if g:NERDTreeDirArrows 1364 let treeParts = treeParts . ' ' 1365 else 1366 let treeParts = treeParts . '-' 1367 endif 1334 1368 endif 1335 1369 let line = treeParts . self.displayString() … … 1594 1628 "Note: we must match .. AND ../ cos sometimes the globpath returns 1595 1629 "../ for path with strange chars (eg $) 1596 if i !~ '\/\.\.\/\?$' && i !~'\/\.\/\?$'1630 if i !~# '\/\.\.\/\?$' && i !~# '\/\.\/\?$' 1597 1631 1598 1632 "put the next file in a new node and attach it … … 1731 1765 "Note: we must match .. AND ../ cos sometimes the globpath returns 1732 1766 "../ for path with strange chars (eg $) 1733 if i !~ '\/\.\.\/\?$' && i !~'\/\.\/\?$'1767 if i !~# '\/\.\.\/\?$' && i !~# '\/\.\/\?$' 1734 1768 1735 1769 try … … 1853 1887 let prependCWD = 0 1854 1888 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 !~# '^/' 1858 1892 endif 1859 1893 … … 1972 2006 1973 2007 "if it ends with a slash, assume its a dir create it 1974 if a:fullpath =~ '\(\\\|\/\)$'2008 if a:fullpath =~# '\(\\\|\/\)$' 1975 2009 "whack the trailing slash off the end if it exists 1976 2010 let fullpath = substitute(a:fullpath, '\(\\\|\/\)$', '', '') … … 2002 2036 let dest = s:Path.WinToUnixPath(a:dest) 2003 2037 2004 let cmd = g:NERDTreeCopyCmd . " " . self.str() . " " . dest2038 let cmd = g:NERDTreeCopyCmd . " " . escape(self.str(), s:escape_chars) . " " . escape(dest, s:escape_chars) 2005 2039 let success = system(cmd) 2006 2040 if success != 0 … … 2145 2179 let i = 0 2146 2180 while i < len(g:NERDTreeSortOrder) 2147 if self.getLastPathComponent(1) =~ g:NERDTreeSortOrder[i]2181 if self.getLastPathComponent(1) =~# g:NERDTreeSortOrder[i] 2148 2182 return i 2149 2183 endif … … 2161 2195 if b:NERDTreeIgnoreEnabled 2162 2196 for i in g:NERDTreeIgnore 2163 if lastPathComponent =~ i2197 if lastPathComponent =~# i 2164 2198 return 1 2165 2199 endif … … 2168 2202 2169 2203 "dont show hidden files unless instructed to 2170 if b:NERDTreeShowHidden ==# 0 && lastPathComponent =~ '^\.'2204 if b:NERDTreeShowHidden ==# 0 && lastPathComponent =~# '^\.' 2171 2205 return 1 2172 2206 endif … … 2258 2292 let self.isExecutable = 0 2259 2293 if !self.isDirectory 2260 let self.isExecutable = getfperm(a:fullpath) =~ 'x'2294 let self.isExecutable = getfperm(a:fullpath) =~# 'x' 2261 2295 endif 2262 2296 … … 2277 2311 "we always wanna treat MS windows shortcuts as files for 2278 2312 "simplicity 2279 if hardPath !~ '\.lnk$'2313 if hardPath !~# '\.lnk$' 2280 2314 2281 2315 let self.symLinkDest = self.symLinkDest . '/' … … 2509 2543 " completion function for the bookmark commands 2510 2544 function! 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 . '"') 2512 2546 endfunction 2513 2547 " FUNCTION: s:exec(cmd) {{{2 … … 2522 2556 function! s:findAndRevealPath() 2523 2557 try 2524 let p = s:Path.New(expand("% "))2558 let p = s:Path.New(expand("%:p")) 2525 2559 catch /^NERDTree.InvalidArgumentsError/ 2526 2560 call s:echo("no file for the current buffer") … … 2556 2590 2557 2591 "hack to get an absolute path if a relative path is given 2558 if dir =~ '^\.'2592 if dir =~# '^\.' 2559 2593 let dir = getcwd() . s:Path.Slash() . dir 2560 2594 endif … … 2637 2671 else 2638 2672 setlocal nonu 2673 if v:version >= 703 2674 setlocal nornu 2675 endif 2639 2676 endif 2640 2677 … … 2813 2850 2814 2851 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 2815 2860 call s:exec(s:getTreeWinNum() . " wincmd w") 2816 2861 close 2817 call s:exec( "wincmd p")2862 call s:exec(bufwinnr(bufnr) . " wincmd w") 2818 2863 else 2819 2864 close … … 2865 2910 else 2866 2911 setlocal nonu 2912 if v:version >= 703 2913 setlocal nornu 2914 endif 2867 2915 endif 2868 2916 … … 2980 3028 let @h=@h."\" :ClearBookmarks [<names>]\n" 2981 3029 let @h=@h."\" :ClearAllBookmarks\n" 2982 else 3030 silent! put h 3031 elseif g:NERDTreeMinimalUI == 0 2983 3032 let @h="\" Press ". g:NERDTreeMapHelp ." for help\n" 2984 endif 2985 2986 silent! put h 3033 silent! put h 3034 endif 2987 3035 2988 3036 let @h = old_h … … 3051 3099 endif 3052 3100 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 3056 3106 endif 3057 3107 … … 3066 3116 3067 3117 let wasdir = 0 3068 if curFile =~ '/$'3118 if curFile =~# '/$' 3069 3119 let wasdir = 1 3070 3120 let curFile = substitute(curFile, '/\?$', '/', "") … … 3083 3133 break 3084 3134 endif 3085 if curLineStripped =~ '/$'3135 if curLineStripped =~# '/$' 3086 3136 let lpindent = s:indentLevelFor(curLine) 3087 3137 if lpindent < indent … … 3109 3159 "FUNCTION: s:indentLevelFor(line) {{{2 3110 3160 function! 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 3112 3168 endfunction 3113 3169 "FUNCTION: s:isTreeOpen() {{{2 … … 3199 3255 endif 3200 3256 3257 if g:NERDTreeMinimalUI 3258 return cursor(1, 2) 3259 endif 3260 3201 3261 let rootNodeLine = s:TreeFileNode.GetRootLineNum() 3202 3262 3203 3263 let line = 1 3204 while getline(line) !~ '^>-\+Bookmarks-\+$'3264 while getline(line) !~# '^>-\+Bookmarks-\+$' 3205 3265 let line = line + 1 3206 3266 if line >= rootNodeLine … … 3208 3268 endif 3209 3269 endwhile 3210 call cursor(line, 0)3270 call cursor(line, 2) 3211 3271 endfunction 3212 3272 … … 3224 3284 function! s:renderBookmarks() 3225 3285 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 3228 3290 3229 3291 for i in s:Bookmark.Bookmarks() … … 3252 3314 3253 3315 "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 3256 3320 3257 3321 if b:NERDTreeShowBookmarks … … 3260 3324 3261 3325 "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 3264 3330 3265 3331 "draw the header line … … 3349 3415 "FUNCTION: s:setupSyntaxHighlighting() {{{2 3350 3416 function! s:setupSyntaxHighlighting() 3351 " treeFlags are syntax items that should be invisible, but give clues as to3417 "NERDTreeFlags are syntax items that should be invisible, but give clues as to 3352 3418 "how things should be highlighted 3353 syn match treeFlag #\~#3354 syn match treeFlag #\[RO\]#3419 syn match NERDTreeFlag #\~# 3420 syn match NERDTreeFlag #\[RO\]# 3355 3421 3356 3422 "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 ."#" 3358 3424 3359 3425 "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-13426 syn match NERDTreeClosable #\~\<# 3427 syn match NERDTreeClosable #\~\.# 3428 syn match NERDTreeOpenable #+\<# 3429 syn match NERDTreeOpenable #+\.#he=e-1 3364 3430 3365 3431 "highlighting for the tree structural parts 3366 syn match treePart #|#3367 syn match treePart #`#3368 syn match treePartFile #[|`]-#hs=s+1 contains=treePart3432 syn match NERDTreePart #|# 3433 syn match NERDTreePart #`# 3434 syn match NERDTreePartFile #[|`]-#hs=s+1 contains=NERDTreePart 3369 3435 3370 3436 "quickhelp syntax elements 3371 syn match treeHelpKey #" \{1,2\}[^ ]*:#hs=s+2,he=e-13372 syn match treeHelpKey #" \{1,2\}[^ ]*,#hs=s+2,he=e-13373 syn match treeHelpTitle #" .*\~#hs=s+2,he=e-1 contains=treeFlag3374 syn match treeToggleOn #".*(on)#hs=e-2,he=e-1 contains=treeHelpKey3375 syn match treeToggleOff #".*(off)#hs=e-3,he=e-1 contains=treeHelpKey3376 syn match treeHelpCommand #" :.\{-}\>#hs=s+33377 syn match treeHelp #^".*# contains=treeHelpKey,treeHelpTitle,treeFlag,treeToggleOff,treeToggleOn,treeHelpCommand3437 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 3378 3444 3379 3445 "highlighting for readonly files 3380 syn match treeRO #.*\[RO\]#hs=s+2 contains=treeFlag,treeBookmark,treePart,treePartFile3446 syn match NERDTreeRO #.*\[RO\]#hs=s+2 contains=NERDTreeFlag,NERDTreeBookmark,NERDTreePart,NERDTreePartFile 3381 3447 3382 3448 "highlighting for sym links 3383 syn match treeLink #[^-| `].* -> # contains=treeBookmark,treeOpenable,treeClosable,treeDirSlash3449 syn match NERDTreeLink #[^-| `].* -> # contains=NERDTreeBookmark,NERDTreeOpenable,NERDTreeClosable,NERDTreeDirSlash 3384 3450 3385 3451 "highlighing for directory nodes and file nodes 3386 syn match treeDirSlash #/#3387 syn match treeDir #[^-| `].*/# contains=treeLink,treeDirSlash,treeOpenable,treeClosable3388 syn match treeExecFile #[|`]-.*\*\($\| \)# contains=treeLink,treePart,treeRO,treePartFile,treeBookmark3389 syn match treeFile #|-.*# contains=treeLink,treePart,treeRO,treePartFile,treeBookmark,treeExecFile3390 syn match treeFile #`-.*# contains=treeLink,treePart,treeRO,treePartFile,treeBookmark,treeExecFile3391 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 #^[</].*$# 3392 3458 3393 3459 "highlighting for bookmarks 3394 syn match treeBookmark # {.*}#hs=s+13460 syn match NERDTreeBookmark # {.*}#hs=s+1 3395 3461 3396 3462 "highlighting for the bookmarks table 3397 syn match treeBookmarksLeader #^>#3398 syn match treeBookmarksHeader #^>-\+Bookmarks-\+$# contains=treeBookmarksLeader3399 syn match treeBookmarkName #^>.\{-} #he=e-1 contains=treeBookmarksLeader3400 syn match treeBookmark #^>.*$# contains=treeBookmarksLeader,treeBookmarkName,treeBookmarksHeader3463 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 3401 3467 3402 3468 if g:NERDChristmasTree 3403 hi def link treePart Special3404 hi def link treePartFile Type3405 hi def link treeFile Normal3406 hi def link treeExecFile Title3407 hi def link treeDirSlash Identifier3408 hi def link treeClosable Type3409 else 3410 hi def link treePart Normal3411 hi def link treePartFile Normal3412 hi def link treeFile Normal3413 hi def link treeClosable Title3414 endif 3415 3416 hi def link treeBookmarksHeader statement3417 hi def link treeBookmarksLeader ignore3418 hi def link treeBookmarkName Identifier3419 hi def link treeBookmark normal3420 3421 hi def link treeHelp String3422 hi def link treeHelpKey Identifier3423 hi def link treeHelpCommand Identifier3424 hi def link treeHelpTitle Macro3425 hi def link treeToggleOn Question3426 hi def link treeToggleOff WarningMsg3427 3428 hi def link treeDir Directory3429 hi def link treeUp Directory3430 hi def link treeCWD Statement3431 hi def link treeLink Macro3432 hi def link treeOpenable Title3433 hi def link treeFlag ignore3434 hi def link treeRO WarningMsg3435 hi def link treeBookmark Statement3469 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 3436 3502 3437 3503 hi def link NERDTreeCurrentNode Search … … 3460 3526 3461 3527 let wasdir = 0 3462 if line =~ '/$'3528 if line =~# '/$' 3463 3529 let wasdir = 1 3464 3530 endif … … 3613 3679 if currentNode != {} 3614 3680 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 3619 3682 if currentNode.path.isDirectory 3620 if startToCur =~ s:tree_markup_reg . '$' && char =~ '[+~]'3683 if startToCur =~# s:tree_markup_reg . '$' && startToCur =~# '[+~▾▸]$' 3621 3684 call s:activateNode(0) 3622 3685 return … … 3625 3688 3626 3689 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 3628 3692 call s:activateNode(0) 3629 3693 return … … 4025 4089 function! s:upDir(keepState) 4026 4090 let cwd = b:NERDTreeRoot.path.str({'format': 'UI'}) 4027 if cwd ==# "/" || cwd =~ '^[^/]..$'4091 if cwd ==# "/" || cwd =~# '^[^/]..$' 4028 4092 call s:echo("already at top dir") 4029 4093 else
Note: See TracChangeset
for help on using the changeset viewer.
