feat(actions): add goto_file_edit_close to navigate and dispose view#137
Merged
dlyongemallo merged 1 commit intomainfrom Apr 23, 2026
Merged
feat(actions): add goto_file_edit_close to navigate and dispose view#137dlyongemallo merged 1 commit intomainfrom
goto_file_edit_close to navigate and dispose view#137dlyongemallo merged 1 commit intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new public action to open the inferred file in the previous non-diffview tabpage (same routing as goto_file_edit) and then close/dispose the originating diffview, addressing the workflow requested in #135.
Changes:
- Add
actions.goto_file_edit_close()to navigate to the inferred file and then close + dispose the current view. - Refactor internal
open_goto_file()helper to return a boolean success value for callers that need to react to “no inferred file”. - Extend functional tests and help docs to cover the new action.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| lua/diffview/actions.lua | Introduces goto_file_edit_close and adds an ok return from open_goto_file() so the new action can skip closing when no file is inferred. |
| lua/diffview/tests/functional/actions_spec.lua | Adds coverage for export presence, error behavior without an active view, command routing, and ensuring the view is closed/disposed only after successful navigation. |
| doc/diffview.txt | Documents the new action and lists it among unused actions for discoverability. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #135.