1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-04-02 22:25:47 +02:00

allow editing commit files

This commit is contained in:
Jesse Duffield 2020-07-21 18:12:05 +10:00
parent 7d5fe4b66c
commit f4718a9047
5 changed files with 22 additions and 0 deletions

View File

@ -104,6 +104,7 @@
<kbd>c</kbd>: checkout file
<kbd>d</kbd>: discard this commit's changes to this file
<kbd>o</kbd>: open file
<kbd>e</kbd>: edit file
<kbd>space</kbd>: toggle file included in patch
<kbd>enter</kbd>: enter file to add selected lines to the patch
<kbd>,</kbd>: previous page

View File

@ -104,6 +104,7 @@
<kbd>c</kbd>: bestand uitchecken
<kbd>d</kbd>: uitsluit deze commit zijn veranderingen aan dit bestand
<kbd>o</kbd>: open bestand
<kbd>e</kbd>: verander bestand
<kbd>space</kbd>: toggle file included in patch
<kbd>enter</kbd>: enter file to add selected lines to the patch
<kbd>,</kbd>: previous page

View File

@ -104,6 +104,7 @@
<kbd>c</kbd>: checkout file
<kbd>d</kbd>: discard this commit's changes to this file
<kbd>o</kbd>: otwórz plik
<kbd>e</kbd>: edytuj plik
<kbd>space</kbd>: toggle file included in patch
<kbd>enter</kbd>: enter file to add selected lines to the patch
<kbd>,</kbd>: previous page

View File

@ -121,9 +121,22 @@ func (gui *Gui) refreshCommitFilesView() error {
func (gui *Gui) handleOpenOldCommitFile(g *gocui.Gui, v *gocui.View) error {
file := gui.getSelectedCommitFile()
if file == nil {
return nil
}
return gui.openFile(file.Name)
}
func (gui *Gui) handleEditCommitFile(g *gocui.Gui, v *gocui.View) error {
file := gui.getSelectedCommitFile()
if file == nil {
return nil
}
return gui.editFile(file.Name)
}
func (gui *Gui) handleToggleFileForPatch(g *gocui.Gui, v *gocui.View) error {
if ok, err := gui.validateNormalWorkingTreeState(); !ok {
return err

View File

@ -878,6 +878,12 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
Handler: gui.handleOpenOldCommitFile,
Description: gui.Tr.SLocalize("openFile"),
},
{
ViewName: "commitFiles",
Key: gui.getKey("universal.edit"),
Handler: gui.handleEditCommitFile,
Description: gui.Tr.SLocalize("editFile"),
},
{
ViewName: "commitFiles",
Key: gui.getKey("universal.select"),