From c4e7b924dcdc9038d23da24087544936c5013b47 Mon Sep 17 00:00:00 2001 From: mitermayer Date: Fri, 4 May 2018 12:22:51 -0700 Subject: cosmetic comments and todos --- autoload/prettier/job/runner.vim | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'autoload/prettier') diff --git a/autoload/prettier/job/runner.vim b/autoload/prettier/job/runner.vim index f5291dd..02dc9d9 100644 --- a/autoload/prettier/job/runner.vim +++ b/autoload/prettier/job/runner.vim @@ -4,9 +4,9 @@ " TODO " we are currently feature protecting async on NVIM with g:prettier#nvim_unstable_async " we should remove this once its fully supported +let s:isLegacyVim = v:version < 800 let s:isNeoVim = has('nvim') && g:prettier#nvim_unstable_async -let s:isAsyncVim = v:version >= 800 && exists('*job_start') -let s:isLegacyVim = v:version <= 800 +let s:isAsyncVim = !s:isLegacyVim && exists('*job_start') function! prettier#job#runner#run(cmd, startSelection, endSelection, async) abort if a:async && (s:isAsyncVim || s:isNeoVim) @@ -37,6 +37,8 @@ function! s:format(cmd, startSelection, endSelection) abort " vim 7 does not have support for passing a list to system() let l:bufferLines = s:isLegacyVim ? join(l:bufferLinesList, "\n") : l:bufferLinesList + " TODO + " since we are using two different types for system, maybe we should move it to utils shims let l:out = split(system(a:cmd, l:bufferLines), '\n') " check system exit code @@ -45,6 +47,8 @@ function! s:format(cmd, startSelection, endSelection) abort return endif + " TODO + " doing 0 checks seems weird can we do this bellow differently ? if (prettier#utils#buffer#willUpdatedLinesChangeBuffer(l:out, a:startSelection, a:endSelection) == 0) return endif -- cgit v1.3