mirror of
https://github.com/Raimondi/delimitMate.git
synced 2025-12-06 12:44:27 +08:00
Make s:g() return default optional values. Close #186.
This commit is contained in:
@@ -29,14 +29,14 @@ function! s:s(name, value, ...) "{{{
|
||||
endfunction "}}}
|
||||
|
||||
function! s:g(name, ...) "{{{
|
||||
let scope = a:0 ? a:1 : 's'
|
||||
if scope == 's'
|
||||
let bufnr = bufnr('%')
|
||||
let name = 'options.' . bufnr . '.' . a:name
|
||||
if a:0 == 2
|
||||
return deepcopy(get(a:2, 'delimitMate_' . a:name, a:1))
|
||||
elseif a:0 == 1
|
||||
let bufoptions = get(s:options, bufnr('%'), {})
|
||||
return deepcopy(get(bufoptions, a:name, a:1))
|
||||
else
|
||||
let name = 'delimitMate_' . a:name
|
||||
return deepcopy(eval('s:options.' . bufnr('%') . '.' . a:name))
|
||||
endif
|
||||
return deepcopy(eval(scope . ':' . name))
|
||||
endfunction "}}}
|
||||
|
||||
function! s:exists(name, ...) "{{{
|
||||
|
||||
Reference in New Issue
Block a user