nerdtree

A tree explorer plugin for vim.
Index Commits Files Refs
commit ee4d42cfed64deb249988cbada025011032a3ff4
parent dd754c7bc64f8802ab6ff660776e1dee0e0e2761
Author: Martin Grenfell <martin.grenfell@gmail.com>
Date:   Sun, 22 Nov 2015 14:02:56 +0000

encapsulate dep on g:NERDTreeMinimalUI in a function

Diffstat:
Mlib/nerdtree/ui.vim | 13+++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/lib/nerdtree/ui.vim b/lib/nerdtree/ui.vim
@@ -116,7 +116,7 @@ function! s:UI._dumpHelp()
         let @h=@h."\" :ClearBookmarks [<names>]\n"
         let @h=@h."\" :ClearAllBookmarks\n"
         silent! put h
-    elseif g:NERDTreeMinimalUI == 0
+    elseif !self.isMinimal()
         let @h="\" Press ". g:NERDTreeMapHelp ." for help\n"
         silent! put h
     endif
@@ -306,6 +306,11 @@ function! s:UI.isIgnoreFilterEnabled()
     return self._ignoreEnabled == 1
 endfunction
 
+"FUNCTION: s:UI.isMinimal() {{{1
+function! s:UI.isMinimal()
+    return g:NERDTreeMinimalUI
+endfunction
+
 "FUNCTION: s:UI.MarkupReg() {{{1
 function! s:UI.MarkupReg()
     if g:NERDTreeDirArrows
@@ -318,7 +323,7 @@ endfunction
 "FUNCTION: s:UI._renderBookmarks {{{1
 function! s:UI._renderBookmarks()
 
-    if g:NERDTreeMinimalUI == 0
+    if !self.isMinimal()
         call setline(line(".")+1, ">----------Bookmarks----------")
         call cursor(line(".")+1, col("."))
     endif
@@ -426,7 +431,7 @@ function! s:UI.render()
     call self._dumpHelp()
 
     "delete the blank line before the help and add one after it
-    if g:NERDTreeMinimalUI == 0
+    if !self.isMinimal()
         call setline(line(".")+1, "")
         call cursor(line(".")+1, col("."))
     endif
@@ -436,7 +441,7 @@ function! s:UI.render()
     endif
 
     "add the 'up a dir' line
-    if !g:NERDTreeMinimalUI
+    if !self.isMinimal()
         call setline(line(".")+1, s:UI.UpDirLine())
         call cursor(line(".")+1, col("."))
     endif