Skip to content

Allow opening single directory in Files panel with editor #4536

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ivomac
Copy link

@ivomac ivomac commented May 5, 2025

  • PR Description

The openDirInEditor command is only used in the worktrees panel. It would make sense to use it in the Files panel if the user edits a directory by pressing e.

When a mix of directories and files are selected, the current behavior is to pass only the file paths to the editor, which is maintained. Editing only directories is currently disabled (ErrCannotEditDirectory). I have changed it so that it is possible to edit a single directory.

A new DisabledReason ErrCannotEditMultipleDirectories seems necessary.

Related Issue: #4512

  • Please check if the PR fulfills these requirements
  • Cheatsheets are up-to-date (run go generate ./...)
  • Code has been formatted (see here)
  • Tests have been added/updated (see here for the integration test guide)
    • I'm not sure where the tests that involve the editor are. A test that attempts to edit a single dir would make sense though.
  • Text is internationalised (see here)
    • Not relevant yet. Would be needed for a new disabled reason.
  • If a new UserConfig entry was added, make sure it can be hot-reloaded (see here)
    • New UserConfig not needed.
  • Docs have been updated if necessary
  • You've read through your own file changes for silly mistakes etc

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.

1 participant