aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormitermayer <mitermayer.reis@gmail.com>2018-05-04 12:22:51 -0700
committermitermayer <mitermayer.reis@gmail.com>2018-05-04 12:22:51 -0700
commitc4e7b924dcdc9038d23da24087544936c5013b47 (patch)
tree1d7e5548aaeae378d28dbd11b6034432afe66c15
parent4217bfb37ccd261110b9bac0903807f6db7f0aaa (diff)
downloadvim-prettier-c4e7b924dcdc9038d23da24087544936c5013b47.tar.xz
cosmetic comments and todos
-rw-r--r--autoload/prettier/job/runner.vim8
1 files changed, 6 insertions, 2 deletions
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