mirror of
https://github.com/preservim/nerdcommenter.git
synced 2025-11-15 13:13:47 -05:00
Added modes argument, deleted root argument from s:CreateMenuItems().
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
" Description: vim global plugin that provides easy code commenting
|
" Description: vim global plugin that provides easy code commenting
|
||||||
" Maintainer: Martin Grenfell <martin.grenfell at gmail dot com>
|
" Maintainer: Martin Grenfell <martin.grenfell at gmail dot com>
|
||||||
" Version: 2.3.0
|
" Version: 2.3.0
|
||||||
" Last Change: 08th December, 2010
|
" Last Change: Tue Dec 06 09:00 AM 2011 Eastern Standard Time
|
||||||
" License: This program is free software. It comes without any warranty,
|
" License: This program is free software. It comes without any warranty,
|
||||||
" to the extent permitted by applicable law. You can redistribute
|
" to the extent permitted by applicable law. You can redistribute
|
||||||
" it and/or modify it under the terms of the Do What The Fuck You
|
" it and/or modify it under the terms of the Do What The Fuck You
|
||||||
@@ -2792,24 +2792,25 @@ if g:NERDMenuMode != 0
|
|||||||
let menuRoot = '&Plugin.&comment'
|
let menuRoot = '&Plugin.&comment'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
function! s:CreateMenuItems(target, desc, root)
|
function! s:CreateMenuItems(modes, target, desc)
|
||||||
exec 'nmenu <silent> ' . a:root . '.' . a:desc . ' ' . a:target
|
for mode in split(a:modes, '\zs')
|
||||||
exec 'vmenu <silent> ' . a:root . '.' . a:desc . ' ' . a:target
|
exec mode . 'menu <silent> ' . g:menuRoot . '.' . a:desc . ' ' . a:target
|
||||||
|
endfor
|
||||||
endfunction
|
endfunction
|
||||||
call s:CreateMenuItems("<plug>NERDCommenterComment", 'Comment', menuRoot)
|
call s:CreateMenuItems('nv', '<plug>NERDCommenterComment', 'Comment')
|
||||||
call s:CreateMenuItems("<plug>NERDCommenterToggle", 'Toggle', menuRoot)
|
call s:CreateMenuItems('nv', '<plug>NERDCommenterToggle', 'Toggle')
|
||||||
call s:CreateMenuItems('<plug>NERDCommenterMinimal', 'Minimal', menuRoot)
|
call s:CreateMenuItems('nv', '<plug>NERDCommenterMinimal', 'Minimal')
|
||||||
call s:CreateMenuItems('<plug>NERDCommenterNest', 'Nested', menuRoot)
|
call s:CreateMenuItems('nv', '<plug>NERDCommenterNest', 'Nested')
|
||||||
exec 'nmenu <silent> '. menuRoot .'.To\ EOL <plug>NERDCommenterToEOL'
|
exec 'nmenu <silent> '. menuRoot .'.To\ EOL <plug>NERDCommenterToEOL'
|
||||||
call s:CreateMenuItems('<plug>NERDCommenterInvert', 'Invert', menuRoot)
|
call s:CreateMenuItems('nv', '<plug>NERDCommenterInvert', 'Invert')
|
||||||
call s:CreateMenuItems('<plug>NERDCommenterSexy', 'Sexy', menuRoot)
|
call s:CreateMenuItems('nv', '<plug>NERDCommenterSexy', 'Sexy')
|
||||||
call s:CreateMenuItems('<plug>NERDCommenterYank', 'Yank\ then\ comment', menuRoot)
|
call s:CreateMenuItems('nv', '<plug>NERDCommenterYank', 'Yank\ then\ comment')
|
||||||
exec 'nmenu <silent> '. menuRoot .'.Append <plug>NERDCommenterAppend'
|
exec 'nmenu <silent> '. menuRoot .'.Append <plug>NERDCommenterAppend'
|
||||||
exec 'menu <silent> '. menuRoot .'.-Sep- :'
|
exec 'menu <silent> '. menuRoot .'.-Sep- :'
|
||||||
call s:CreateMenuItems('<plug>NERDCommenterAlignLeft', 'Left\ aligned', menuRoot)
|
call s:CreateMenuItems('nv', '<plug>NERDCommenterAlignLeft', 'Left\ aligned')
|
||||||
call s:CreateMenuItems('<plug>NERDCommenterAlignBoth', 'Left\ and\ right\ aligned', menuRoot)
|
call s:CreateMenuItems('nv', '<plug>NERDCommenterAlignBoth', 'Left\ and\ right\ aligned')
|
||||||
exec 'menu <silent> '. menuRoot .'.-Sep2- :'
|
exec 'menu <silent> '. menuRoot .'.-Sep2- :'
|
||||||
call s:CreateMenuItems('<plug>NERDCommenterUncomment', 'Uncomment', menuRoot)
|
call s:CreateMenuItems('nv', '<plug>NERDCommenterUncomment', 'Uncomment')
|
||||||
exec 'nmenu <silent> '. menuRoot .'.Switch\ Delimiters <plug>NERDCommenterAltDelims'
|
exec 'nmenu <silent> '. menuRoot .'.Switch\ Delimiters <plug>NERDCommenterAltDelims'
|
||||||
exec 'imenu <silent> '. menuRoot .'.Insert\ Comment\ Here <plug>NERDCommenterInInsert'
|
exec 'imenu <silent> '. menuRoot .'.Insert\ Comment\ Here <plug>NERDCommenterInInsert'
|
||||||
exec 'menu <silent> '. menuRoot .'.-Sep3- :'
|
exec 'menu <silent> '. menuRoot .'.-Sep3- :'
|
||||||
|
|||||||
Reference in New Issue
Block a user