diff options
| author | Frank LENORMAND <lenormf@gmail.com> | 2018-07-20 13:18:33 +0300 |
|---|---|---|
| committer | Frank LENORMAND <lenormf@gmail.com> | 2018-07-20 13:18:33 +0300 |
| commit | 929ef9f5ec503a5ab2645ea45cfa7f2e4ef8b66a (patch) | |
| tree | 04469f1ec224b0819cb7438c18137a99e89d9a0d | |
| parent | 4bd6fe55d432883a2838aae250854a39a406ce74 (diff) | |
rc lint: Escape pipes in diagnostics
| -rw-r--r-- | rc/base/lint.kak | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/rc/base/lint.kak b/rc/base/lint.kak index 0e51f46d..dfa35037 100644 --- a/rc/base/lint.kak +++ b/rc/base/lint.kak @@ -55,10 +55,12 @@ define-command lint -docstring 'Parse the current buffer with a linter' %{ /:[0-9]+:[0-9]+:/ { kind = substr($4, 2) error = $2 "." $3 "," $2 "." $3 "|" kind + msg = "" # fix case where $5 is not the last field because of extra colons in the message - for (i=5; i<=NF; i++) error = error "\\:" $i - error = error " (col " $3 ")" - gsub("'\''", "'"''"'", error) + for (i=5; i<=NF; i++) msg = msg ":" $i + gsub(/\|/, "\\|", msg) + gsub("'\''", "'"''"'", msg) + error = error msg " (col " $3 ")" errors = errors " '\''" error "'\''" } END { |
