mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-04-23 12:18:51 +02:00
add vscode keybinding
This commit is contained in:
parent
6126ddd373
commit
9a3b565806
@ -180,8 +180,10 @@ func genericFileOpen(g *gocui.Gui, v *gocui.View, open func(string) (string, err
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
_, err = open(file.Name)
|
if output, err := open(file.Name); err != nil {
|
||||||
return err
|
return createErrorPanel(g, output)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func handleFileOpen(g *gocui.Gui, v *gocui.View) error {
|
func handleFileOpen(g *gocui.Gui, v *gocui.View) error {
|
||||||
|
@ -305,7 +305,11 @@ func runCommand(command string) (string, error) {
|
|||||||
splitCmd := strings.Split(command, " ")
|
splitCmd := strings.Split(command, " ")
|
||||||
cmdOut, err := exec.Command(splitCmd[0], splitCmd[1:]...).CombinedOutput()
|
cmdOut, err := exec.Command(splitCmd[0], splitCmd[1:]...).CombinedOutput()
|
||||||
devLog("run command time: ", time.Now().Sub(commandStartTime))
|
devLog("run command time: ", time.Now().Sub(commandStartTime))
|
||||||
return string(cmdOut), err
|
outputString := string(cmdOut)
|
||||||
|
if outputString == "" && err != nil {
|
||||||
|
return err.Error(), err
|
||||||
|
}
|
||||||
|
return outputString, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func openFile(filename string) (string, error) {
|
func openFile(filename string) (string, error) {
|
||||||
|
3
gui.go
3
gui.go
@ -124,6 +124,9 @@ func keybindings(g *gocui.Gui) error {
|
|||||||
if err := g.SetKeybinding("files", 's', gocui.ModNone, handleSublimeFileOpen); err != nil {
|
if err := g.SetKeybinding("files", 's', gocui.ModNone, handleSublimeFileOpen); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
if err := g.SetKeybinding("files", 'v', gocui.ModNone, handleVsCodeFileOpen); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
if err := g.SetKeybinding("files", 'i', gocui.ModNone, handleIgnoreFile); err != nil {
|
if err := g.SetKeybinding("files", 'i', gocui.ModNone, handleIgnoreFile); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user