summaryrefslogtreecommitdiffstats
path: root/pkg/gui/files_panel.go
diff options
context:
space:
mode:
authorRyooooooga <eial5q265e5@gmail.com>2021-08-03 21:38:03 +0900
committerRyooooooga <eial5q265e5@gmail.com>2021-08-03 21:42:14 +0900
commit4f66093335e5a0d370cf43b3fc637c0795376334 (patch)
tree0f71e0ee748ff19133f5545492a4ddeb7f5f35b7 /pkg/gui/files_panel.go
parentd626bcac0029267d3f45223198902f5cb78d9dc1 (diff)
introduce edit command template to open a specifig line of a file
Diffstat (limited to 'pkg/gui/files_panel.go')
-rw-r--r--pkg/gui/files_panel.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/pkg/gui/files_panel.go b/pkg/gui/files_panel.go
index 48c0621cb..f652c3f05 100644
--- a/pkg/gui/files_panel.go
+++ b/pkg/gui/files_panel.go
@@ -474,13 +474,17 @@ func (gui *Gui) handleCommitEditorPress() error {
}
func (gui *Gui) editFile(filename string) error {
- cmdStr, err := gui.GitCommand.EditFileCmdStr(filename)
+ return gui.editFileAtLine(filename, 1)
+}
+
+func (gui *Gui) editFileAtLine(filename string, lineNumber int) error {
+ cmdStr, err := gui.GitCommand.EditFileCmdStr(filename, lineNumber)
if err != nil {
return gui.surfaceError(err)
}
return gui.runSubprocessWithSuspenseAndRefresh(
- gui.OSCommand.WithSpan(gui.Tr.Spans.EditFile).PrepareShellSubProcess(cmdStr),
+ gui.OSCommand.WithSpan(gui.Tr.Spans.EditFile).ShellCommandFromString(cmdStr),
)
}