diff --git a/lib/nerdtree/ui.vim b/lib/nerdtree/ui.vim index 28bf445..ad7bd19 100644 --- a/lib/nerdtree/ui.vim +++ b/lib/nerdtree/ui.vim @@ -164,14 +164,14 @@ function! s:UI.getPath(ln) let indent = self._indentLevelFor(line) "remove the tree parts and the leading space - let curFile = self._stripMarkup(line, 0) + let curFile = self._stripMarkup(line) let dir = "" let lnum = a:ln while lnum > 0 let lnum = lnum - 1 let curLine = getline(lnum) - let curLineStripped = self._stripMarkup(curLine, 1) + let curLineStripped = self._stripMarkup(curLine) "have we reached the top of the tree? if lnum == rootLine @@ -222,7 +222,7 @@ function! s:UI.getLineNum(file_node) let indent = self._indentLevelFor(curLine) if indent ==# curPathComponent - let curLine = self._stripMarkup(curLine, 1) + let curLine = self._stripMarkup(curLine) let curPath = join(pathcomponents, '/') . '/' . curLine if stridx(fullpath, curPath, 0) ==# 0 @@ -360,14 +360,12 @@ function! s:UI.setShowHidden(val) let self._showHidden = a:val endfunction -"FUNCTION: s:UI._stripMarkup(line, removeLeadingSpaces){{{1 +"FUNCTION: s:UI._stripMarkup(line){{{1 "returns the given line with all the tree parts stripped off " "Args: "line: the subject line -"removeLeadingSpaces: 1 if leading spaces are to be removed (leading spaces = -"any spaces before the actual text of the node) -function! s:UI._stripMarkup(line, removeLeadingSpaces) +function! s:UI._stripMarkup(line) let line = a:line "remove the tree parts and the leading space let line = substitute (line, g:NERDTreeUI.MarkupReg(),"","") @@ -386,10 +384,6 @@ function! s:UI._stripMarkup(line, removeLeadingSpaces) let line = substitute (line,' -> .*',"","") " remove link to - if a:removeLeadingSpaces - let line = substitute (line, '^ *', '', '') - endif - return line endfunction