Skip to content

feat(actions): add goto_file_edit_close to navigate and dispose view#137

Merged
dlyongemallo merged 1 commit intomainfrom
goto_file_edit_close
Apr 23, 2026
Merged

feat(actions): add goto_file_edit_close to navigate and dispose view#137
dlyongemallo merged 1 commit intomainfrom
goto_file_edit_close

Conversation

@dlyongemallo
Copy link
Copy Markdown
Owner

@dlyongemallo dlyongemallo commented Apr 23, 2026

Closes #135.

Copilot AI review requested due to automatic review settings April 23, 2026 09:44
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@dlyongemallo dlyongemallo merged commit df4f0b2 into main Apr 23, 2026
7 checks passed
@dlyongemallo dlyongemallo deleted the goto_file_edit_close branch April 23, 2026 18:11
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

Successfully merging this pull request may close these issues.

feature request: goto file and close the diffview

2 participants