Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow hooks to change filetype and comment deilmiters #509

Merged
merged 1 commit into from
Jan 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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