Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make window/buffer/local scope of make_error_patterns work #5175

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions rc/tools/make.kak
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,24 @@ define-command -params .. -docstring %{
make [<arguments>]: make utility wrapper
All the optional arguments are forwarded to the make utility
} make %{
evaluate-commands -try-client %opt{toolsclient} %{
evaluate-commands -try-client %opt{toolsclient} -save-regs a %{
set-register a %opt{make_error_pattern} # save current error_pattern
fifo -scroll -name *make* -script %{
trap - INT QUIT
$kak_opt_makecmd "$@"
} %arg{@} # pass arguments for "$@" above, exit to avoid evaluating them
set-option buffer filetype make
set-option buffer jump_current_line 0
set-option buffer make_error_pattern %reg{a} # set the pattern to the value while firing the make command
}
}

add-highlighter shared/make group
add-highlighter shared/make/ regex "^([^:\n]+):(\d+):(?:(\d+):)?\h+(?:((?:fatal )?error)|(warning)|(note)|(required from(?: here)?))?.*?$" 1:cyan 2:green 3:green 4:red 5:yellow 6:blue 7:yellow
add-highlighter shared/make/ regex "^\h*(~*(?:(\^)~*)?)$" 1:green 2:cyan+b
add-highlighter shared/make/ line '%opt{jump_current_line}' default+b

hook -group make-highlight global WinSetOption filetype=make %{
add-highlighter -override shared/make/ regex %opt{make_error_pattern} 1:cyan 2:green 3:green 4:red 5:yellow 6:blue 7:yellow
add-highlighter window/make ref make
hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/make }
}
Expand Down