commit 6869d0698f7b94e79e5e6cc67586dc000ff2d67b
parent 3f10748a07015142343c3a5760515ae5e3849fb3
Author: zeertzjq <zeertzjq@outlook.com>
Date: Wed, 14 Jan 2026 07:12:35 +0800
vim-patch:17d60ce: runtime(compiler): add compiler plugin for cabal
closes: vim/vim#19152
https://github.com/vim/vim/commit/17d60cee555ec36e62492793159f9051218a6bd9
Co-authored-by: Mateo Gjika <104777599+mateoxh@users.noreply.github.com>
Diffstat:
2 files changed, 45 insertions(+), 1 deletion(-)
diff --git a/runtime/compiler/cabal.vim b/runtime/compiler/cabal.vim
@@ -0,0 +1,39 @@
+" Vim compiler file
+" Compiler: Haskell Cabal Build file
+" Maintainer: Mateo Gjika <@mateoxh>
+
+if exists('current_compiler')
+ finish
+endif
+
+let current_compiler = 'cabal'
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+CompilerSet makeprg=cabal\ build
+
+CompilerSet errorformat=
+ \%W%f:(%l\\,%c)-(%e\\,%k):\ %tarning:\ [%.%#],
+ \%W%f:(%l\\,%c)-(%e\\,%k):\ %tarning:%m,
+ \%W%f:(%l\\,%c)-(%e\\,%k):\ %tarning:,
+ \%W%f:%l:%c-%k:\ %tarning:\ [%.%#],
+ \%W%f:%l:%c-%k:\ %tarning:%m,
+ \%W%f:%l:%c-%k:\ %tarning:,
+ \%W%f:%l:%c:\ %tarning:\ [%.%#],
+ \%W%f:%l:%c:\ %tarning:%m,
+ \%W%f:%l:%c:\ %tarning:,
+ \%E%f:(%l\\,%c)-(%e\\,%k):\ %trror:\ [%.%#],
+ \%E%f:(%l\\,%c)-(%e\\,%k):\ %trror:%m,
+ \%E%f:(%l\\,%c)-(%e\\,%k):\ %trror:,
+ \%E%f:%l:%c-%k:\ %trror:\ [%.%#],
+ \%E%f:%l:%c-%k:\ %trror:%m,
+ \%E%f:%l:%c-%k:\ %trror:,
+ \%E%f:%l:%c:\ %trror:\ [%.%#],
+ \%E%f:%l:%c:\ %trror:%m,
+ \%E%f:%l:%c:\ %trror:,
+ \%Z\ %\\+\|%.%#,
+ \%C%m
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
diff --git a/runtime/ftplugin/cabal.vim b/runtime/ftplugin/cabal.vim
@@ -2,12 +2,17 @@
" Language: Haskell Cabal Build file
" Maintainer: Riley Bruins <ribru17@gmail.com>
" Last Change: 2024 Jul 06
+" 2026 Jan 13 by Vim project: set compiler #19152
if exists('b:did_ftplugin')
finish
endif
let b:did_ftplugin = 1
+compiler cabal
+
+let b:undo_ftplugin = 'compiler make'
+
setl comments=:-- commentstring=--\ %s
-let b:undo_ftplugin = 'setl com< cms<'
+let b:undo_ftplugin .= '| setl com< cms<'