commit 42feb6b5b63244382cc693caa2db68d6ae6b3323
parent dc5d17a2b8108bcb79d68a853a36e6bb4585753c
Author: Daniel Moch <daniel@danielmoch.com>
Date: Fri, 16 Dec 2016 07:32:01 -0500
Use best practices for plugin loading
1. Remove strict requirement on Vim 8. Only require the necessary
features to be present, and that Vim in running nocompatible.
2. Set cpo to Vim default to guarantee line continuation works.
Diffstat:
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/README.md b/README.md
@@ -16,8 +16,7 @@ commands in just over 150 lines of Vimscript.
`QuickFixCmdPost`, and the bang operator work as expected.
## Requirements
-Vim 8 minimum compiled with `+job`, `+channel`, and of course
-`+quickfix`.
+Vim compiled with `+job`, `+channel`, and of course `+quickfix`.
## Installation
### Pathogen
diff --git a/doc/makejob.txt b/doc/makejob.txt
@@ -10,7 +10,6 @@ great, but who don't like how calls to |:make| and |:grep| freeze the
editor. _MakeJob_ implements asynchronous versions of the builtin
commands in just over 150 lines of Vimscript.
-{only available in Vim version 8 or later}
{only when compiled with the |channel|, |job|, and |quickfix| features}
Here are your new quickfix commands.
diff --git a/plugin/makejob.vim b/plugin/makejob.vim
@@ -3,12 +3,12 @@
" AUTHOR: Daniel Moch <daniel@danielmoch.com>
" VERSION: 1.1.2-dev
"
-if exists('g:loaded_makejob') || version < 800 || !has('job') ||
- \ !has('channel') || !has('quickfix')
+if exists('g:loaded_makejob') || !has('job') || !has('channel') || !has('quickfix') || &cp
finish
endif
let g:loaded_makejob = 1
-
+let s:save_cpo = &cpo
+set cpo&vim
let s:jobinfo = {}
function! s:InitAutocmd(lmake, grep, cmd)
@@ -161,3 +161,5 @@ command! -bang -nargs=+ -complete=file GrepJob call s:MakeJob(1,0,0,<bang>0,<q-a
command! -bang -nargs=+ -complete=file LgrepJob call s:MakeJob(1,1,0,<bang>0,<q-args>)
command! -bang -nargs=+ -complete=file GrepaddJob call s:MakeJob(1,0,1,<bang>0,<q-args>)
command! -bang -nargs=+ -complete=file LgrepaddJob call s:MakeJob(1,1,1,<bang>0,<q-args>)
+let &cpo = s:save_cpo
+unlet s:save_cpo