mirror of
https://github.com/preservim/nerdcommenter.git
synced 2024-12-01 21:24:25 +08:00
make NERDComment a global function again
This commit is contained in:
parent
27580f8777
commit
0c75ae7e7b
|
@ -1020,7 +1020,7 @@ function s:InvertComment(firstLine, lastLine)
|
||||||
endwhile
|
endwhile
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Function: s:NERDComment(mode, type) function {{{2
|
" Function: NERDComment(mode, type) function {{{2
|
||||||
" This function is a Wrapper for the main commenting functions
|
" This function is a Wrapper for the main commenting functions
|
||||||
"
|
"
|
||||||
" Args:
|
" Args:
|
||||||
|
@ -1029,7 +1029,7 @@ endfunction
|
||||||
" -type: the type of commenting requested. Can be 'Sexy', 'Invert',
|
" -type: the type of commenting requested. Can be 'Sexy', 'Invert',
|
||||||
" 'Minimal', 'Toggle', 'AlignLeft', 'AlignBoth', 'Comment',
|
" 'Minimal', 'Toggle', 'AlignLeft', 'AlignBoth', 'Comment',
|
||||||
" 'Nested', 'ToEOL', 'Append', 'Insert', 'Uncomment', 'Yank'
|
" 'Nested', 'ToEOL', 'Append', 'Insert', 'Uncomment', 'Yank'
|
||||||
function! s:NERDComment(mode, type) range
|
function! NERDComment(mode, type) range
|
||||||
let isVisual = a:mode =~ '[vsx]'
|
let isVisual = a:mode =~ '[vsx]'
|
||||||
" we want case sensitivity when commenting
|
" we want case sensitivity when commenting
|
||||||
let oldIgnoreCase = &ignorecase
|
let oldIgnoreCase = &ignorecase
|
||||||
|
@ -1123,7 +1123,7 @@ function! s:NERDComment(mode, type) range
|
||||||
else
|
else
|
||||||
normal! yy
|
normal! yy
|
||||||
endif
|
endif
|
||||||
execute firstLine .','. lastLine .'call s:NERDComment("'. a:mode .'", "Comment")'
|
execute firstLine .','. lastLine .'call NERDComment("'. a:mode .'", "Comment")'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let &ignorecase = oldIgnoreCase
|
let &ignorecase = oldIgnoreCase
|
||||||
|
@ -2699,9 +2699,9 @@ endfunction
|
||||||
" also define mappings and show a:combo in the menu items.
|
" also define mappings and show a:combo in the menu items.
|
||||||
function! s:CreateMaps(modes, target, desc, combo)
|
function! s:CreateMaps(modes, target, desc, combo)
|
||||||
" Build up a map command like
|
" Build up a map command like
|
||||||
" 'noremap <silent> <plug>NERDCommenterComment :call <SID>NERDComment("n", "Comment")'
|
" 'noremap <silent> <plug>NERDCommenterComment :call NERDComment("n", "Comment")'
|
||||||
let plug = '<plug>NERDCommenter' . a:target
|
let plug = '<plug>NERDCommenter' . a:target
|
||||||
let plug_start = 'noremap <silent> ' . plug . ' :call <SID>NERDComment("'
|
let plug_start = 'noremap <silent> ' . plug . ' :call NERDComment("'
|
||||||
let plug_end = '", "' . a:target . '")<cr>'
|
let plug_end = '", "' . a:target . '")<cr>'
|
||||||
" Build up a menu command like
|
" Build up a menu command like
|
||||||
" 'menu <silent> comment.Comment<Tab>\\cc <plug>NERDCommenterComment'
|
" 'menu <silent> comment.Comment<Tab>\\cc <plug>NERDCommenterComment'
|
||||||
|
|
Loading…
Reference in New Issue
Block a user