aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Odding <peter@peterodding.com>2011-06-27 02:46:26 +0200
committerPeter Odding <peter@peterodding.com>2011-06-27 02:46:26 +0200
commit82d2b7eb53f57bdae77e0f9f1ad2b8a0bf9dcac5 (patch)
treef7473c5a5956b5e580d07f59ccaf2cb62c0fe9ed
parent67616b25971ff0f4d785d67592128909ef5a5e49 (diff)
parent0b1c06ef1d296590b23bbe4da46faeef6541a8ba (diff)
downloadvim-easytags-82d2b7eb53f57bdae77e0f9f1ad2b8a0bf9dcac5.tar.gz
Merge branch 'master' of https://github.com/xolox/vim-misc
-rw-r--r--autoload/xolox/misc/option.vim17
1 files changed, 10 insertions, 7 deletions
diff --git a/autoload/xolox/misc/option.vim b/autoload/xolox/misc/option.vim
index 8c6d63d..8727ea1 100644
--- a/autoload/xolox/misc/option.vim
+++ b/autoload/xolox/misc/option.vim
@@ -1,15 +1,18 @@
" Vim auto-load script
" Author: Peter Odding <peter@peterodding.com>
-" Last Change: June 26, 2011
+" Last Change: June 27, 2011
" URL: http://peterodding.com/code/vim/misc/
-function! xolox#misc#option#get(name, default)
- if exists('g:' . a:name)
- return eval('g:' . a:name)
- elseif exists('b:' . a:name)
+function! xolox#misc#option#get(name, ...)
+ if exists('b:' . a:name)
+ " Buffer local variable.
return eval('b:' . a:name)
- else
- return a:default
+ elseif exists('g:' . a:name)
+ " Global variable.
+ return eval('g:' . a:name)
+ elseif exists('a:1')
+ " Default value.
+ return a:1
endif
endfunction