Add warning messages to deprecated function calls

This commit is contained in:
Caleb Maclennan
2021-07-29 16:49:12 +03:00
parent 8e935a6367
commit 918592cdc6

View File

@@ -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