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

implement goto_[first|prev|next|last]_error #8717

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

cgahr
Copy link
Contributor

@cgahr cgahr commented Nov 4, 2023

This PR implements the commands goto_[first|prev|next|last]_error. They are basically equivalent to goto_[first|prev|next|last]_diag but ignore all diagnostics that aren't severe enough.

It closes issue #3405 and supersedes PR #6331. The latter is very similar (and was used as an inspiration) but doesn't implement goto_[first|last]_error.

The four commands are mapped to [|] + e|E similar to goto_[first|prev|next|last]_diag. The latter e is IMO the obvious choice, e for error and also its proximity to d is nice, enhancing the existing muscle memory.

In theory, the severity level for which diagnostics are valid targets for goto_[first|prev|next|last]_error could be a config flag. For now, it is hard-coded to Severity::Error.

What do you think?

@kirawi
Copy link
Member

kirawi commented Nov 4, 2023

I feel like first and last are unnecessary because they can be achieved very easily by, respectively: 1G<goto_next_error> and ge<goto_prev_error>

Edit: Actually, I see that there is precedence for this behavior, but it feels odd to me for that too.

@cgahr
Copy link
Contributor Author

cgahr commented Nov 5, 2023

Tbh, I never thought about using gg]e (or gg]d for that matter) to get the next error/diagnostic.

In any case, I think binding the capitalized letter to first and last doesn't really waste "keymap realestate", so why not have it?

@cgahr cgahr force-pushed the next-error branch 2 times, most recently from 9de39cf to ecb3a67 Compare November 6, 2023 10:36
@kirawi kirawi added A-command Area: Commands E-easy Call for participation: Experience needed to fix: Easy / not much labels Nov 6, 2023
@archseer
Copy link
Member

Edit: Actually, I see that there is precedence for this behavior, but it feels odd to me for that too.

Yes, this is a pretty well established pattern.

@aral
Copy link
Contributor

aral commented Mar 16, 2024

Was just coming over to file an issue to request this very thing.

Any thoughts on when this might be merged? :)

CC @archseer

@altanozlu
Copy link

Any news on this ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-command Area: Commands E-easy Call for participation: Experience needed to fix: Easy / not much
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants