]>
Commit | Line | Data |
---|---|---|
1 | "============================================================================== | |
2 | " FileName: applescript.vim | |
3 | " Desc: Syntax checking plugin for syntastic.vim | |
4 | " Author: Zhao Cai | |
5 | " Email: caizhaoff@gmail.com | |
6 | " Version: 0.2.1 | |
7 | " Date Created: Thu 09 Sep 2011 10:30:09 AM EST | |
8 | " Last Modified: Fri 09 Dec 2011 01:10:24 PM EST | |
9 | " | |
10 | " History: 0.1.0 - working, but it will run the script everytime to check | |
11 | " syntax. Should use osacompile but strangely it does not give | |
12 | " errors. | |
13 | " | |
14 | " 0.2.0 - switch to osacompile, it gives less errors compared | |
15 | " with osascript. | |
16 | " | |
17 | " 0.2.1 - remove g:syntastic_applescript_tempfile. use | |
18 | " tempname() instead. | |
19 | " | |
20 | " License: This program is free software. It comes without any | |
21 | " warranty, to the extent permitted by applicable law. You can | |
22 | " redistribute it and/or modify it under the terms of the Do What The | |
23 | " Fuck You Want To Public License, Version 2, as published by Sam | |
24 | " Hocevar. See http://sam.zoy.org/wtfpl/COPYING for more details. | |
25 | " | |
26 | "============================================================================ | |
27 | ||
28 | if exists("loaded_applescript_syntax_checker") | |
29 | finish | |
30 | endif | |
31 | let loaded_applescript_syntax_checker = 1 | |
32 | ||
33 | "bail if the user doesnt have osacompile installed | |
34 | if !executable("osacompile") | |
35 | finish | |
36 | endif | |
37 | ||
38 | function! SyntaxCheckers_applescript_GetLocList() | |
39 | let makeprg = 'osacompile -o ' . tempname() . '.scpt '. shellescape(expand('%')) | |
40 | let errorformat = '%f:%l:%m' | |
41 | ||
42 | return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) | |
43 | endfunction |