diff options
| author | Mitermayer Reis <mitermayer.reis@gmail.com> | 2020-03-21 23:45:17 +1100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-03-21 23:45:17 +1100 |
| commit | b016b933523b428c664d7a02a69c9b499c600abb (patch) | |
| tree | 13092d917024c2644d6c1c0b5fd99ef2ac446838 /autoload | |
| parent | 7041b9cb8bee84f432f1e168f826a90a0beea93a (diff) | |
| parent | f10100e0b48effa9a20052ea9fc634b521c0072d (diff) | |
| download | vim-prettier-b016b933523b428c664d7a02a69c9b499c600abb.tar.xz | |
Merge pull request #231 from prettier/bugfix/issue-229-fixing-neovim-0-4-compatibility
bugfix/issue-229-fixing-neovim-0-4-compatibility
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 |
