aboutsummaryrefslogtreecommitdiff
path: root/autoload
diff options
context:
space:
mode:
authormitermayer <mitermayer@gmail.com>2020-03-21 22:30:42 +1100
committermitermayer <mitermayer@gmail.com>2020-03-21 23:38:46 +1100
commitf10100e0b48effa9a20052ea9fc634b521c0072d (patch)
tree13092d917024c2644d6c1c0b5fd99ef2ac446838 /autoload
parent7041b9cb8bee84f432f1e168f826a90a0beea93a (diff)
downloadvim-prettier-f10100e0b48effa9a20052ea9fc634b521c0072d.tar.xz
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
Diffstat (limited to 'autoload')
-rw-r--r--autoload/prettier/job/async/neovim.vim16
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