diff options
author | Johannes Löthberg <johannes@kyriasis.com> | 2018-07-18 22:20:20 +0200 |
---|---|---|
committer | Johannes Löthberg <johannes@kyriasis.com> | 2018-07-18 22:20:20 +0200 |
commit | af342b8fbdb1b26bc7ad7186fb16fc81bfb705e1 (patch) | |
tree | 437bd15dd41383a57a1c01f169718b5d558bc9e8 /nvim/autoload | |
parent | 0211fbccf35bcc11dc22f389b96582260245ff78 (diff) | |
download | dotfiles-af342b8fbdb1b26bc7ad7186fb16fc81bfb705e1.tar.xz |
nvim: Update Plug
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
Diffstat (limited to 'nvim/autoload')
-rw-r--r-- | nvim/autoload/plug.vim | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/nvim/autoload/plug.vim b/nvim/autoload/plug.vim index 143c377..52c6b2a 100644 --- a/nvim/autoload/plug.vim +++ b/nvim/autoload/plug.vim @@ -96,7 +96,7 @@ let s:plug_src = 'https://github.com/junegunn/vim-plug.git' let s:plug_tab = get(s:, 'plug_tab', -1) let s:plug_buf = get(s:, 'plug_buf', -1) let s:mac_gui = has('gui_macvim') && has('gui_running') -let s:is_win = has('win32') || has('win64') +let s:is_win = has('win32') let s:nvim = has('nvim-0.2') || (has('nvim') && exists('*jobwait') && !s:is_win) let s:vim8 = has('patch-8.0.0039') && exists('*job_start') let s:me = resolve(expand('<sfile>:p')) @@ -799,7 +799,7 @@ function! s:bang(cmd, ...) let cmd = a:0 ? s:with_cd(a:cmd, a:1) : a:cmd if s:is_win let batchfile = tempname().'.bat' - call writefile(['@echo off', cmd], batchfile) + call writefile(["@echo off\r", cmd . "\r"], batchfile) let cmd = batchfile endif let g:_plug_bang = (s:is_win && has('gui_running') ? 'silent ' : '').'!'.escape(cmd, '#!%') @@ -908,7 +908,7 @@ function! s:finish(pull) call add(msgs, "Press 'R' to retry.") endif if a:pull && len(s:update.new) < len(filter(getline(5, '$'), - \ "v:val =~ '^- ' && stridx(v:val, 'Already up-to-date') < 0")) + \ "v:val =~ '^- ' && v:val !~# 'Already up.to.date'")) call add(msgs, "Press 'D' to see the updated changes.") endif echo join(msgs, ' ') @@ -1196,7 +1196,7 @@ function! s:spawn(name, cmd, opts) let s:jobs[a:name] = job let cmd = has_key(a:opts, 'dir') ? s:with_cd(a:cmd, a:opts.dir) : a:cmd if !empty(job.batchfile) - call writefile(['@echo off', cmd], job.batchfile) + call writefile(["@echo off\r", cmd . "\r"], job.batchfile) let cmd = job.batchfile endif let argv = add(s:is_win ? ['cmd', '/c'] : ['sh', '-c'], cmd) @@ -2023,7 +2023,7 @@ function! s:system(cmd, ...) let cmd = a:0 > 0 ? s:with_cd(a:cmd, a:1) : a:cmd if s:is_win let batchfile = tempname().'.bat' - call writefile(['@echo off', cmd], batchfile) + call writefile(["@echo off\r", cmd . "\r"], batchfile) let cmd = batchfile endif return system(s:is_win ? '('.cmd.')' : cmd) @@ -2357,7 +2357,7 @@ function! s:preview_commit() let cmd = 'cd '.s:shellesc(g:plugs[name].dir).' && git show --no-color --pretty=medium '.sha if s:is_win let batchfile = tempname().'.bat' - call writefile(['@echo off', cmd], batchfile) + call writefile(["@echo off\r", cmd . "\r"], batchfile) let cmd = batchfile endif execute 'silent %!' cmd @@ -2426,8 +2426,13 @@ function! s:diff() \ . (cnts[1] ? printf(' %d plugin(s) have pending updates.', cnts[1]) : '')) if cnts[0] || cnts[1] - nnoremap <silent> <buffer> <cr> :silent! call <SID>preview_commit()<cr> - nnoremap <silent> <buffer> o :silent! call <SID>preview_commit()<cr> + nnoremap <silent> <buffer> <plug>(plug-preview) :silent! call <SID>preview_commit()<cr> + if empty(maparg("\<cr>", 'n')) + nmap <buffer> <cr> <plug>(plug-preview) + endif + if empty(maparg('o', 'n')) + nmap <buffer> o <plug>(plug-preview) + endif endif if cnts[0] nnoremap <silent> <buffer> X :call <SID>revert()<cr> |