Skip to content

Commit

Permalink
Allow hooks to change filetype and comment deilmiters (#509)
Browse files Browse the repository at this point in the history
Fixes #479
  • Loading branch information
sankhesh committed Jan 26, 2023
1 parent 98cc4a2 commit 1caf560
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions autoload/nerdcommenter.vim
Original file line number Diff line number Diff line change
Expand Up @@ -534,10 +534,10 @@ endfunction
" if this function changed the delimiters or not
" function nerdcommenter#SwitchToAlternativeDelimiters(printMsgs)
function! nerdcommenter#SwitchToAlternativeDelimiters(printMsgs) abort
call nerdcommenter#SetUp()
if exists('*NERDCommenter_before')
exe 'call NERDCommenter_before()'
endif
call nerdcommenter#SetUp()
"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'] ==# ''
Expand Down Expand Up @@ -1175,10 +1175,10 @@ endfunction
" 'Minimal', 'Toggle', 'AlignLeft', 'AlignBoth', 'Comment',
" 'Nested', 'ToEOL', 'Append', 'Insert', 'Uncomment', 'Yank'
function! nerdcommenter#Comment(mode, type) range abort
call nerdcommenter#SetUp()
if exists('*NERDCommenter_before')
exe 'call NERDCommenter_before()'
endif
call nerdcommenter#SetUp()

let isVisual = a:mode =~# '[vsx]'

Expand Down

0 comments on commit 1caf560

Please sign in to comment.