Add shim functions to pass through to autoload namespace

This commit is contained in:
Caleb Maclennan
2021-07-29 16:23:49 +03:00
parent 47ab32444d
commit f21b0f8fab

View File

@@ -78,6 +78,7 @@ function! s:CreateMaps(modes, target, desc, combo)
endif endif
endfor endfor
endfunction endfunction
call s:CreateMaps('nx', 'Comment', 'Comment', 'cc') call s:CreateMaps('nx', 'Comment', 'Comment', 'cc')
call s:CreateMaps('nx', 'Toggle', 'Toggle', 'c<Space>') call s:CreateMaps('nx', 'Toggle', 'Toggle', 'c<Space>')
call s:CreateMaps('nx', 'Minimal', 'Minimal', 'cm') 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('', ':', '-Sep3-', '')
call s:CreateMaps('', ':help NERDCommenterContents<CR>', 'Help', '') call s:CreateMaps('', ':help NERDCommenterContents<CR>', '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 <silent> <Plug>NERDCommenterInsert <Space><BS><Esc>:call nerdcommenter#Comment('i', "insert")<CR> inoremap <silent> <Plug>NERDCommenterInsert <Space><BS><Esc>:call nerdcommenter#Comment('i', "insert")<CR>
" switch to/from alternative delimiters (does not use wrapper function) " switch to/from alternative delimiters (does not use wrapper function)