summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2020-05-30 09:05:53 +1000
committerMaxime Coste <mawww@kakoune.org>2020-05-30 09:05:53 +1000
commitd90f8d43247b03a5e24eabb8ef039ebca7f27de4 (patch)
treeec6e6ecbb03499fbe30c977851712466e5e0c0b4
parent08e0b663f737e71610e1cbf229cac5e8e69026d4 (diff)
parentb4f2c3fe919669aca20c5cb8ee3c0b19ead42192 (diff)
Merge remote-tracking branch 'lenormf/remove-lint-enable'
-rw-r--r--rc/tools/lint.kak17
1 files changed, 10 insertions, 7 deletions
diff --git a/rc/tools/lint.kak b/rc/tools/lint.kak
index 20875a23..6f239556 100644
--- a/rc/tools/lint.kak
+++ b/rc/tools/lint.kak
@@ -207,7 +207,7 @@ define-command \
"lint failed, see *debug* for details"
else
# No errors detected, show the results.
- printf "eval -client %s lint-show-counters" \
+ printf "eval -client %s 'lint-show-diagnostics; lint-show-counters'" \
"$kak_client"
fi | kak -p "$kak_session"
@@ -291,7 +291,7 @@ define-command \
alias global lint lint-buffer
-define-command -hidden lint-show %{
+define-command -hidden lint-show-current-line %{
update-option buffer lint_messages
evaluate-commands %sh{
# This is going to come in handy later.
@@ -320,13 +320,16 @@ define-command -hidden lint-show-counters %{
echo -markup "linting results: {Error} %opt{lint_error_count} error(s) {Information} %opt{lint_warning_count} warning(s) "
}
-define-command lint-enable -docstring "Activate automatic diagnostics of the code" %{
- add-highlighter window/lint flag-lines default lint_flags
- hook window -group lint-diagnostics NormalIdle .* %{ lint-show }
- hook window -group lint-diagnostics WinSetOption lint_flags=.* %{ info; lint-show }
+define-command -hidden lint-show-diagnostics %{
+ try %{
+ # Assume that if the highlighter is set, then hooks also are
+ add-highlighter window/lint flag-lines default lint_flags
+ hook window -group lint-diagnostics NormalIdle .* %{ lint-show-current-line }
+ hook window -group lint-diagnostics WinSetOption lint_flags=.* %{ info; lint-show-current-line }
+ }
}
-define-command lint-disable -docstring "Disable automatic diagnostics of the code" %{
+define-command lint-hide-diagnostics -docstring "Hide line markers and disable automatic diagnostic displaying" %{
remove-highlighter window/lint
remove-hooks window lint-diagnostics
}