Skip to content
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

[BUG] cannot use <ret> in *lint-output* buffer #5168

Open
lobre opened this issue May 5, 2024 · 2 comments
Open

[BUG] cannot use <ret> in *lint-output* buffer #5168

lobre opened this issue May 5, 2024 · 2 comments
Labels

Comments

@lobre
Copy link
Contributor

lobre commented May 5, 2024

Version of Kakoune

1c71fc0

Reproducer

Just set a lintcmd, run the linter with :lint, and from the *lint-output* buffer, try to use <ret> to jump.

Outcome

Here is the error that gets appended to the *debug* buffer:

error running hook NormalKey(<ret>)/make-hooks: 1:1: 'make-jump': 2:5: 'evaluate-commands': 2:9: 'evaluate-commands': 3:13: 'try': 3:17: 'execute-keys': nothing selected

Expectations

I guess this is due to the recent abstraction made to jump commands in stdlib.

Additional information

No response

@lobre lobre added the bug label May 5, 2024
@krobelus
Copy link
Contributor

krobelus commented May 5, 2024

I can't reproduce a regression. Probably you expect the filetype=grep style behavior where every line is a valid location.
Lint output (for better or worse) has forever used filetype=make where make_error_pattern determines what's a valid location (for next/prev but also for jump)

For example here the first one is matched but the second one isn't:

src/main.cc:100:9: error: expected ‘}’ before string constant
  100 |         "» {+u}User{} hook support\n"
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/main.cc:97:8: note: to match this ‘{’
   97 |     }, {
      |        ^

It's possible that we want to relax this (perhaps only for the jump command). I personally have a dedicated shortcut which has some drawbacks I guess
The expectation for lint.kak are not very easily defined

@lobre
Copy link
Contributor Author

lobre commented May 6, 2024

You are absolutely right. I was sure that I was in a buffer with filetype=grep.

My current linting error was:

main.go:5:6: main redeclared in this block

And effectively, it does not match with the make_error_pattern. If I manually change the line to:

main.go:5:6: error: main redeclared in this block

It now works. So my bad, this is not a bug.

But as you say, maybe this rule could be relaxed effectively. It might not be necessary to have that level of precision for the jump.

Should I close this issue and this could be tracked elsewhere?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants