-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
How is os.openDirInEditor triggered? #4512
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
Comments
At the moment, the config is only used in the Worktrees panel, when pressing It would totally make sense to use it when pressing As far as I can see, the main challenge is around range selection; right now we check that all selected items are files, and raise an error if not. This would have to change to allow either a range selection of only files, or one of only directories, and raise an error if it's a mixture. (I don't think it's important enough to handle the case where there's a range selection of both files and directories.) In addition, Maybe it's easier to only support the case of a single selected directory, that's probably good enough too. A personal note: I wouldn't find the feature very useful myself, because the only directory I ever want to open in my editor is the repo root, and this doesn't always show up in the Files panel. I have a custom command for this that calls |
A custom command is also enough for me, didn't think of that, thanks! For consistency I could try to implement editing single directories with e, but it is not as useful now. I can't imagine editing multiple directories at once is ever needed. It would still help to change the documentation so that the purpose of the openDirInEditor is more clear. And maybe your command could be added to the list of custom commands in the wiki? |
I'm trying to understand what is the best way to implement a simple open dir if a single dir is selected. The keymapping is done here: lazygit/pkg/gui/controllers/files_controller.go Lines 91 to 98 in 66caa25
How would you adapt this? Maybe something like this: {
Key: opts.GetKey(opts.Config.Universal.Edit),
Handler: self.dirOrFiles,
GetDisabledReason: self.any(self.singleItemSelected(), self.itemsSelected(self.canEditFiles)),
Description: self.c.Tr.Edit,
Tooltip: self.c.Tr.EditFileTooltip,
DisplayOnScreen: true,
}, Here Then |
I want to be able to open directories in my terminal editor. The config option os.openDirInEditor seems to be exactly what I want, but after setting it and trying to edit a directory in lazygit, I get an error: "Cannot edit directories: you can only edit individual files".
Is this feature implemented? It would be nice to "edit" folders if openDirInEditor is defined.
The text was updated successfully, but these errors were encountered: