mirror of
https://github.com/preservim/nerdtree.git
synced 2025-11-10 12:23:49 -05:00
refactor 3 more functions out of the monolithic autoload file
This commit is contained in:
@@ -95,25 +95,6 @@ function! nerdtree#runningWindows()
|
||||
return has("win16") || has("win32") || has("win64")
|
||||
endfunction
|
||||
|
||||
"FUNCTION: nerdtree#treeMarkupReg(dir) {{{2
|
||||
function! nerdtree#treeMarkupReg()
|
||||
if g:NERDTreeDirArrows
|
||||
return '^\([▾▸] \| \+[▾▸] \| \+\)'
|
||||
endif
|
||||
|
||||
return '^[ `|]*[\-+~]'
|
||||
endfunction
|
||||
|
||||
"FUNCTION: nerdtree#treeUpDirLine(dir) {{{2
|
||||
function! nerdtree#treeUpDirLine()
|
||||
return '.. (up a dir)'
|
||||
endfunction
|
||||
|
||||
"FUNCTION: nerdtree#treeWid(dir) {{{2
|
||||
function! nerdtree#treeWid()
|
||||
return 2
|
||||
endfunction
|
||||
|
||||
" SECTION: View Functions {{{1
|
||||
"============================================================
|
||||
|
||||
@@ -374,7 +355,7 @@ endfunction
|
||||
function! nerdtree#stripMarkupFromLine(line, removeLeadingSpaces)
|
||||
let line = a:line
|
||||
"remove the tree parts and the leading space
|
||||
let line = substitute (line, nerdtree#treeMarkupReg(),"","")
|
||||
let line = substitute (line, g:NERDTreeUI.MarkupReg(),"","")
|
||||
|
||||
"strip off any read only flag
|
||||
let line = substitute (line, ' \[RO\]', "","")
|
||||
|
||||
@@ -85,7 +85,7 @@ endfunction
|
||||
"FUNCTION: s:activateAll() {{{1
|
||||
"handle the user activating the updir line
|
||||
function! s:activateAll()
|
||||
if getline(".") ==# nerdtree#treeUpDirLine()
|
||||
if getline(".") ==# g:NERDTreeUI.UpDirLine()
|
||||
return nerdtree#ui_glue#upDir(0)
|
||||
endif
|
||||
endfunction
|
||||
@@ -312,7 +312,7 @@ function! s:handleLeftClick()
|
||||
endfor
|
||||
|
||||
if currentNode.path.isDirectory
|
||||
if startToCur =~# nerdtree#treeMarkupReg() && startToCur =~# '[+~▾▸] \?$'
|
||||
if startToCur =~# g:NERDTreeUI.MarkupReg() && startToCur =~# '[+~▾▸] \?$'
|
||||
call currentNode.activate()
|
||||
return
|
||||
endif
|
||||
@@ -320,7 +320,7 @@ function! s:handleLeftClick()
|
||||
|
||||
if (g:NERDTreeMouseMode ==# 2 && currentNode.path.isDirectory) || g:NERDTreeMouseMode ==# 3
|
||||
let char = strpart(startToCur, strlen(startToCur)-1, 1)
|
||||
if char !~# nerdtree#treeMarkupReg()
|
||||
if char !~# g:NERDTreeUI.MarkupReg()
|
||||
if currentNode.path.isDirectory
|
||||
call currentNode.activate()
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user