| 
									
										
										
										
											2022-08-15 18:51:32 +01:00
										 |  |  | vim9script | 
					
						
							| 
									
										
										
										
											2016-10-23 21:21:08 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-08-15 18:51:32 +01:00
										 |  |  | # Language:           ConTeXt typesetting engine | 
					
						
							|  |  |  | # Maintainer:         Nicola Vitacolonna <nvitacolonna@gmail.com> | 
					
						
							|  |  |  | # Former Maintainers: Nikolai Weibull <now@bitwi.se> | 
					
						
							|  |  |  | # Latest Revision:    2022 Aug 12 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | if exists("g:current_compiler") | 
					
						
							| 
									
										
										
										
											2016-10-23 21:21:08 +02:00
										 |  |  |   finish | 
					
						
							|  |  |  | endif | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-08-15 18:51:32 +01:00
										 |  |  | import autoload '../autoload/context.vim' | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | if exists(":CompilerSet") != 2 # Older Vim always used :setlocal | 
					
						
							| 
									
										
										
										
											2016-10-23 21:21:08 +02:00
										 |  |  |   command -nargs=* CompilerSet setlocal <args> | 
					
						
							|  |  |  | endif | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-08-15 18:51:32 +01:00
										 |  |  | g:current_compiler = 'context' | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-10-23 21:21:08 +02:00
										 |  |  | if get(b:, 'context_ignore_makefile', get(g:, 'context_ignore_makefile', 0)) || | 
					
						
							| 
									
										
										
										
											2022-08-15 18:51:32 +01:00
										 |  |  |   (!filereadable('Makefile') && !filereadable('makefile')) | 
					
						
							|  |  |  |   &l:makeprg =  join(context.ConTeXtCmd(shellescape(expand('%:p:t'))), ' ') | 
					
						
							| 
									
										
										
										
											2016-10-23 21:21:08 +02:00
										 |  |  | else | 
					
						
							| 
									
										
										
										
											2022-08-15 18:51:32 +01:00
										 |  |  |   g:current_compiler = 'make' | 
					
						
							| 
									
										
										
										
											2016-10-23 21:21:08 +02:00
										 |  |  | endif | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-08-15 18:51:32 +01:00
										 |  |  | const context_errorformat = join([ | 
					
						
							|  |  |  |   "%-Popen source%.%#> %f", | 
					
						
							|  |  |  |   "%-Qclose source%.%#> %f", | 
					
						
							|  |  |  |   "%-Popen source%.%#name '%f'", | 
					
						
							|  |  |  |   "%-Qclose source%.%#name '%f'", | 
					
						
							|  |  |  |   "tex %trror%.%#error on line %l in file %f: %m", | 
					
						
							|  |  |  |   "%Elua %trror%.%#error on line %l in file %f:", | 
					
						
							|  |  |  |   "%+Emetapost %#> error: %#", | 
					
						
							|  |  |  |   "%Emetafun%.%#error: %m", | 
					
						
							|  |  |  |   "! error: %#%m", | 
					
						
							|  |  |  |   "%-C %#", | 
					
						
							|  |  |  |   "%C! %m", | 
					
						
							|  |  |  |   "%Z[ctxlua]%m", | 
					
						
							|  |  |  |   "%+C<*> %.%#", | 
					
						
							|  |  |  |   "%-C%.%#", | 
					
						
							|  |  |  |   "%Z...%m", | 
					
						
							|  |  |  |   "%-Zno-error", | 
					
						
							|  |  |  |   "%-G%.%#"], ",") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | execute 'CompilerSet errorformat=' .. escape(context_errorformat, ' ') | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # vim: sw=2 fdm=marker |