diff options
| author | Maxime Coste <mawww@kakoune.org> | 2020-03-02 20:53:33 +1100 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2020-03-02 20:53:33 +1100 |
| commit | 62983b9bb5e9f4ba90c3f0822dfd2b531bdb12ae (patch) | |
| tree | 81f9b5661814d5f080a52812294d15fe3aa88f11 | |
| parent | 0a66eb9c47ba9a7d3b90286d66a70b5bd7eee15a (diff) | |
| parent | 1ed8b847628a2b980d414df5976934e3b7535fc5 (diff) | |
Merge remote-tracking branch 'eraserhd/new-lint-refresh'
| -rw-r--r-- | rc/tools/lint.kak | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/rc/tools/lint.kak b/rc/tools/lint.kak index 3774c365..3e25d02f 100644 --- a/rc/tools/lint.kak +++ b/rc/tools/lint.kak @@ -28,12 +28,6 @@ define-command \ } \ lint-cleaned-selections \ %{ - # Clear the current contents of the various options. - set-option buffer lint_flags %val{timestamp} - set-option buffer lint_messages %val{timestamp} - set-option buffer lint_error_count 0 - set-option buffer lint_warning_count 0 - # Create a temporary directory to keep all our state. evaluate-commands %sh{ # This is going to come in handy later. @@ -115,7 +109,7 @@ define-command \ # need backslash-continuation chars in a single-quoted string, # but awk still needs them. # shellcheck disable=SC1004 - awk -v file="$kak_buffile" -v client="$kak_client" ' + awk -v file="$kak_buffile" -v stamp="$kak_timestamp" -v client="$kak_client" ' function kakquote(text) { # \x27 is apostrophe, escaped for shell-quoting reasons. gsub(/\x27/, "\x27\x27", text) @@ -173,23 +167,19 @@ define-command \ } END { + printf("set-option %s lint_flags %s", kakquote("buffer=" file), stamp); for (line in flags_by_line) { flag = flags_by_line[line] - - print "set-option -add " \ - kakquote("buffer=" file) " " \ - "lint_flags " \ - kakquote(line "|" flag) + printf(" %s", kakquote(line "|" flag)); } + printf("\n"); + printf("set-option %s lint_messages %s", kakquote("buffer=" file), stamp); for (line in messages_by_line) { msg = messages_by_line[line] - - print "set-option -add " \ - kakquote("buffer=" file) " " \ - "lint_messages " \ - kakquote(line "|" msg) + printf(" %s", kakquote(line "|" msg)); } + printf("\n"); print "set-option " \ kakquote("buffer=" file) " " \ |
