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:
parent
f53b10072d
commit
ca8180e1b7
@ -1,8 +1,6 @@
|
|||||||
package gui
|
package gui
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
|
|
||||||
"github.com/go-errors/errors"
|
"github.com/go-errors/errors"
|
||||||
"github.com/jesseduffield/lazygit/pkg/commands/patch"
|
"github.com/jesseduffield/lazygit/pkg/commands/patch"
|
||||||
"github.com/jesseduffield/lazygit/pkg/gui/lbl"
|
"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
|
// 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()
|
lineNumber := state.CurrentLineNumber()
|
||||||
filenameWithLineNum := fmt.Sprintf("%s:%d", filename, lineNumber)
|
if err := gui.editFileAtLine(filename, lineNumber); err != nil {
|
||||||
if err := gui.OSCommand.OpenFile(filenameWithLineNum); err != nil {
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user