diff --git a/plugin/NERD_commenter.vim b/plugin/NERD_commenter.vim index 3e96847..3c854e7 100644 --- a/plugin/NERD_commenter.vim +++ b/plugin/NERD_commenter.vim @@ -555,6 +555,9 @@ endfunction " -printMsgs: if this is 1 then a message is echoed to the user telling them " if this function changed the delimiters or not function s:SwitchToAlternativeDelimiters(printMsgs) + if exists('*NERDCommenter_before') + exe "call NERDCommenter_before()" + endif "if both of the alternative delimiters are empty then there is no "alternative comment style so bail out if b:NERDCommenterDelims['leftAlt'] == '' && b:NERDCommenterDelims['rightAlt'] == '' @@ -585,6 +588,10 @@ function s:SwitchToAlternativeDelimiters(printMsgs) call s:NerdEcho("Now using " . s:Left() . " " . s:Right() . " to delimit comments", 1) endif + if exists('*NERDCommenter_after') + exe "call NERDCommenter_after()" + endif + return 1 endfunction @@ -1151,6 +1158,10 @@ endfunction " 'Minimal', 'Toggle', 'AlignLeft', 'AlignBoth', 'Comment', " 'Nested', 'ToEOL', 'Append', 'Insert', 'Uncomment', 'Yank' function! NERDComment(mode, type) range + if exists('*NERDCommenter_before') + exe "call NERDCommenter_before()" + endif + let isVisual = a:mode =~ '[vsx]' if !exists("g:did_load_ftplugin") || g:did_load_ftplugin != 1 @@ -1255,6 +1266,11 @@ function! NERDComment(mode, type) range else silent! call repeat#set("\NERDCommenter". a:type) endif + + if exists('*NERDCommenter_after') + exe "call NERDCommenter_after()" + endif + endfunction " Function: s:PlaceDelimitersAndInsBetween() function {{{2