summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Altmanninger <aclopte@gmail.com>2022-10-16 19:11:41 +0200
committerJohannes Altmanninger <aclopte@gmail.com>2022-10-16 20:00:22 +0200
commitdaabb5da4ec5b35b20736ba8952d0fd53dea4e3e (patch)
treef1cf909084a556bc5a99f993cf8c76d671ef0133
parent360a6847be5c79a57da73c15efbbb954cd8ba749 (diff)
rc make: make-next-error to switch toolsclient to *make* buffer
This is equivalent to a change to grep.kak in 649e252f7 (bring *grep* buffer to front in context of toolsclient, 2020-08-14). If a toolsclient is set, make-next-error (and make-previous-error) will jump to %opt{make_current_error_line}. This is wrong if the toolsclient does not show the *make* buffer. In that case make_current_error_line is undefined and we end up showing the goto menu. This has occasionally been annoying me for a long time but I never bothered investigating. Fix this by switching to the *make* buffer. The potential downside is if make-next-error is run from the toolsclient, where we no longer jump to the error but that's fine because we can use <ret>. We can maybe improve this later by extending the logic, see https://github.com/mawww/kakoune/pull/3656#pullrequestreview-472052285
-rw-r--r--rc/tools/make.kak14
1 files changed, 12 insertions, 2 deletions
diff --git a/rc/tools/make.kak b/rc/tools/make.kak
index 1f8467a8..a150480b 100644
--- a/rc/tools/make.kak
+++ b/rc/tools/make.kak
@@ -72,7 +72,12 @@ define-command make-next-error -docstring 'Jump to the next make error' %{
execute-keys "%opt{make_current_error_line}ggl" "/^(?:\w:)?[^:\n]+:\d+:(?:\d+:)?%opt{make_error_pattern}<ret>"
make-jump
}
- try %{ evaluate-commands -client %opt{toolsclient} %{ execute-keys %opt{make_current_error_line}g } }
+ try %{
+ evaluate-commands -client %opt{toolsclient} %{
+ buffer '*make*'
+ execute-keys %opt{make_current_error_line}g
+ }
+ }
}
define-command make-previous-error -docstring 'Jump to the previous make error' %{
@@ -81,5 +86,10 @@ define-command make-previous-error -docstring 'Jump to the previous make error'
execute-keys "%opt{make_current_error_line}g" "<a-/>^(?:\w:)?[^:\n]+:\d+:(?:\d+:)?%opt{make_error_pattern}<ret>"
make-jump
}
- try %{ evaluate-commands -client %opt{toolsclient} %{ execute-keys %opt{make_current_error_line}g } }
+ try %{
+ evaluate-commands -client %opt{toolsclient} %{
+ buffer '*make*'
+ execute-keys %opt{make_current_error_line}g
+ }
+ }
}