aboutsummaryrefslogtreecommitdiff
path: root/autoload/build.kak
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2026-03-21 23:02:01 +0530
committerAkshay Nair <phenax5@gmail.com>2026-03-21 23:02:10 +0530
commita88e917a5f1e089397b3b0e759d0a7e60d6cf8ca (patch)
tree1c288de38ee23884e8ec064dd0cfcf69414efe0d /autoload/build.kak
parentdf01f61f5aa28a15ea3a9adecfa6822b410c1515 (diff)
downloadkakoune-config-a88e917a5f1e089397b3b0e759d0a7e60d6cf8ca.tar.gz
kakoune-config-a88e917a5f1e089397b3b0e759d0a7e60d6cf8ca.zip
Override make to add exit code
Diffstat (limited to 'autoload/build.kak')
-rw-r--r--autoload/build.kak30
1 files changed, 24 insertions, 6 deletions
diff --git a/autoload/build.kak b/autoload/build.kak
index b1067b6..903ce47 100644
--- a/autoload/build.kak
+++ b/autoload/build.kak
@@ -1,14 +1,32 @@
-set-option global makecmd 'make -j8'
+set-option global makecmd 'echo "Build command not set"; exit 1'
# TODO: For some reason <ret> doesnt jump to error
hook global BufSetOption filetype=(?:typescript|javascript|jsx|tsx) %{
set-option buffer makecmd "%val{config}/scripts/tsc-vimgrep.sh"
}
-hook global BufSetOption filetype=haskell %{
- set-option buffer makecmd "cabal build"
-}
+hook global BufSetOption filetype=haskell %{ set-option buffer makecmd "cabal build" }
+
+hook global BufSetOption filetype=rust %{ set-option buffer makecmd "cargo build" }
-hook global BufSetOption filetype=rust %{
- set-option buffer makecmd "cargo build"
+provide-module make-override %{
+ define-command -params .. -override -docstring %{
+ make [<arguments>]: make utility wrapper
+ All the optional arguments are forwarded to the make utility
+ } make %{
+ evaluate-commands -save-regs m %{
+ set-register m %opt{makecmd}
+ evaluate-commands -try-client %opt{toolsclient} %{
+ fifo -scroll -name *make* -script %{
+ trap - INT QUIT
+ trap 'echo -e "\n\nExited with $?" >&2' EXIT
+ eval "$kak_reg_m \"\$@\""
+ } -- %arg{@}
+ set-option buffer filetype make
+ set-option buffer jump_current_line 0
+ }
+ }
+ }
}
+
+hook -once global KakBegin .* %{ require-module make-override }