nerdtree

A tree explorer plugin for vim.
Index Commits Files Refs
commit c20ac9c27f7a4ebcdd484f2cc97ea7085fb4d7a4
parent fc55d012ee3b57779a25b0769e0661e6ccf425a3
Author: Jason Franklin <lifecrisis@users.noreply.github.com>
Date:   Sat,  9 Dec 2017 11:33:54 -0500

Merge pull request #772 from skyblueee/stripMarkup_leadingSpaces

Remove useless argument in user interface function.
Diffstat:
Mlib/nerdtree/ui.vim | 16+++++-----------
1 file changed, 5 insertions(+), 11 deletions(-)
diff --git 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