Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove useless substitute when 'file =~# "/$"' #773

Merged
merged 1 commit into from
Dec 9, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions lib/nerdtree/ui.vim
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,6 @@ function! s:UI.getPath(ln)
"remove the tree parts and the leading space
let curFile = self._stripMarkup(line, 0)

let wasdir = 0
if curFile =~# '/$'
let wasdir = 1
let curFile = substitute(curFile, '/\?$', '/', "")
endif

let dir = ""
let lnum = a:ln
while lnum > 0
Expand Down Expand Up @@ -390,14 +384,7 @@ function! s:UI._stripMarkup(line, removeLeadingSpaces)
"strip off any generic flags
let line = substitute (line, '\[[^]]*\]', "","")

let wasdir = 0
if line =~# '/$'
let wasdir = 1
endif
let line = substitute (line,' -> .*',"","") " remove link to
if wasdir ==# 1
let line = substitute (line, '/\?$', '/', "")
endif

if a:removeLeadingSpaces
let line = substitute (line, '^ *', '', '')
Expand Down