mirror of
https://github.com/preservim/nerdcommenter.git
synced 2025-11-14 12:43:47 -05:00
Add warning messages to deprecated function calls
This commit is contained in:
@@ -42,6 +42,7 @@ call s:InitVariable('g:NERDDefaultAlign', 'none')
|
||||
call s:InitVariable('g:NERDTrimTrailingWhitespace', 0)
|
||||
call s:InitVariable('g:NERDToggleCheckAllLines', 0)
|
||||
call s:InitVariable('g:NERDDisableTabsInBlockComm', 0)
|
||||
call s:InitVariable('g:NERDSuppressWarnings', 0)
|
||||
|
||||
" Section: Comment mapping and menu item setup
|
||||
" ===========================================================================
|
||||
@@ -100,14 +101,23 @@ call s:CreateMaps('', ':help NERDCommenterContents<CR>', 'Help', '')
|
||||
|
||||
" Shim functions so old code gets passed through to the autoload functions
|
||||
function! NERDComment(mode, type)
|
||||
if !g:NERDSuppressWarnings
|
||||
echom "Function NERDComment() has been deprecated, please use nerdcommenter#Comment() instead"
|
||||
endif
|
||||
return nerdcommenter#Comment(a:mode, a:type)
|
||||
endfunction
|
||||
|
||||
function! NERDCommentIsLineCommented(lineNo)
|
||||
if !g:NERDSuppressWarnings
|
||||
echom "Function NERDCommentIsLineCommented() has been deprecated, please use nerdcommenter#IsLineCommented() instead"
|
||||
endif
|
||||
return nerdcommenter#IsLineCommented(a:lineNo)
|
||||
endfunction
|
||||
|
||||
function! NERDCommentIsCharCommented(line, col)
|
||||
if !g:NERDSuppressWarnings
|
||||
echom "Function NERDCommentIsCharCommented() has been deprecated, please use nerdcommenter#IsCharCommented() instead"
|
||||
endif
|
||||
return nerdcommenter#IsCharCommented(a:line, a:col)
|
||||
endfunction
|
||||
|
||||
|
||||
Reference in New Issue
Block a user