From f10100e0b48effa9a20052ea9fc634b521c0072d Mon Sep 17 00:00:00 2001 From: mitermayer Date: Sat, 21 Mar 2020 22:30:42 +1100 Subject: bugfix/issue-229-fixing-neovim-0-4-compatibility - Updated nvim test version to latest 0.4.3 on Dockerfile - Updated nvim async job to behave similar to vim8 - Removing support for python plugins since it has been archieved from repository - bumping prettier dep - updating snapshots --- autoload/prettier/job/async/neovim.vim | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'autoload') 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 -- cgit v1.3