mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-01-04 03:48:07 +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
|
||||
}
|
||||
_, err = open(file.Name)
|
||||
return err
|
||||
if output, err := open(file.Name); err != nil {
|
||||
return createErrorPanel(g, output)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func handleFileOpen(g *gocui.Gui, v *gocui.View) error {
|
||||
|
@ -305,7 +305,11 @@ func runCommand(command string) (string, error) {
|
||||
splitCmd := strings.Split(command, " ")
|
||||
cmdOut, err := exec.Command(splitCmd[0], splitCmd[1:]...).CombinedOutput()
|
||||
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) {
|
||||
|
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 {
|
||||
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 {
|
||||
return err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user