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

goto_{next,prev}_{*} functionality modification #10753

Open
daedroza opened this issue May 13, 2024 · 0 comments
Open

goto_{next,prev}_{*} functionality modification #10753

daedroza opened this issue May 13, 2024 · 0 comments

Comments

@daedroza
Copy link
Contributor

daedroza commented May 13, 2024

Hi all,

I'm attempting to change the existing functionality of goto_{next,prev}. Instead of next and prev in the literal sense, I want something more of nearest next and neareset prev.

At the moment, the current goto_{next,prev} has this behavior (which aren't present in the neovim-treesitter plugin, which i think is perfect for me)

My issue: In the below example, if we use goto_{next,prev}_class, after jumping inside class Test, there are two enums which are treated as class by the command. However, I cannot jump back to the position of class Test because I'm inside it so goto_prev_class don't go back to the first position.

The same issue is replicated when I'm inside the enum State0, I cannot go back to State0 enum.

For me, I know that in a very big java file, at the very top would be the class among various variables in between. Other things like interfaces and enums will be linearly positioned (and even functions) which allows me go through them easily. Also the multi-cursors benefit because instead of a regex based pattern to select "few" functions, I could just jump to them directly.

Example here:

import java.util.concurrent.TimeoutException;

public class Test {
    public enum State0 {
        RUNNING("running"),
        STOPPING("stopping"),
        STOPPED("stopped"),
        RESTARTING("restarting");
    }
        
    public enum State1 {
        RUNNING("running"),
        STOPPING("stopping"),
        STOPPED("stopped"),
        RESTARTING("restarting");
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant