summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2018-08-05 10:37:15 +0100
committerMaxime Coste <mawww@kakoune.org>2018-08-05 10:37:15 +0100
commit610dbd97e9d4abe42e73afc4897deb8d779fc9e3 (patch)
tree4e3d45f14761181c9cbfaebd83171f6038a9c173
parent472a5732e247df1063d2f184ba9b933506a68142 (diff)
parent5953a38bdd23c577c1841f05a7d2f00d68e67be7 (diff)
Merge remote-tracking branch 'lenormf/fix-lint'
-rw-r--r--rc/base/lint.kak12
1 files changed, 8 insertions, 4 deletions
diff --git a/rc/base/lint.kak b/rc/base/lint.kak
index d0a8b78c..29b9031d 100644
--- a/rc/base/lint.kak
+++ b/rc/base/lint.kak
@@ -47,17 +47,17 @@ define-command lint -docstring 'Parse the current buffer with a linter' %{
error_count = 0
warning_count = 0
}
- /:[0-9]+:[0-9]+: ([Ff]atal )?[Ee]rror/ {
+ /:[1-9][0-9]*:[1-9][0-9]*: ([Ff]atal )?[Ee]rror/ {
flags = flags " " $2 "|{red}█"
error_count++
}
- /:[0-9]+:[0-9]+:/ {
+ /:[1-9][0-9]*:[1-9][0-9]*:/ {
if ($4 !~ /[Ee]rror/) {
flags = flags " " $2 "|{yellow}█"
warning_count++
}
}
- /:[0-9]+:[0-9]+:/ {
+ /:[1-9][0-9]*:[1-9][0-9]*:/ {
kind = substr($4, 2)
error = $2 "." $3 "," $2 "." $3 "|" kind
msg = ""
@@ -78,7 +78,11 @@ define-command lint -docstring 'Parse the current buffer with a linter' %{
}
' "$dir"/stderr | kak -p "$kak_session"
- cut -d: -f2- "$dir"/stderr | sed "s@^@$kak_bufname:@" > "$dir"/fifo
+ cut -d: -f2- "$dir"/stderr | awk -v bufname="${kak_bufname}" '
+ /^[1-9][0-9]*:[1-9][0-9]*:/ {
+ print bufname ":" $0
+ }
+ ' > "$dir"/fifo
} >/dev/null 2>&1 </dev/null &
}