aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormitermayer <mitermayer.reis@gmail.com>2018-05-04 12:22:51 -0700
committermitermayer <mitermayer.reis@gmail.com>2019-08-25 21:11:49 -0700
commit00e9c212be5c4c9cfda1cace8e38d2de8bf46295 (patch)
treea09fa56dec8acd913606cb64a1c804688d6ec62b
parentcf1da397d4416d887e47b54e872ad524bf394075 (diff)
downloadvim-prettier-00e9c212be5c4c9cfda1cace8e38d2de8bf46295.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