1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-02-03 13:21:56 +02:00

Use editFileAtLine method for line by line panel

This commit is contained in:
Francisco Miamoto 2022-03-12 20:36:50 -03:00 committed by Jesse Duffield
parent f53b10072d
commit ca8180e1b7

View File

@ -1,8 +1,6 @@
package gui
import (
"fmt"
"github.com/go-errors/errors"
"github.com/jesseduffield/lazygit/pkg/commands/patch"
"github.com/jesseduffield/lazygit/pkg/gui/lbl"
@ -217,8 +215,7 @@ func (gui *Gui) handleOpenFileAtLine() error {
// need to look at current index, then work out what my hunk's header information is, and see how far my line is away from the hunk header
lineNumber := state.CurrentLineNumber()
filenameWithLineNum := fmt.Sprintf("%s:%d", filename, lineNumber)
if err := gui.OSCommand.OpenFile(filenameWithLineNum); err != nil {
if err := gui.editFileAtLine(filename, lineNumber); err != nil {
return err
}