Repository: jesseduffield/lazygit (language: go)

Issue:
Crash when opening file in Vim with file number
**Describe the bug**
A clear and concise description of what the bug is.

When in line-by-line mode, pressing `o` will cause a crash.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to line-by-line mode on an existing commit
2. Press o
4. See error

**Expected behavior**
Given `editCommandTemplate: 'vim +{{line}} {{filename}}'` on the config file, I'd expect to see vim open on the selected line.

**Desktop (please complete the following information):**
 - OS: MacOS
 - Lazygit Version `commit=, build date=, build source=homebrew, version=0.33, os=darwin, arch=amd64`

**Additional context**
Add any other context about the problem here.

```
2022/02/22 23:11:32 An error occurred! Please create an issue at: https://github.com/jesseduffield/lazygit/issues

*errors.errorString The file /Users/pedro/.mackup.cfg##os.Darwin,extension.cfg:14 does not exist.

/private/tmp/lazygit-20220219-6744-tl9e1f/lazygit-0.33/pkg/commands/oscommands/cmd_obj_runner.go:149 (0x14e4d5b)
/private/tmp/lazygit-20220219-6744-tl9e1f/lazygit-0.33/pkg/commands/oscommands/cmd_obj_runner.go:72 (0x14e46fc)
/private/tmp/lazygit-20220219-6744-tl9e1f/lazygit-0.33/pkg/commands/oscommands/cmd_obj_runner.go:45 (0x14e44a5)
/private/tmp/lazygit-20220219-6744-tl9e1f/lazygit-0.33/pkg/commands/oscommands/cmd_obj.go:140 (0x14e37af)
/private/tmp/lazygit-20220219-6744-tl9e1f/lazygit-0.33/pkg/commands/oscommands/os.go:80 (0x14e627c)
/private/tmp/lazygit-20220219-6744-tl9e1f/lazygit-0.33/pkg/gui/line_by_line_panel.go:221 (0x1580b09)
/private/tmp/lazygit-20220219-6744-tl9e1f/lazygit-0.33/pkg/gui/line_by_line_panel.go:281 (0x15810d6)
/private/tmp/lazygit-20220219-6744-tl9e1f/lazygit-0.33/pkg/gui/line_by_line_panel.go:202 (0x15808b5)
/private/tmp/lazygit-20220219-6744-tl9e1f/lazygit-0.33/pkg/gui/confirmation_panel.go:317 (0x157de7b)
/private/tmp/lazygit-20220219-6744-tl9e1f/lazygit-0.33/vendor/github.com/jesseduffield/gocui/gui.go:1166 (0x14c9a6e)
/private/tmp/lazygit-20220219-6744-tl9e1f/lazygit-0.33/vendor/github.com/jesseduffield/gocui/gui.go:1134 (0x14c9913)
/private/tmp/lazygit-20220219-6744-tl9e1f/lazygit-0.33/vendor/github.com/jesseduffield/gocui/gui.go:1059 (0x14c949e)
/private/tmp/lazygit-20220219-6744-tl9e1f/lazygit-0.33/vendor/github.com/jesseduffield/gocui/gui.go:650 (0x14c7cc5)
/private/tmp/lazygit-20220219-6744-tl9e1f/lazygit-0.33/vendor/github.com/jesseduffield/gocui/gui.go:610 (0x14c78e5)
/private/tmp/lazygit-20220219-6744-tl9e1f/lazygit-0.33/pkg/gui/gui.go:572 (0x1564827)
/private/tmp/lazygit-20220219-6744-tl9e1f/lazygit-0.33/pkg/gui/gui.go:580 (0x1564b54)
/private/tmp/lazygit-20220219-6744-tl9e1f/lazygit-0.33/pkg/utils/utils.go:106 (0x14d5dc7)
/private/tmp/lazygit-20220219-6744-tl9e1f/lazygit-0.33/pkg/gui/gui.go:579 (0x1564ae7)
/private/tmp/lazygit-20220219-6744-tl9e1f/lazygit-0.33/pkg/app/app.go:248 (0x15b2425)
/private/tmp/lazygit-20220219-6744-tl9e1f/lazygit-0.33/main.go:138 (0x15b3b1d)
/usr/local/Cellar/go/1.17.6/libexec/src/runtime/proc.go:255 (0x10370a7)
/usr/local/Cellar/go/1.17.6/libexec/src/runtime/asm_amd64.s:1581 (0x1065501)
```

```shell
bat /Users/pedro/.mackup.cfg##os.Darwin,extension.cfg
───────┬────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
       │ File: /Users/pedro/.mackup.cfg##os.Darwin,extension.cfg
───────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1   │ [storage]
   2   │ engine = file_system
   3   │ path = Sync/pedro/.dotfiles/
   4   │
   5   │ [applications_to_ignore]
   6   │ ansible
   7   │ asdf
   8   │ bash
   9   │ docker
  10   │ editorconfig
  11   │ git
  12   │ gnupg
  13   │ homebrew
  14   │ ideavim
  15   │ littlesnitch
  16   │ mackup
  17   │ neovim
  18   │ oh-my-zsh
  19   │ pgsql
  20   │ ranger
  21   │ ruby
  22   │ ssh
  23   │ vim
  24   │ vscode
  25   │ zsh
───────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

```


Discussion / hints:

Fix patch:
diff --git a/pkg/gui/line_by_line_panel.go b/pkg/gui/line_by_line_panel.go
index 0576d3c0f19..a033aa0d759 100644
--- a/pkg/gui/line_by_line_panel.go
+++ b/pkg/gui/line_by_line_panel.go
@@ -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
 		}
 


Test patch: