mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-04-11 11:42:12 +02:00
allow editing commit files
This commit is contained in:
parent
7d5fe4b66c
commit
f4718a9047
@ -104,6 +104,7 @@
|
|||||||
<kbd>c</kbd>: checkout file
|
<kbd>c</kbd>: checkout file
|
||||||
<kbd>d</kbd>: discard this commit's changes to this file
|
<kbd>d</kbd>: discard this commit's changes to this file
|
||||||
<kbd>o</kbd>: open file
|
<kbd>o</kbd>: open file
|
||||||
|
<kbd>e</kbd>: edit file
|
||||||
<kbd>space</kbd>: toggle file included in patch
|
<kbd>space</kbd>: toggle file included in patch
|
||||||
<kbd>enter</kbd>: enter file to add selected lines to the patch
|
<kbd>enter</kbd>: enter file to add selected lines to the patch
|
||||||
<kbd>,</kbd>: previous page
|
<kbd>,</kbd>: previous page
|
||||||
|
@ -104,6 +104,7 @@
|
|||||||
<kbd>c</kbd>: bestand uitchecken
|
<kbd>c</kbd>: bestand uitchecken
|
||||||
<kbd>d</kbd>: uitsluit deze commit zijn veranderingen aan dit bestand
|
<kbd>d</kbd>: uitsluit deze commit zijn veranderingen aan dit bestand
|
||||||
<kbd>o</kbd>: open bestand
|
<kbd>o</kbd>: open bestand
|
||||||
|
<kbd>e</kbd>: verander bestand
|
||||||
<kbd>space</kbd>: toggle file included in patch
|
<kbd>space</kbd>: toggle file included in patch
|
||||||
<kbd>enter</kbd>: enter file to add selected lines to the patch
|
<kbd>enter</kbd>: enter file to add selected lines to the patch
|
||||||
<kbd>,</kbd>: previous page
|
<kbd>,</kbd>: previous page
|
||||||
|
@ -104,6 +104,7 @@
|
|||||||
<kbd>c</kbd>: checkout file
|
<kbd>c</kbd>: checkout file
|
||||||
<kbd>d</kbd>: discard this commit's changes to this file
|
<kbd>d</kbd>: discard this commit's changes to this file
|
||||||
<kbd>o</kbd>: otwórz plik
|
<kbd>o</kbd>: otwórz plik
|
||||||
|
<kbd>e</kbd>: edytuj plik
|
||||||
<kbd>space</kbd>: toggle file included in patch
|
<kbd>space</kbd>: toggle file included in patch
|
||||||
<kbd>enter</kbd>: enter file to add selected lines to the patch
|
<kbd>enter</kbd>: enter file to add selected lines to the patch
|
||||||
<kbd>,</kbd>: previous page
|
<kbd>,</kbd>: previous page
|
||||||
|
@ -121,9 +121,22 @@ func (gui *Gui) refreshCommitFilesView() error {
|
|||||||
|
|
||||||
func (gui *Gui) handleOpenOldCommitFile(g *gocui.Gui, v *gocui.View) error {
|
func (gui *Gui) handleOpenOldCommitFile(g *gocui.Gui, v *gocui.View) error {
|
||||||
file := gui.getSelectedCommitFile()
|
file := gui.getSelectedCommitFile()
|
||||||
|
if file == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
return gui.openFile(file.Name)
|
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 {
|
func (gui *Gui) handleToggleFileForPatch(g *gocui.Gui, v *gocui.View) error {
|
||||||
if ok, err := gui.validateNormalWorkingTreeState(); !ok {
|
if ok, err := gui.validateNormalWorkingTreeState(); !ok {
|
||||||
return err
|
return err
|
||||||
|
@ -878,6 +878,12 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
|||||||
Handler: gui.handleOpenOldCommitFile,
|
Handler: gui.handleOpenOldCommitFile,
|
||||||
Description: gui.Tr.SLocalize("openFile"),
|
Description: gui.Tr.SLocalize("openFile"),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
ViewName: "commitFiles",
|
||||||
|
Key: gui.getKey("universal.edit"),
|
||||||
|
Handler: gui.handleEditCommitFile,
|
||||||
|
Description: gui.Tr.SLocalize("editFile"),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
ViewName: "commitFiles",
|
ViewName: "commitFiles",
|
||||||
Key: gui.getKey("universal.select"),
|
Key: gui.getKey("universal.select"),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user