Skip to content

Next / Prev Git File Item #1389

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

Closed
alex-courtis opened this issue Jul 2, 2022 · 4 comments
Closed

Next / Prev Git File Item #1389

alex-courtis opened this issue Jul 2, 2022 · 4 comments

Comments

@alex-courtis
Copy link
Member

Is your feature request related to a problem? Please describe.
next_git_item will take you to the directory containing the git item. It would be useful to navigate directly to the file.

In this case, you need to next_git_item 5 times to get to the file.

20220703_094542 409x466

Describe the solution you'd like
next_git_file_item to navigate directly to the file.

Describe alternatives you've considered
Directories could also be recursively opened until the file item is found.

Additional context
I find myself using next_git_item edit next_git_item edit next_git_item ... very frequently.

@alex-courtis
Copy link
Member Author

An alternative might be simply a show_on_dirs option for git, as per diagnostics.

Both would be nice.

alex-courtis added a commit that referenced this issue Jul 3, 2022
@kyazdani42
Copy link
Member

Maybe just skipping if the file is a directory in the next/prev action would work too.

@kyazdani42
Copy link
Member

@alex-courtis is this working now ?

@alex-courtis
Copy link
Member Author

alex-courtis commented Jul 10, 2022

Closing. show_on_dirs is a good enough solution.

I'd still like some means of finding the git items in collapsed nodes, however I don't have a user story for that. Perhaps it involves fugitive instead of nvim-tree.

Almo7aya pushed a commit to Almo7aya/nvim-tree.lua that referenced this issue Oct 11, 2022
alex-courtis added a commit that referenced this issue Jan 6, 2024
…2525)

* feat(#1389): add next recursive for git and diag moves

The recurse opt can be used to directly go to the next item showing
git/diagnostic status recursively.

Signed-off-by: Antonin Godard <[email protected]>

* refactor: status logic in single function

Rename get_status to status_is_valid.

Use status_is_valid function in multiple place to avoid duplicating
code.

Signed-off-by: Antonin Godard <[email protected]>

* feat(#1389): add prev recursive for git and diag moves

Signed-off-by: Antonin Godard <[email protected]>

* fix(#1389): next recursive: take root node into account

The root node cannot have a status. Previously if moving from the root
node, status_is_valid was trying to fetch the status from it and errored.

Signed-off-by: Antonin Godard <[email protected]>

* fix(#1389): doc: remove show_on_open_dirs limitation

Signed-off-by: Antonin Godard <[email protected]>

* feat(#1389): move find_node_line to utils

Signed-off-by: Antonin Godard <[email protected]>

* feat(#1389): doc: note recursive moves are to files only, tidy

---------

Signed-off-by: Antonin Godard <[email protected]>
Co-authored-by: Alexander Courtis <[email protected]>
alex-courtis added a commit that referenced this issue Jan 7, 2024
…2525)

* feat(#1389): add next recursive for git and diag moves

The recurse opt can be used to directly go to the next item showing
git/diagnostic status recursively.

Signed-off-by: Antonin Godard <[email protected]>

* refactor: status logic in single function

Rename get_status to status_is_valid.

Use status_is_valid function in multiple place to avoid duplicating
code.

Signed-off-by: Antonin Godard <[email protected]>

* feat(#1389): add prev recursive for git and diag moves

Signed-off-by: Antonin Godard <[email protected]>

* fix(#1389): next recursive: take root node into account

The root node cannot have a status. Previously if moving from the root
node, status_is_valid was trying to fetch the status from it and errored.

Signed-off-by: Antonin Godard <[email protected]>

* fix(#1389): doc: remove show_on_open_dirs limitation

Signed-off-by: Antonin Godard <[email protected]>

* feat(#1389): move find_node_line to utils

Signed-off-by: Antonin Godard <[email protected]>

* feat(#1389): doc: note recursive moves are to files only, tidy

---------

Signed-off-by: Antonin Godard <[email protected]>
Co-authored-by: Alexander Courtis <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants