diff options
| author | mitermayer <mitermayer.reis@gmail.com> | 2019-09-14 04:55:30 +0000 |
|---|---|---|
| committer | mitermayer <mitermayer.reis@gmail.com> | 2019-09-14 05:06:26 +0000 |
| commit | cacdf22fdeef9998d304be2e6330d14b4cd1d3d7 (patch) | |
| tree | 85088e6004c51463e227c647ce7af2de76d976a3 | |
| parent | e98b108ded5c906dde32db2f9856184e00dfc945 (diff) | |
| download | vim-prettier-cacdf22fdeef9998d304be2e6330d14b4cd1d3d7.tar.xz | |
issues/184-fixing-undo-step - Writting should not trigger autocomands
- when formatting files we should not trigger auto commands
| -rw-r--r-- | autoload/prettier/job/async/neovim.vim | 4 | ||||
| -rw-r--r-- | autoload/prettier/utils/buffer.vim | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/autoload/prettier/job/async/neovim.vim b/autoload/prettier/job/async/neovim.vim index 1cffe5c..28ecb8a 100644 --- a/autoload/prettier/job/async/neovim.vim +++ b/autoload/prettier/job/async/neovim.vim @@ -73,7 +73,7 @@ function! s:onExit(status, info, out, err) abort try silent exec 'sp '. escape(bufname(a:info.buf_nr), ' \') call nvim_buf_set_lines(a:info.buf_nr, a:info.start, a:info.end, 0, l:out) - write + noautocmd write catch call prettier#logging#error#log('PARSING_ERROR') finally @@ -91,7 +91,7 @@ function! s:onExit(status, info, out, err) abort " TODO " we should be auto saving in order to work similar to vim8 call nvim_buf_set_lines(a:info.buf_nr, a:info.start, a:info.end, 0, l:out) - write + noautocmd write endif let s:prettier_job_running = 0 diff --git a/autoload/prettier/utils/buffer.vim b/autoload/prettier/utils/buffer.vim index c22fec7..d09c568 100644 --- a/autoload/prettier/utils/buffer.vim +++ b/autoload/prettier/utils/buffer.vim @@ -28,7 +28,7 @@ endfunction " Replace and save the buffer function! prettier#utils#buffer#replaceAndSave(lines, startSelection, endSelection) abort call prettier#utils#buffer#replace(a:lines, a:startSelection, a:endSelection) - write + noautocmd write endfunction " Returns 1 if content has changed |
