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

Navigation Behavior of Next/Previous in Harpoon #632

Open
ahmedreda1009 opened this issue Sep 29, 2024 · 1 comment
Open

Navigation Behavior of Next/Previous in Harpoon #632

ahmedreda1009 opened this issue Sep 29, 2024 · 1 comment

Comments

@ahmedreda1009
Copy link

ahmedreda1009 commented Sep 29, 2024

What issue are you having that you need Harpoon to solve?

I am experiencing an unexpected navigation behavior when using the next and previous commands in Harpoon. When I navigate to a specific harpooned file directly from the Harpoon list, subsequent calls to next or previous do not reference the newly selected file, but rather continue from the last navigation point. This behavior can be confusing and disrupts the flow of working with multiple files.

Why doesn’t the current config help?

The current configuration of Harpoon maintains a navigation history that does not reset when a file is selected directly from the Harpoon UI. As a result, the next and previous commands continue to operate based on the last accessed file, rather than the currently displayed file. This inconsistency makes it challenging to navigate efficiently between files, especially when the user switches contexts frequently.

What proposed API changes are you suggesting?

I suggest implementing a mechanism to reset or update the navigation history whenever a file is directly selected from the Harpoon list. This could involve:

  • Modifying the harpoon:list():go_to(index) method to update the current navigation context after selecting a file.
  • Ensuring that the next and previous commands reference the new current file for navigation, rather than relying on the previous state.

By making these changes, the plugin would provide a more intuitive and cohesive navigation experience, allowing users to easily move between files in a way that reflects their current context.

@PedroBinotto
Copy link

can you please share a snippet from your config where you call the aforementioned operations?

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

2 participants