remove some confusing redundancy from a few function calls

This commit is contained in:
Martin Grenfell
2015-11-15 01:04:03 +00:00
parent 83d108894e
commit b4fa33c39c

View File

@@ -212,7 +212,7 @@ endfunction
function! s:UI.getLineNum(file_node) function! s:UI.getLineNum(file_node)
"if the node is the root then return the root line no. "if the node is the root then return the root line no.
if a:file_node.isRoot() if a:file_node.isRoot()
return b:NERDTree.ui.getRootLineNum() return self.getRootLineNum()
endif endif
let totalLines = line("$") let totalLines = line("$")
@@ -224,7 +224,7 @@ function! s:UI.getLineNum(file_node)
let fullpath = a:file_node.path.str({'format': 'UI'}) let fullpath = a:file_node.path.str({'format': 'UI'})
let lnum = b:NERDTree.ui.getRootLineNum() let lnum = self.getRootLineNum()
while lnum > 0 while lnum > 0
let lnum = lnum + 1 let lnum = lnum + 1
"have we reached the bottom of the tree? "have we reached the bottom of the tree?
@@ -479,7 +479,7 @@ function! s:UI.renderViewSavingPosition()
let currentNode = currentNode.parent let currentNode = currentNode.parent
endwhile endwhile
call b:NERDTree.render() call self.render()
if currentNode != {} if currentNode != {}
call currentNode.putCursorHere(0, 0) call currentNode.putCursorHere(0, 0)
@@ -495,8 +495,8 @@ endfunction
" toggles the use of the NERDTreeIgnore option " toggles the use of the NERDTreeIgnore option
function! s:UI.toggleIgnoreFilter() function! s:UI.toggleIgnoreFilter()
let self._ignoreEnabled = !self._ignoreEnabled let self._ignoreEnabled = !self._ignoreEnabled
call b:NERDTree.ui.renderViewSavingPosition() Vall self.renderViewSavingPosition()
call b:NERDTree.ui.centerView() call self.centerView()
endfunction endfunction
" FUNCTION: s:UI.toggleShowBookmarks() {{{1 " FUNCTION: s:UI.toggleShowBookmarks() {{{1
@@ -507,24 +507,24 @@ function! s:UI.toggleShowBookmarks()
call b:NERDTree.render() call b:NERDTree.render()
call g:NERDTree.CursorToBookmarkTable() call g:NERDTree.CursorToBookmarkTable()
else else
call b:NERDTree.ui.renderViewSavingPosition() call self.renderViewSavingPosition()
endif endif
call b:NERDTree.ui.centerView() call self.centerView()
endfunction endfunction
" FUNCTION: s:UI.toggleShowFiles() {{{1 " FUNCTION: s:UI.toggleShowFiles() {{{1
" toggles the display of hidden files " toggles the display of hidden files
function! s:UI.toggleShowFiles() function! s:UI.toggleShowFiles()
let self._showFiles = !self._showFiles let self._showFiles = !self._showFiles
call b:NERDTree.ui.renderViewSavingPosition() call self.renderViewSavingPosition()
call b:NERDTree.ui.centerView() call self.centerView()
endfunction endfunction
" FUNCTION: s:UI.toggleShowHidden() {{{1 " FUNCTION: s:UI.toggleShowHidden() {{{1
" toggles the display of hidden files " toggles the display of hidden files
function! s:UI.toggleShowHidden() function! s:UI.toggleShowHidden()
let self._showHidden = !self._showHidden let self._showHidden = !self._showHidden
call b:NERDTree.ui.renderViewSavingPosition() call self.renderViewSavingPosition()
call self.centerView() call self.centerView()
endfunction endfunction