Skip to content

Commit

Permalink
refactor: default argument with variadic arguments.
Browse files Browse the repository at this point in the history
  • Loading branch information
rzvxa committed Feb 5, 2024
1 parent 0aac752 commit 7fe46a2
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions lib/nerdtree/creator.vim
Original file line number Diff line number Diff line change
Expand Up @@ -245,13 +245,18 @@ function! s:Creator.New()
endfunction

" FUNCTION: s:Creator._nextBufferName(type='') {{{1
" gets a buffer type of either 'tab' or 'win', defaults to unknown
" gets an optional buffer type of either 'tab' or 'win'.
" returns the buffer name for the next nerd tree of such type.
function! s:Creator._nextBufferName(type='')
function! s:Creator._nextBufferName(...)
if a:0 > 0
let type = a:1
else
let type = ''
end
let name = s:Creator.BufNamePrefix()
if a:type == 'tab'
if type == 'tab'
let name = name . 'tab_'
elseif a:type == 'win'
elseif type == 'win'
let name = name . 'win_'
endif
let name = name . self._nextBufferNumber()
Expand Down

0 comments on commit 7fe46a2

Please sign in to comment.