MCPcopy
hub / github.com/jesseduffield/lazygit / GetEditAtLineCmdStr

Method GetEditAtLineCmdStr

pkg/commands/git_commands/file.go:44–54  ·  view source on GitHub ↗
(filename string, lineNumber int)

Source from the content-addressed store, hash-verified

42}
43
44func (self *FileCommands) GetEditAtLineCmdStr(filename string, lineNumber int) (string, bool) {
45 template, suspend := config.GetEditAtLineTemplate(self.os.Platform.Shell, &self.UserConfig().OS, self.guessDefaultEditor)
46
47 templateValues := map[string]string{
48 "filename": self.cmd.Quote(filename),
49 "line": strconv.Itoa(lineNumber),
50 }
51
52 cmdStr := utils.ResolvePlaceholderString(template, templateValues)
53 return cmdStr, suspend
54}
55
56func (self *FileCommands) GetEditAtLineAndWaitCmdStr(filename string, lineNumber int) string {
57 template := config.GetEditAtLineAndWaitTemplate(self.os.Platform.Shell, &self.UserConfig().OS, self.guessDefaultEditor)

Callers 2

TestEditFileAtLineCmdFunction · 0.80
EditFileAtLineMethod · 0.80

Calls 4

GetEditAtLineTemplateFunction · 0.92
ResolvePlaceholderStringFunction · 0.92
UserConfigMethod · 0.80
QuoteMethod · 0.65

Tested by 1

TestEditFileAtLineCmdFunction · 0.64