diff --git a/autoload/argwrap.vim b/autoload/argwrap.vim index 3693b85..c7b5049 100644 --- a/autoload/argwrap.vim +++ b/autoload/argwrap.vim @@ -259,9 +259,19 @@ function! argwrap#toggle() if l:range.lineStart == l:range.lineEnd call argwrap#wrapContainer(l:range, l:container, l:arguments, l:wrapBrace, l:tailComma, l:tailCommaBraces, l:tailIndentBraces, l:linePrefix, l:commaFirst, l:commaFirstIndent) let l:cursor[1] = l:range.lineStart + 1 + + let l:filetypeHook = printf('argwrap#hooks#%s#post_wrap', &filetype) + if exists('*'.l:filetypeHook) + call call(l:filetypeHook, [l:range, l:container, l:arguments]) + endif else call argwrap#unwrapContainer(l:range, l:container, l:arguments, l:padded) let l:cursor[1] = l:range.lineStart + + let l:filetypeHook = printf('argwrap#hooks#%s#post_unwrap', &filetype) + if exists('*'.l:filetypeHook) + call call(l:filetypeHook, [l:range, l:container, l:arguments]) + endif endif call setpos('.', l:cursor)