diff options
Diffstat (limited to 'autoload')
| -rw-r--r-- | autoload/prettier/job/async/neovim.vim | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/autoload/prettier/job/async/neovim.vim b/autoload/prettier/job/async/neovim.vim index 28ecb8a..7f69f4e 100644 --- a/autoload/prettier/job/async/neovim.vim +++ b/autoload/prettier/job/async/neovim.vim @@ -55,11 +55,12 @@ function! s:onExit(status, info, out, err) abort endif " we have no prettier output so lets exit - if len(a:out) == 0 | return | endif + if len(l:out) == 0 | return | endif " nothing to update if (prettier#utils#buffer#willUpdatedLinesChangeBuffer(l:out, a:info.start, a:info.end) == 0) let s:prettier_job_running = 0 + redraw! return endif @@ -72,8 +73,7 @@ function! s:onExit(status, info, out, err) abort if (bufloaded(a:info.buf_nr)) 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) - noautocmd write + call prettier#utils#buffer#replaceAndSave(l:out, a:info.start, a:info.end) catch call prettier#logging#error#log('PARSING_ERROR') finally @@ -84,15 +84,7 @@ function! s:onExit(status, info, out, err) abort endtry endif else - " TODO - " move this to the buffer util and let it abstract away the saving buffer - " from here - " - " 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) - noautocmd write + call prettier#utils#buffer#replaceAndSave(l:out, a:info.start, a:info.end) endif - let s:prettier_job_running = 0 endfunction |
