From f21b0f8faba535e051f64112b3bfd64034ded59b Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Thu, 29 Jul 2021 16:23:49 +0300 Subject: [PATCH] Add shim functions to pass through to autoload namespace --- plugin/nerdcommenter.vim | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plugin/nerdcommenter.vim b/plugin/nerdcommenter.vim index 33eba31..c4c4497 100644 --- a/plugin/nerdcommenter.vim +++ b/plugin/nerdcommenter.vim @@ -78,6 +78,7 @@ function! s:CreateMaps(modes, target, desc, combo) endif endfor endfunction + call s:CreateMaps('nx', 'Comment', 'Comment', 'cc') call s:CreateMaps('nx', 'Toggle', 'Toggle', 'c') call s:CreateMaps('nx', 'Minimal', 'Minimal', 'cm') @@ -97,6 +98,15 @@ call s:CreateMaps('i', 'Insert', 'Insert Comment Here', '') 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) + return nerdcommenter#Comment(a:mode, a:type) +endfunction + +function! NERDCommentIsLineCommented(lineNo) + return nerdcommenter#IsLineCommented(a:lineNo) +endfunction + inoremap NERDCommenterInsert :call nerdcommenter#Comment('i', "insert") " switch to/from alternative delimiters (does not use wrapper function)