diff --git a/autoload/neoformat.vim b/autoload/neoformat.vim index 0b7449f7..8638f013 100644 --- a/autoload/neoformat.vim +++ b/autoload/neoformat.vim @@ -9,6 +9,10 @@ function! neoformat#Neoformat(user_formatter) abort return neoformat#utils#warn('Neovim, or Vim with job control, is currently required to run this plugin') endif + if !&modifiable + return neoformat#utils#warn('buffer not modifiable') + endif + if !empty(a:user_formatter) let formatter = a:user_formatter else @@ -48,6 +52,8 @@ function! neoformat#Neoformat(user_formatter) abort return neoformat#NextNeoformat() endif + call neoformat#utils#log(cmd) + return neoformat#run#Neoformat(cmd) endfunction