From eeabded55542f6ea43a0aad0971b58827817b25c Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Thu, 29 Jul 2021 16:57:29 +0300 Subject: [PATCH] Pass range data through, error on case we can't shim --- plugin/nerdcommenter.vim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugin/nerdcommenter.vim b/plugin/nerdcommenter.vim index 0bc51eb..471d988 100644 --- a/plugin/nerdcommenter.vim +++ b/plugin/nerdcommenter.vim @@ -100,10 +100,14 @@ call s:CreateMaps('', ':', '-Sep3-', '') call s:CreateMaps('', ':help NERDCommenterContents', 'Help', '') " Shim functions so old code gets passed through to the autoload functions -function! NERDComment(mode, type) +function! NERDComment(mode, type) range if !g:NERDSuppressWarnings echom "Function NERDComment() has been deprecated, please use nerdcommenter#Comment() instead" endif + if a:firstline != a:lastline + echoerr "Sorry! We can't pass a range through this deprecation shim, please update your code." + return v:false + endif return nerdcommenter#Comment(a:mode, a:type) endfunction