Skip to content

Commit

Permalink
Use best practices for plugin loading
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
djmoch committed Dec 16, 2016
1 parent dc5d17a commit 42feb6b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion doc/makejob.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 5 additions & 3 deletions plugin/makejob.vim
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
" AUTHOR: Daniel Moch <[email protected]>
" 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)
Expand Down Expand Up @@ -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

0 comments on commit 42feb6b

Please sign in to comment.