summaryrefslogtreecommitdiffstats
path: root/pkg/commands/oscommands/os.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2022-02-06 13:42:17 +1100
committerJesse Duffield <jessedduffield@gmail.com>2022-03-17 19:13:40 +1100
commitcd31a762b97c071fbd33ea9b82f679890e68eaa7 (patch)
tree7533f1bd20578fa81a8f8cea8772a2397dc0864a /pkg/commands/oscommands/os.go
parentd82f175e79f18756769d91de94458b095130297c (diff)
rename OSCommand field to os
Diffstat (limited to 'pkg/commands/oscommands/os.go')
-rw-r--r--pkg/commands/oscommands/os.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/commands/oscommands/os.go b/pkg/commands/oscommands/os.go
index 53f5bd6f6..1c4f5bf28 100644
--- a/pkg/commands/oscommands/os.go
+++ b/pkg/commands/oscommands/os.go
@@ -72,9 +72,14 @@ func FileType(path string) string {
}
func (c *OSCommand) OpenFile(filename string) error {
+ return c.OpenFileAtLine(filename, 1)
+}
+
+func (c *OSCommand) OpenFileAtLine(filename string, lineNumber int) error {
commandTemplate := c.UserConfig.OS.OpenCommand
templateValues := map[string]string{
"filename": c.Quote(filename),
+ "line": fmt.Sprintf("%d", lineNumber),
}
command := utils.ResolvePlaceholderString(commandTemplate, templateValues)
return c.Cmd.NewShell(command).Run()