mirror of
https://github.com/preservim/nerdcommenter.git
synced 2025-02-01 05:57:16 +08:00
add config support for default delims
if there are no configured delims for the current filetype, allow the default delims to be defined by a global setting since c style comment delims are not always the best defaults for everyone.
This commit is contained in:
parent
69a575e70a
commit
0c04654498
|
@ -441,6 +441,15 @@ function s:SetUpForNewFiletype(filetype, forceReset)
|
|||
endfunction
|
||||
|
||||
function s:CreateDelimMapFromCms()
|
||||
if exists('g:NERDDefaultDelims')
|
||||
let delims = g:NERDDefaultDelims
|
||||
for i in ['left', 'leftAlt', 'right', 'rightAlt']
|
||||
if !has_key(delims, i)
|
||||
let delims[i] = ''
|
||||
endif
|
||||
endfor
|
||||
return delims
|
||||
endif
|
||||
return {
|
||||
\ 'left': substitute(&commentstring, '\([^ \t]*\)\s*%s.*', '\1', ''),
|
||||
\ 'right': substitute(&commentstring, '.*%s\s*\(.*\)', '\1', 'g'),
|
||||
|
|
Loading…
Reference in New Issue
Block a user