| 
									
										
										
										
											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> | 
					
						
							| 
									
										
										
										
											2024-03-31 18:37:05 +02:00
										 |  |  | # Contributors:       Enno Nagel | 
					
						
							|  |  |  | # Last Change:        2024 Mar 29 | 
					
						
							| 
									
										
										
										
											2024-04-04 22:00:58 +02:00
										 |  |  | #                     2024 Apr 03 by The Vim Project (removed :CompilerSet definition) | 
					
						
							| 
									
										
										
										
											2025-03-11 21:35:48 +01:00
										 |  |  | #                     2025 Mar 11 by The Vim Project (add comment for Dispatch) | 
					
						
							| 
									
										
										
										
											2022-08-15 18:51:32 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | 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' | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | g:current_compiler = 'context' | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-03-11 21:35:48 +01:00
										 |  |  | # CompilerSet makeprg=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')) | 
					
						
							| 
									
										
										
										
											2024-03-31 18:37:05 +02:00
										 |  |  |   var makeprg =  join(context.ConTeXtCmd(shellescape(expand('%:p:t'))), ' ') | 
					
						
							|  |  |  |   execute 'CompilerSet makeprg=' .. escape(makeprg, ' ') | 
					
						
							| 
									
										
										
										
											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 |