New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
format.kak - missing error message if external program failed #3254
Comments
Steps to reproduce:
Actual outcome:
Expected outcome:
The strange error message comes from the way
If I run these commands directly inside Kakoune, they both appear in the status line:
If I run these commands directly inside Kakoune, they both appear in the status line:
If I run these commands from the shell, the
If I run these commands from the shell, the
It seems like This change was introduced with 5b1f925 which switched from |
The |
@Screwtapello thanks for such a detailed bug report! I was in a hurry... Indeed, Cheers! |
Fixes mawww#3336. Addresses parts of mawww#3254, mawww#3155, mawww#2302. Changes include: - New `lint-selections` command that only lints the current selections. - New `lint-buffer` command that always lints the whole buffer. - `lint` alias for `lint-buffer`, for backwards compatibility. - Errors and warnings are now shown in the Error and Information faces, not hard-coded red and yellow. - Error and warning flags now use "!" and "?" symbols respectively, instead of a unicode block, so they can still be distinguished in a monochrome colour-scheme or by colour-blind users. - An error flag on a given line always takes precedence over a warning. - All messages for the same line are collected into a multi-line message. - We no longer escape tildes in messages, since that change added in commit ae339dc (2016) when we used `%~~` to quote messages. We stopped using `%~~` to quote messages in commit 1a2eecd (2018). - Anything the linter writes to stderr is logged to the *debug* buffer, not lost. - If the linter writes to stderr, an error is shown to the user instead of the usual error/warning count. - Hidden `lint_errors` option is now a line-specs, not range-specs, since we didn't use the other three coordinates, just the line number.
Fixes mawww#3336. Addresses parts of mawww#3254, mawww#3155, mawww#2302. Changes include: - New `lint-selections` command that only lints the current selections, and allows a custom lint command. - New `lint-buffer` command that always lints the whole buffer with the linter specified in the lintcmd option. - `lint` alias for `lint-buffer`, for backwards compatibility. - Errors and warnings are now shown in the Error and Information faces, not hard-coded red and yellow. - Error and warning flags now use "!" and "?" symbols respectively, instead of a unicode block, so they can still be distinguished in a monochrome colour-scheme or by colour-blind users. - An error flag on a given line always takes precedence over a warning. - All messages for the same line are collected into a multi-line message. - We no longer escape tildes in messages, since that change added in commit ae339dc (2016) when we used `%~~` to quote messages. We stopped using `%~~` to quote messages in commit 1a2eecd (2018). - Anything the linter writes to stderr is logged to the *debug* buffer, not lost. - If the linter writes to stderr, an error is shown to the user instead of the usual error/warning count. - The `lint_errors` hidden option is replaced by lint_messages, because it contains warnings as well as errors. - `lint-next-error` renamed to `lint-next-message, and `lint-previous-error` renamed to `lint-previous-message` for the same reason. - New `lint-next-error` and `lint-previous-error` aliases, for backwards compatibility. - `lint-next-message` and `lint-previous-message` show the message they jump to. - Where `lint_errors` was a range-specs option, `lint_messages` is a line-specs option to keep things simpler. This means lint-next-message and lint-previous-message no longer jump to a specific column.
Fixes mawww#3336. Addresses parts of mawww#3254, mawww#3155, mawww#2302. Changes include: - New `lint-selections` command that only lints the current selections, and allows a custom lint command. - New `lint-buffer` command that always lints the whole buffer with the linter specified in the lintcmd option. - `lint` alias for `lint-buffer`, for backwards compatibility. - Errors and warnings are now shown in the Error and Information faces, not hard-coded red and yellow. - Error and warning flags now use "!" and "?" symbols respectively, instead of a unicode block, so they can still be distinguished in a monochrome colour-scheme or by colour-blind users. - An error flag on a given line always takes precedence over a warning. - All messages for the same line are collected into a multi-line message. - We no longer escape tildes in messages, since that change added in commit ae339dc (2016) when we used `%~~` to quote messages. We stopped using `%~~` to quote messages in commit 1a2eecd (2018). - Anything the linter writes to stderr is logged to the *debug* buffer, not lost. - If the linter writes to stderr, an error is shown to the user instead of the usual error/warning count. - The `lint_errors` hidden option is replaced by lint_messages, because it contains warnings as well as errors. - `lint-next-error` renamed to `lint-next-message, and `lint-previous-error` renamed to `lint-previous-message` for the same reason. - New `lint-next-error` and `lint-previous-error` aliases, for backwards compatibility. - `lint-next-message` and `lint-previous-message` show the message they jump to. - Where `lint_errors` was a range-specs option, `lint_messages` is a line-specs option to keep things simpler. This means lint-next-message and lint-previous-message no longer jump to a specific column.
I think this would be fixed by #2292 |
Commit 5b1f925 (rc: Use the standard `fail` command to report errors, 2019-11-14) replaced uses of "echo -markup {Error}" with "fail". This made format.kak do echo "eval -client $kak_client %{ fail }" | kak -p $kak_session Unfortunately "fail" fails in the client spawned by "kak -p" and not in $kak_client where the user would see the message. Correct this. While at it, clarify the error message, so users immediately know that the number is the exit code. Fixes mawww#3254
Commit 5b1f925 (rc: Use the standard `fail` command to report errors, 2019-11-14) replaced uses of "echo -markup {Error}" with "fail". This made format-buffer do echo "eval -client $kak_client %{ fail }" | kak -p $kak_session Unfortunately "fail" fails in the client spawned by "kak -p" and not in $kak_client where the user would see the message. Correct this. While at it, clarify the error message, so users immediately know that the number is the exit code. Fixes mawww#3254
Commit 5b1f925 (rc: Use the standard `fail` command to report errors, 2019-11-14) replaced uses of "echo -markup {Error}" with "fail". This made format-buffer do echo "eval -client $kak_client %{ fail }" | kak -p $kak_session Unfortunately "fail" fails in the client spawned by "kak -p" and not in $kak_client where the user would see the message. Correct this. While at it, clarify the error message, so users immediately know that the number is the exit code. Fixes mawww#3254
Version:
Kakoune v2019.12.10
Steps
External program used as formatter fails (returns non-zero code)
Outcome
No error message is displayed
Expected
The error message
formatter returned an error <code>
is displayedThe text was updated successfully, but these errors were encountered: